1 19 20 package org.netbeans.modules.tomcat5.customizer; 21 22 import java.awt.Font ; 23 import javax.accessibility.AccessibleContext ; 24 import javax.swing.JSpinner ; 25 import javax.swing.JTextField ; 26 import org.openide.util.NbBundle; 27 28 29 34 public class CustomizerGeneral extends javax.swing.JPanel { 35 36 private CustomizerDataSupport custData; 37 38 39 public CustomizerGeneral(CustomizerDataSupport custData) { 40 this.custData = custData; 41 initComponents(); 42 43 JTextField jSpinner1TextField = ((JSpinner.NumberEditor )jSpinner1.getEditor()).getTextField(); 44 AccessibleContext ac = jSpinner1TextField.getAccessibleContext(); 45 ac.setAccessibleName(NbBundle.getMessage(CustomizerGeneral.class, "ASCN_ServerPort")); 46 ac.setAccessibleDescription(NbBundle.getMessage(CustomizerGeneral.class, "ASCD_ServerPort")); 47 jLabel1.setLabelFor(jSpinner1TextField); 48 49 JTextField jSpinner2TextField = ((JSpinner.NumberEditor )jSpinner2.getEditor()).getTextField(); 50 ac = jSpinner2TextField.getAccessibleContext(); 51 ac.setAccessibleName(NbBundle.getMessage(CustomizerGeneral.class, "ASCN_ShutdownPort")); 52 ac.setAccessibleDescription(NbBundle.getMessage(CustomizerGeneral.class, "ASCD_ShutdownPort")); 53 jLabel2.setLabelFor(jSpinner2TextField); 54 55 Font font = usernameTextField.getFont(); 57 jSpinner1TextField.setFont(font); 58 jSpinner2TextField.setFont(font); 59 60 monitorCheckBox.setMnemonic(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "MNE_Monitor").charAt(0)); 62 } 63 64 69 private void initComponents() { 71 java.awt.GridBagConstraints gridBagConstraints; 72 73 homeTextField = new javax.swing.JTextField (); 74 baseTextField = new javax.swing.JTextField (); 75 homeLabel = new javax.swing.JLabel (); 76 baseLabel = new javax.swing.JLabel (); 77 usernameTextField = new javax.swing.JTextField (); 78 usernameLabel = new javax.swing.JLabel (); 79 passwordLabel = new javax.swing.JLabel (); 80 monitorCheckBox = new javax.swing.JCheckBox (); 81 passwordField = new javax.swing.JPasswordField (); 82 roleLabel = new javax.swing.JLabel (); 83 jLabel1 = new javax.swing.JLabel (); 84 jLabel2 = new javax.swing.JLabel (); 85 jLabel3 = new javax.swing.JLabel (); 86 jSpinner1 = new javax.swing.JSpinner (); 87 jSpinner2 = new javax.swing.JSpinner (); 88 89 setLayout(new java.awt.GridBagLayout ()); 90 91 homeTextField.setColumns(30); 92 homeTextField.setDocument(custData.getCatalinaHomeModel()); 93 homeTextField.setEditable(false); 94 gridBagConstraints = new java.awt.GridBagConstraints (); 95 gridBagConstraints.gridx = 1; 96 gridBagConstraints.gridy = 0; 97 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 98 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 99 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 100 gridBagConstraints.insets = new java.awt.Insets (12, 5, 0, 12); 101 add(homeTextField, gridBagConstraints); 102 homeTextField.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "ASCN_Home")); 103 homeTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "ASCD_Home")); 104 105 baseTextField.setColumns(30); 106 baseTextField.setDocument(custData.getCatalinaBaseModel()); 107 baseTextField.setEditable(false); 108 gridBagConstraints = new java.awt.GridBagConstraints (); 109 gridBagConstraints.gridx = 1; 110 gridBagConstraints.gridy = 1; 111 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 112 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 113 gridBagConstraints.insets = new java.awt.Insets (5, 5, 0, 12); 114 add(baseTextField, gridBagConstraints); 115 baseTextField.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "ASCN_Base")); 116 baseTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "ASCD_Base")); 117 118 homeLabel.setLabelFor(homeTextField); 119 org.openide.awt.Mnemonics.setLocalizedText(homeLabel, org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "TXT_Catalina_home")); 120 gridBagConstraints = new java.awt.GridBagConstraints (); 121 gridBagConstraints.gridx = 0; 122 gridBagConstraints.gridy = 0; 123 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 124 gridBagConstraints.insets = new java.awt.Insets (12, 12, 0, 0); 125 add(homeLabel, gridBagConstraints); 126 homeLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "ASCN_Home")); 127 homeLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "ASCD_Home")); 128 129 baseLabel.setLabelFor(baseTextField); 130 org.openide.awt.Mnemonics.setLocalizedText(baseLabel, org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "TXT_Catalina_Base")); 131 gridBagConstraints = new java.awt.GridBagConstraints (); 132 gridBagConstraints.gridx = 0; 133 gridBagConstraints.gridy = 1; 134 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 135 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 0); 136 add(baseLabel, gridBagConstraints); 137 baseLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "ASCN_Base")); 138 baseLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "ASCD_Base")); 139 140 usernameTextField.setColumns(15); 141 usernameTextField.setDocument(custData.getUsernameModel()); 142 gridBagConstraints = new java.awt.GridBagConstraints (); 143 gridBagConstraints.gridx = 1; 144 gridBagConstraints.gridy = 2; 145 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 146 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 147 gridBagConstraints.weightx = 1.0; 148 gridBagConstraints.insets = new java.awt.Insets (11, 5, 0, 0); 149 add(usernameTextField, gridBagConstraints); 150 usernameTextField.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "ACSN_Username")); 151 usernameTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "ACSD_Username")); 152 153 usernameLabel.setLabelFor(usernameTextField); 154 org.openide.awt.Mnemonics.setLocalizedText(usernameLabel, org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "TXT_Username")); 155 gridBagConstraints = new java.awt.GridBagConstraints (); 156 gridBagConstraints.gridx = 0; 157 gridBagConstraints.gridy = 2; 158 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 159 gridBagConstraints.insets = new java.awt.Insets (11, 12, 0, 0); 160 add(usernameLabel, gridBagConstraints); 161 usernameLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "ACSN_Username")); 162 usernameLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "ACSD_Username")); 163 164 passwordLabel.setLabelFor(passwordField); 165 org.openide.awt.Mnemonics.setLocalizedText(passwordLabel, org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "TXT_Password")); 166 gridBagConstraints = new java.awt.GridBagConstraints (); 167 gridBagConstraints.gridx = 0; 168 gridBagConstraints.gridy = 3; 169 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 170 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 0); 171 add(passwordLabel, gridBagConstraints); 172 passwordLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "ACSN_Password")); 173 passwordLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "ACSD_Password")); 174 175 monitorCheckBox.setMnemonic(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "MNE_Monitor").charAt(0)); 176 monitorCheckBox.setText(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "TXT_Monitor")); 177 monitorCheckBox.setModel(custData.getMonitorModel()); 178 gridBagConstraints = new java.awt.GridBagConstraints (); 179 gridBagConstraints.gridx = 0; 180 gridBagConstraints.gridy = 7; 181 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 182 gridBagConstraints.gridheight = java.awt.GridBagConstraints.RELATIVE; 183 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 184 gridBagConstraints.weightx = 1.0; 185 gridBagConstraints.weighty = 1.0; 186 gridBagConstraints.insets = new java.awt.Insets (11, 12, 0, 0); 187 add(monitorCheckBox, gridBagConstraints); 188 monitorCheckBox.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "ASCN_HttpMonitor")); 189 monitorCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "ASCD_HttpMonitor")); 190 191 passwordField.setColumns(15); 192 passwordField.setDocument(custData.getPasswordModel()); 193 gridBagConstraints = new java.awt.GridBagConstraints (); 194 gridBagConstraints.gridx = 1; 195 gridBagConstraints.gridy = 3; 196 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 197 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 198 gridBagConstraints.weightx = 1.0; 199 gridBagConstraints.insets = new java.awt.Insets (5, 5, 0, 0); 200 add(passwordField, gridBagConstraints); 201 passwordField.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "ACSN_Password")); 202 passwordField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "ACSD_Password")); 203 204 org.openide.awt.Mnemonics.setLocalizedText(roleLabel, org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "TXT_ManagerRole")); 205 gridBagConstraints = new java.awt.GridBagConstraints (); 206 gridBagConstraints.gridx = 2; 207 gridBagConstraints.gridy = 2; 208 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 209 gridBagConstraints.insets = new java.awt.Insets (11, 5, 0, 12); 210 add(roleLabel, gridBagConstraints); 211 212 org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "TXT_ServerPort")); 213 gridBagConstraints = new java.awt.GridBagConstraints (); 214 gridBagConstraints.gridx = 0; 215 gridBagConstraints.gridy = 5; 216 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 217 gridBagConstraints.insets = new java.awt.Insets (11, 12, 0, 0); 218 add(jLabel1, gridBagConstraints); 219 jLabel1.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "ASCN_ServerPort")); 220 jLabel1.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "ASCD_ServerPort")); 221 222 org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "TXT_ShutdownPort")); 223 gridBagConstraints = new java.awt.GridBagConstraints (); 224 gridBagConstraints.gridx = 0; 225 gridBagConstraints.gridy = 6; 226 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 227 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 0); 228 add(jLabel2, gridBagConstraints); 229 jLabel2.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "ASCN_ShutdownPort")); 230 jLabel2.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "ASCD_ShutdownPort")); 231 232 org.openide.awt.Mnemonics.setLocalizedText(jLabel3, org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "TXT_NoteChangesTakeAffect")); 233 gridBagConstraints = new java.awt.GridBagConstraints (); 234 gridBagConstraints.gridx = 0; 235 gridBagConstraints.gridy = 9; 236 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 237 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 238 gridBagConstraints.insets = new java.awt.Insets (5, 12, 12, 0); 239 add(jLabel3, gridBagConstraints); 240 jLabel3.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "ASCN_Note")); 241 jLabel3.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "ASCD_Note")); 242 243 jSpinner1.setFont(new java.awt.Font ("Dialog", 0, 12)); 244 jSpinner1.setModel(custData.getServerPortModel()); 245 jSpinner1.setEditor(new JSpinner.NumberEditor (jSpinner1, "#")); 246 gridBagConstraints = new java.awt.GridBagConstraints (); 247 gridBagConstraints.gridx = 1; 248 gridBagConstraints.gridy = 5; 249 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 250 gridBagConstraints.insets = new java.awt.Insets (11, 5, 0, 0); 251 add(jSpinner1, gridBagConstraints); 252 253 jSpinner2.setFont(new java.awt.Font ("Dialog", 0, 12)); 254 jSpinner2.setModel(custData.getShutdownPortModel()); 255 jSpinner2.setEditor(new JSpinner.NumberEditor (jSpinner2, "#")); 256 gridBagConstraints = new java.awt.GridBagConstraints (); 257 gridBagConstraints.gridx = 1; 258 gridBagConstraints.gridy = 6; 259 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 260 gridBagConstraints.insets = new java.awt.Insets (5, 5, 0, 0); 261 add(jSpinner2, gridBagConstraints); 262 263 } 265 266 private javax.swing.JLabel baseLabel; 268 private javax.swing.JTextField baseTextField; 269 private javax.swing.JLabel homeLabel; 270 private javax.swing.JTextField homeTextField; 271 private javax.swing.JLabel jLabel1; 272 private javax.swing.JLabel jLabel2; 273 private javax.swing.JLabel jLabel3; 274 private javax.swing.JSpinner jSpinner1; 275 private javax.swing.JSpinner jSpinner2; 276 private javax.swing.JCheckBox monitorCheckBox; 277 private javax.swing.JPasswordField passwordField; 278 private javax.swing.JLabel passwordLabel; 279 private javax.swing.JLabel roleLabel; 280 private javax.swing.JLabel usernameLabel; 281 private javax.swing.JTextField usernameTextField; 282 284 } 285 | Popular Tags |