KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > versioning > system > cvss > ui > actions > ChangeCVSRootPanel


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.modules.versioning.system.cvss.ui.actions;
20
21 import org.netbeans.modules.versioning.system.cvss.ui.wizards.RootWizard;
22
23 import javax.swing.*;
24
25 /**
26  *
27  * @author Maros Sandor
28  */

29 class ChangeCVSRootPanel extends javax.swing.JPanel JavaDoc {
30     
31     public ChangeCVSRootPanel() {
32         initComponents();
33     }
34
35     public JTextField getCurrentCVSRoot() {
36         return currentCVSRoot;
37     }
38
39     public JComboBox getNewRootCombo() {
40         return newRootCombo;
41     }
42
43     public JTextField getWorkingCopy() {
44         return workingCopy;
45     }
46
47     /** This method is called from within the constructor to
48      * initialize the form.
49      * WARNING: Do NOT modify this code. The content of this method is
50      * always regenerated by the Form Editor.
51      */

52     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
53
private void initComponents() {
54
55         jLabel1 = new javax.swing.JLabel JavaDoc();
56         jLabel2 = new javax.swing.JLabel JavaDoc();
57         jLabel3 = new javax.swing.JLabel JavaDoc();
58         currentCVSRoot = new javax.swing.JTextField JavaDoc();
59         workingCopy = new javax.swing.JTextField JavaDoc();
60         jButton1 = new javax.swing.JButton JavaDoc();
61         newRootCombo = new javax.swing.JComboBox JavaDoc();
62
63         jLabel1.setLabelFor(workingCopy);
64         org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(ChangeCVSRootPanel.class, "ChangeCVSRootPanel.jLabel1.text")); // NOI18N
65

66         jLabel2.setLabelFor(currentCVSRoot);
67         org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(ChangeCVSRootPanel.class, "ChangeCVSRootPanel.jLabel2.text")); // NOI18N
68

69         org.openide.awt.Mnemonics.setLocalizedText(jLabel3, org.openide.util.NbBundle.getMessage(ChangeCVSRootPanel.class, "ChangeCVSRootPanel.jLabel3.text")); // NOI18N
70

71         currentCVSRoot.setEditable(false);
72         currentCVSRoot.setText(org.openide.util.NbBundle.getMessage(ChangeCVSRootPanel.class, "ChangeCVSRootPanel.currentCVSRoot.text")); // NOI18N
73

74         workingCopy.setEditable(false);
75         workingCopy.setText(org.openide.util.NbBundle.getMessage(ChangeCVSRootPanel.class, "ChangeCVSRootPanel.workingCopy.text")); // NOI18N
76

77         org.openide.awt.Mnemonics.setLocalizedText(jButton1, org.openide.util.NbBundle.getMessage(ChangeCVSRootPanel.class, "ChangeCVSRootPanel.jButton1.text")); // NOI18N
78
jButton1.addActionListener(new java.awt.event.ActionListener JavaDoc() {
79             public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
80                 jButton1ActionPerformed(evt);
81             }
82         });
83
84         newRootCombo.setEditable(true);
85
86         org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
87         this.setLayout(layout);
88         layout.setHorizontalGroup(
89             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
90             .add(layout.createSequentialGroup()
91                 .addContainerGap()
92                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
93                     .add(jLabel2)
94                     .add(jLabel1)
95                     .add(jLabel3))
96                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
97                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
98                     .add(workingCopy, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 463, Short.MAX_VALUE)
99                     .add(currentCVSRoot, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 463, Short.MAX_VALUE)
100                     .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
101                         .add(newRootCombo, 0, 392, Short.MAX_VALUE)
102                         .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
103                         .add(jButton1)))
104                 .addContainerGap())
105         );
106         layout.setVerticalGroup(
107             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
108             .add(layout.createSequentialGroup()
109                 .addContainerGap()
110                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
111                     .add(jLabel1)
112                     .add(workingCopy, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
113                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
114                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
115                     .add(jLabel2)
116                     .add(currentCVSRoot, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
117                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
118                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
119                     .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
120                         .add(jLabel3)
121                         .add(newRootCombo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
122                     .add(jButton1))
123                 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
124         );
125     }// </editor-fold>//GEN-END:initComponents
126

127     private void jButton1ActionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
128         String JavaDoc root = newRootCombo.getSelectedItem().toString();
129         root = RootWizard.editCvsRoot(root);
130         if (root != null) {
131             newRootCombo.setSelectedItem(root);
132         }
133     }
134     
135     // Variables declaration - do not modify//GEN-BEGIN:variables
136
private javax.swing.JTextField JavaDoc currentCVSRoot;
137     private javax.swing.JButton JavaDoc jButton1;
138     private javax.swing.JLabel JavaDoc jLabel1;
139     private javax.swing.JLabel JavaDoc jLabel2;
140     private javax.swing.JLabel JavaDoc jLabel3;
141     private javax.swing.JComboBox JavaDoc newRootCombo;
142     private javax.swing.JTextField JavaDoc workingCopy;
143     // End of variables declaration//GEN-END:variables
144

145 }
146
Popular Tags