KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > tomcat5 > customizer > CustomizerGeneral


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-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.tomcat5.customizer;
21
22 import java.awt.Font JavaDoc;
23 import javax.accessibility.AccessibleContext JavaDoc;
24 import javax.swing.JSpinner JavaDoc;
25 import javax.swing.JTextField JavaDoc;
26 import org.openide.util.NbBundle;
27
28
29 /**
30  * Customizer general (connection) tab.
31  *
32  * @author sherold
33  */

34 public class CustomizerGeneral extends javax.swing.JPanel JavaDoc {
35
36     private CustomizerDataSupport custData;
37
38     /** Creates new form CustomizerGeneral */
39     public CustomizerGeneral(CustomizerDataSupport custData) {
40         this.custData = custData;
41         initComponents();
42         
43         JTextField JavaDoc jSpinner1TextField = ((JSpinner.NumberEditor JavaDoc)jSpinner1.getEditor()).getTextField();
44         AccessibleContext JavaDoc 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 JavaDoc jSpinner2TextField = ((JSpinner.NumberEditor JavaDoc)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         // work-around for jspinner incorrect fonts
56
Font JavaDoc font = usernameTextField.getFont();
57         jSpinner1TextField.setFont(font);
58         jSpinner2TextField.setFont(font);
59         
60         // mnemonics generated in the guarded block do not work
61
monitorCheckBox.setMnemonic(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "MNE_Monitor").charAt(0));
62     }
63     
64     /** This method is called from within the constructor to
65      * initialize the form.
66      * WARNING: Do NOT modify this code. The content of this method is
67      * always regenerated by the Form Editor.
68      */

69     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
70
private void initComponents() {
71         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
72
73         homeTextField = new javax.swing.JTextField JavaDoc();
74         baseTextField = new javax.swing.JTextField JavaDoc();
75         homeLabel = new javax.swing.JLabel JavaDoc();
76         baseLabel = new javax.swing.JLabel JavaDoc();
77         usernameTextField = new javax.swing.JTextField JavaDoc();
78         usernameLabel = new javax.swing.JLabel JavaDoc();
79         passwordLabel = new javax.swing.JLabel JavaDoc();
80         monitorCheckBox = new javax.swing.JCheckBox JavaDoc();
81         passwordField = new javax.swing.JPasswordField JavaDoc();
82         roleLabel = new javax.swing.JLabel JavaDoc();
83         jLabel1 = new javax.swing.JLabel JavaDoc();
84         jLabel2 = new javax.swing.JLabel JavaDoc();
85         jLabel3 = new javax.swing.JLabel JavaDoc();
86         jSpinner1 = new javax.swing.JSpinner JavaDoc();
87         jSpinner2 = new javax.swing.JSpinner JavaDoc();
88
89         setLayout(new java.awt.GridBagLayout JavaDoc());
90
91         homeTextField.setColumns(30);
92         homeTextField.setDocument(custData.getCatalinaHomeModel());
93         homeTextField.setEditable(false);
94         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
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 JavaDoc(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 JavaDoc();
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 JavaDoc(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 JavaDoc();
121         gridBagConstraints.gridx = 0;
122         gridBagConstraints.gridy = 0;
123         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
124         gridBagConstraints.insets = new java.awt.Insets JavaDoc(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 JavaDoc();
132         gridBagConstraints.gridx = 0;
133         gridBagConstraints.gridy = 1;
134         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
135         gridBagConstraints.insets = new java.awt.Insets JavaDoc(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 JavaDoc();
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 JavaDoc(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 JavaDoc();
156         gridBagConstraints.gridx = 0;
157         gridBagConstraints.gridy = 2;
158         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
159         gridBagConstraints.insets = new java.awt.Insets JavaDoc(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 JavaDoc();
167         gridBagConstraints.gridx = 0;
168         gridBagConstraints.gridy = 3;
169         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
170         gridBagConstraints.insets = new java.awt.Insets JavaDoc(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 JavaDoc();
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 JavaDoc(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 JavaDoc();
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 JavaDoc(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 JavaDoc();
206         gridBagConstraints.gridx = 2;
207         gridBagConstraints.gridy = 2;
208         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
209         gridBagConstraints.insets = new java.awt.Insets JavaDoc(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 JavaDoc();
214         gridBagConstraints.gridx = 0;
215         gridBagConstraints.gridy = 5;
216         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
217         gridBagConstraints.insets = new java.awt.Insets JavaDoc(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 JavaDoc();
224         gridBagConstraints.gridx = 0;
225         gridBagConstraints.gridy = 6;
226         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
227         gridBagConstraints.insets = new java.awt.Insets JavaDoc(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 JavaDoc();
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 JavaDoc(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 JavaDoc("Dialog", 0, 12));
244         jSpinner1.setModel(custData.getServerPortModel());
245         jSpinner1.setEditor(new JSpinner.NumberEditor JavaDoc(jSpinner1, "#"));
246         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
247         gridBagConstraints.gridx = 1;
248         gridBagConstraints.gridy = 5;
249         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
250         gridBagConstraints.insets = new java.awt.Insets JavaDoc(11, 5, 0, 0);
251         add(jSpinner1, gridBagConstraints);
252
253         jSpinner2.setFont(new java.awt.Font JavaDoc("Dialog", 0, 12));
254         jSpinner2.setModel(custData.getShutdownPortModel());
255         jSpinner2.setEditor(new JSpinner.NumberEditor JavaDoc(jSpinner2, "#"));
256         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
257         gridBagConstraints.gridx = 1;
258         gridBagConstraints.gridy = 6;
259         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
260         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 5, 0, 0);
261         add(jSpinner2, gridBagConstraints);
262
263     }// </editor-fold>//GEN-END:initComponents
264

265     
266     // Variables declaration - do not modify//GEN-BEGIN:variables
267
private javax.swing.JLabel JavaDoc baseLabel;
268     private javax.swing.JTextField JavaDoc baseTextField;
269     private javax.swing.JLabel JavaDoc homeLabel;
270     private javax.swing.JTextField JavaDoc homeTextField;
271     private javax.swing.JLabel JavaDoc jLabel1;
272     private javax.swing.JLabel JavaDoc jLabel2;
273     private javax.swing.JLabel JavaDoc jLabel3;
274     private javax.swing.JSpinner JavaDoc jSpinner1;
275     private javax.swing.JSpinner JavaDoc jSpinner2;
276     private javax.swing.JCheckBox JavaDoc monitorCheckBox;
277     private javax.swing.JPasswordField JavaDoc passwordField;
278     private javax.swing.JLabel JavaDoc passwordLabel;
279     private javax.swing.JLabel JavaDoc roleLabel;
280     private javax.swing.JLabel JavaDoc usernameLabel;
281     private javax.swing.JTextField JavaDoc usernameTextField;
282     // End of variables declaration//GEN-END:variables
283

284 }
285
Popular Tags