1 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 29 class ChangeCVSRootPanel extends javax.swing.JPanel { 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 52 private void initComponents() { 54 55 jLabel1 = new javax.swing.JLabel (); 56 jLabel2 = new javax.swing.JLabel (); 57 jLabel3 = new javax.swing.JLabel (); 58 currentCVSRoot = new javax.swing.JTextField (); 59 workingCopy = new javax.swing.JTextField (); 60 jButton1 = new javax.swing.JButton (); 61 newRootCombo = new javax.swing.JComboBox (); 62 63 jLabel1.setLabelFor(workingCopy); 64 org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(ChangeCVSRootPanel.class, "ChangeCVSRootPanel.jLabel1.text")); 66 jLabel2.setLabelFor(currentCVSRoot); 67 org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(ChangeCVSRootPanel.class, "ChangeCVSRootPanel.jLabel2.text")); 69 org.openide.awt.Mnemonics.setLocalizedText(jLabel3, org.openide.util.NbBundle.getMessage(ChangeCVSRootPanel.class, "ChangeCVSRootPanel.jLabel3.text")); 71 currentCVSRoot.setEditable(false); 72 currentCVSRoot.setText(org.openide.util.NbBundle.getMessage(ChangeCVSRootPanel.class, "ChangeCVSRootPanel.currentCVSRoot.text")); 74 workingCopy.setEditable(false); 75 workingCopy.setText(org.openide.util.NbBundle.getMessage(ChangeCVSRootPanel.class, "ChangeCVSRootPanel.workingCopy.text")); 77 org.openide.awt.Mnemonics.setLocalizedText(jButton1, org.openide.util.NbBundle.getMessage(ChangeCVSRootPanel.class, "ChangeCVSRootPanel.jButton1.text")); jButton1.addActionListener(new java.awt.event.ActionListener () { 79 public void actionPerformed(java.awt.event.ActionEvent 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 } 127 private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { 128 String root = newRootCombo.getSelectedItem().toString(); 129 root = RootWizard.editCvsRoot(root); 130 if (root != null) { 131 newRootCombo.setSelectedItem(root); 132 } 133 } 134 135 private javax.swing.JTextField currentCVSRoot; 137 private javax.swing.JButton jButton1; 138 private javax.swing.JLabel jLabel1; 139 private javax.swing.JLabel jLabel2; 140 private javax.swing.JLabel jLabel3; 141 private javax.swing.JComboBox newRootCombo; 142 private javax.swing.JTextField workingCopy; 143 145 } 146 | Popular Tags |