001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041: package org.netbeans.modules.versioning.system.cvss.ui.actions;
042:
043: import org.netbeans.modules.versioning.system.cvss.ui.wizards.RootWizard;
044:
045: import javax.swing.*;
046:
047: /**
048: *
049: * @author Maros Sandor
050: */
051: class ChangeCVSRootPanel extends javax.swing.JPanel {
052:
053: public ChangeCVSRootPanel() {
054: initComponents();
055: }
056:
057: public JTextField getCurrentCVSRoot() {
058: return currentCVSRoot;
059: }
060:
061: public JComboBox getNewRootCombo() {
062: return newRootCombo;
063: }
064:
065: public JTextField getWorkingCopy() {
066: return workingCopy;
067: }
068:
069: /** This method is called from within the constructor to
070: * initialize the form.
071: * WARNING: Do NOT modify this code. The content of this method is
072: * always regenerated by the Form Editor.
073: */
074: // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
075: private void initComponents() {
076:
077: jLabel1 = new javax.swing.JLabel();
078: jLabel2 = new javax.swing.JLabel();
079: jLabel3 = new javax.swing.JLabel();
080: currentCVSRoot = new javax.swing.JTextField();
081: workingCopy = new javax.swing.JTextField();
082: jButton1 = new javax.swing.JButton();
083: newRootCombo = new javax.swing.JComboBox();
084:
085: jLabel1.setLabelFor(workingCopy);
086: org.openide.awt.Mnemonics.setLocalizedText(jLabel1,
087: org.openide.util.NbBundle.getMessage(
088: ChangeCVSRootPanel.class,
089: "ChangeCVSRootPanel.jLabel1.text")); // NOI18N
090:
091: jLabel2.setLabelFor(currentCVSRoot);
092: org.openide.awt.Mnemonics.setLocalizedText(jLabel2,
093: org.openide.util.NbBundle.getMessage(
094: ChangeCVSRootPanel.class,
095: "ChangeCVSRootPanel.jLabel2.text")); // NOI18N
096:
097: org.openide.awt.Mnemonics.setLocalizedText(jLabel3,
098: org.openide.util.NbBundle.getMessage(
099: ChangeCVSRootPanel.class,
100: "ChangeCVSRootPanel.jLabel3.text")); // NOI18N
101:
102: currentCVSRoot.setEditable(false);
103: currentCVSRoot.setText(org.openide.util.NbBundle.getMessage(
104: ChangeCVSRootPanel.class,
105: "ChangeCVSRootPanel.currentCVSRoot.text")); // NOI18N
106:
107: workingCopy.setEditable(false);
108: workingCopy.setText(org.openide.util.NbBundle.getMessage(
109: ChangeCVSRootPanel.class,
110: "ChangeCVSRootPanel.workingCopy.text")); // NOI18N
111:
112: org.openide.awt.Mnemonics.setLocalizedText(jButton1,
113: org.openide.util.NbBundle.getMessage(
114: ChangeCVSRootPanel.class,
115: "ChangeCVSRootPanel.jButton1.text")); // NOI18N
116: jButton1.addActionListener(new java.awt.event.ActionListener() {
117: public void actionPerformed(java.awt.event.ActionEvent evt) {
118: jButton1ActionPerformed(evt);
119: }
120: });
121:
122: newRootCombo.setEditable(true);
123:
124: org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(
125: this );
126: this .setLayout(layout);
127: layout
128: .setHorizontalGroup(layout
129: .createParallelGroup(
130: org.jdesktop.layout.GroupLayout.LEADING)
131: .add(
132: layout
133: .createSequentialGroup()
134: .addContainerGap()
135: .add(
136: layout
137: .createParallelGroup(
138: org.jdesktop.layout.GroupLayout.LEADING)
139: .add(jLabel2)
140: .add(jLabel1)
141: .add(jLabel3))
142: .addPreferredGap(
143: org.jdesktop.layout.LayoutStyle.RELATED)
144: .add(
145: layout
146: .createParallelGroup(
147: org.jdesktop.layout.GroupLayout.LEADING)
148: .add(
149: workingCopy,
150: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
151: 463,
152: Short.MAX_VALUE)
153: .add(
154: currentCVSRoot,
155: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
156: 463,
157: Short.MAX_VALUE)
158: .add(
159: org.jdesktop.layout.GroupLayout.TRAILING,
160: layout
161: .createSequentialGroup()
162: .add(
163: newRootCombo,
164: 0,
165: 392,
166: Short.MAX_VALUE)
167: .addPreferredGap(
168: org.jdesktop.layout.LayoutStyle.RELATED)
169: .add(
170: jButton1)))
171: .addContainerGap()));
172: layout
173: .setVerticalGroup(layout
174: .createParallelGroup(
175: org.jdesktop.layout.GroupLayout.LEADING)
176: .add(
177: layout
178: .createSequentialGroup()
179: .addContainerGap()
180: .add(
181: layout
182: .createParallelGroup(
183: org.jdesktop.layout.GroupLayout.BASELINE)
184: .add(jLabel1)
185: .add(
186: workingCopy,
187: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
188: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
189: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
190: .addPreferredGap(
191: org.jdesktop.layout.LayoutStyle.RELATED)
192: .add(
193: layout
194: .createParallelGroup(
195: org.jdesktop.layout.GroupLayout.BASELINE)
196: .add(jLabel2)
197: .add(
198: currentCVSRoot,
199: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
200: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
201: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
202: .addPreferredGap(
203: org.jdesktop.layout.LayoutStyle.RELATED)
204: .add(
205: layout
206: .createParallelGroup(
207: org.jdesktop.layout.GroupLayout.LEADING)
208: .add(
209: layout
210: .createParallelGroup(
211: org.jdesktop.layout.GroupLayout.BASELINE)
212: .add(
213: jLabel3)
214: .add(
215: newRootCombo,
216: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
217: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
218: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
219: .add(jButton1))
220: .addContainerGap(
221: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
222: Short.MAX_VALUE)));
223: }// </editor-fold>//GEN-END:initComponents
224:
225: private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
226: Object item = newRootCombo.getSelectedItem();
227: String root = item == null ? "" : item.toString();
228: root = RootWizard.editCvsRoot(root);
229: if (root != null) {
230: newRootCombo.setSelectedItem(root);
231: }
232: }
233:
234: // Variables declaration - do not modify//GEN-BEGIN:variables
235: private javax.swing.JTextField currentCVSRoot;
236: private javax.swing.JButton jButton1;
237: private javax.swing.JLabel jLabel1;
238: private javax.swing.JLabel jLabel2;
239: private javax.swing.JLabel jLabel3;
240: private javax.swing.JComboBox newRootCombo;
241: private javax.swing.JTextField workingCopy;
242: // End of variables declaration//GEN-END:variables
243:
244: }
|