KickJava   Java API By Example, From Geeks To Geeks.

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


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 org.netbeans.api.java.platform.PlatformsCustomizer;
23
24 /**
25  * Customizer JVM (Platform) tab.
26  *
27  * @author sherold
28  */

29 public class CustomizerJVM extends javax.swing.JPanel JavaDoc {
30
31     private CustomizerDataSupport custData;
32
33     /** Creates new form CustomizerJVM */
34     public CustomizerJVM(CustomizerDataSupport custData) {
35         this.custData = custData;
36         initComponents();
37         // mnemonics generated in the guarded block do not work
38
jCheckBox1.setMnemonic(org.openide.util.NbBundle.getMessage(CustomizerJVM.class, "MNE_SecurityMan").charAt(0));
39         proxyCheckBox.setMnemonic(org.openide.util.NbBundle.getMessage(CustomizerJVM.class, "MNE_HttpProxy").charAt(0));
40     }
41     
42     /** This method is called from within the constructor to
43      * initialize the form.
44      * WARNING: Do NOT modify this code. The content of this method is
45      * always regenerated by the Form Editor.
46      */

47     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
48
private void initComponents() {
49         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
50
51         jPanel1 = new javax.swing.JPanel JavaDoc();
52         jvmLabel = new javax.swing.JLabel JavaDoc();
53         jvmButton = new javax.swing.JButton JavaDoc();
54         jvmComboBox = new javax.swing.JComboBox JavaDoc();
55         jCheckBox1 = new javax.swing.JCheckBox JavaDoc();
56         jLabel1 = new javax.swing.JLabel JavaDoc();
57         jTextField1 = new javax.swing.JTextField JavaDoc();
58         jLabel2 = new javax.swing.JLabel JavaDoc();
59         jLabel3 = new javax.swing.JLabel JavaDoc();
60         proxyCheckBox = new javax.swing.JCheckBox JavaDoc();
61
62         setLayout(new java.awt.BorderLayout JavaDoc());
63
64         jPanel1.setLayout(new java.awt.GridBagLayout JavaDoc());
65
66         jvmLabel.setLabelFor(jvmComboBox);
67         org.openide.awt.Mnemonics.setLocalizedText(jvmLabel, org.openide.util.NbBundle.getMessage(CustomizerJVM.class, "TXT_JVM"));
68         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
69         gridBagConstraints.gridx = 0;
70         gridBagConstraints.gridy = 0;
71         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
72         gridBagConstraints.insets = new java.awt.Insets JavaDoc(12, 12, 0, 0);
73         jPanel1.add(jvmLabel, gridBagConstraints);
74         jvmLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomizerJVM.class, "ASCN_JVM"));
75         jvmLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomizerJVM.class, "ASCD_JavaPlatform"));
76
77         org.openide.awt.Mnemonics.setLocalizedText(jvmButton, org.openide.util.NbBundle.getMessage(CustomizerJVM.class, "TXT_ManagePlatforms"));
78         jvmButton.addActionListener(new java.awt.event.ActionListener JavaDoc() {
79             public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
80                 jvmButtonActionPerformed(evt);
81             }
82         });
83
84         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
85         gridBagConstraints.gridx = 2;
86         gridBagConstraints.gridy = 0;
87         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
88         gridBagConstraints.insets = new java.awt.Insets JavaDoc(12, 5, 0, 12);
89         jPanel1.add(jvmButton, gridBagConstraints);
90         jvmButton.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomizerJVM.class, "ASCN_ManagerPlatform"));
91         jvmButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomizerJVM.class, "ASCD_JavaPlatform"));
92
93         jvmComboBox.setModel(custData.getJvmModel());
94         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
95         gridBagConstraints.gridx = 1;
96         gridBagConstraints.gridy = 0;
97         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
98         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
99         gridBagConstraints.weightx = 1.0;
100         gridBagConstraints.insets = new java.awt.Insets JavaDoc(12, 5, 0, 0);
101         jPanel1.add(jvmComboBox, gridBagConstraints);
102
103         jCheckBox1.setMnemonic(org.openide.util.NbBundle.getMessage(CustomizerJVM.class, "MNE_SecurityMan", new Object JavaDoc[] {}).charAt(0));
104         org.openide.awt.Mnemonics.setLocalizedText(jCheckBox1, org.openide.util.NbBundle.getMessage(CustomizerJVM.class, "TXT_SecurityMan"));
105         jCheckBox1.setIconTextGap(5);
106         jCheckBox1.setModel(custData.getSecManagerModel());
107         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
108         gridBagConstraints.gridx = 0;
109         gridBagConstraints.gridy = 4;
110         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
111         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
112         gridBagConstraints.weightx = 1.0;
113         gridBagConstraints.weighty = 1.0;
114         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 8, 0, 0);
115         jPanel1.add(jCheckBox1, gridBagConstraints);
116         jCheckBox1.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomizerJVM.class, "ASCN_SecManager"));
117         jCheckBox1.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomizerJVM.class, "ASCD_SecManager"));
118
119         jLabel1.setLabelFor(jTextField1);
120         org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(CustomizerJVM.class, "TXT_VMOptions"));
121         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
122         gridBagConstraints.gridx = 0;
123         gridBagConstraints.gridy = 1;
124         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
125         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 0);
126         jPanel1.add(jLabel1, gridBagConstraints);
127         jLabel1.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomizerJVM.class, "ASCN_VMOpts"));
128         jLabel1.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomizerJVM.class, "ASCD_VMOpts"));
129
130         jTextField1.setColumns(30);
131         jTextField1.setDocument(custData.getJavaOptsModel());
132         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
133         gridBagConstraints.gridx = 1;
134         gridBagConstraints.gridy = 1;
135         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
136         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
137         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
138         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 5, 0, 12);
139         jPanel1.add(jTextField1, gridBagConstraints);
140
141         org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(CustomizerJVM.class, "TXT_VMOptionsEG"));
142         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
143         gridBagConstraints.gridx = 1;
144         gridBagConstraints.gridy = 2;
145         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
146         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
147         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 5, 0, 0);
148         jPanel1.add(jLabel2, gridBagConstraints);
149         jLabel2.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomizerJVM.class, "ASCN_VMOptEG"));
150         jLabel2.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomizerJVM.class, "ASCD_VmOptsEG"));
151
152         org.openide.awt.Mnemonics.setLocalizedText(jLabel3, org.openide.util.NbBundle.getMessage(CustomizerJVM.class, "TXT_NoteChangesTakeAffect"));
153         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
154         gridBagConstraints.gridx = 0;
155         gridBagConstraints.gridy = 5;
156         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
157         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
158         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 12, 0);
159         jPanel1.add(jLabel3, gridBagConstraints);
160         jLabel3.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomizerJVM.class, "ASCN_Note"));
161         jLabel3.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomizerJVM.class, "ASCD_Note"));
162
163         proxyCheckBox.setMnemonic(org.openide.util.NbBundle.getMessage(CustomizerJVM.class, "MNE_HttpProxy", new Object JavaDoc[] {}).charAt(0));
164         org.openide.awt.Mnemonics.setLocalizedText(proxyCheckBox, org.openide.util.NbBundle.getMessage(CustomizerJVM.class, "LBL_HttpProxy", new Object JavaDoc[] {}));
165         proxyCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
166         proxyCheckBox.setMargin(new java.awt.Insets JavaDoc(0, 0, 0, 0));
167         proxyCheckBox.setModel(custData.getProxyModel());
168         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
169         gridBagConstraints.gridx = 0;
170         gridBagConstraints.gridy = 3;
171         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
172         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
173         gridBagConstraints.weightx = 1.0;
174         gridBagConstraints.insets = new java.awt.Insets JavaDoc(11, 12, 0, 0);
175         jPanel1.add(proxyCheckBox, gridBagConstraints);
176         proxyCheckBox.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomizerJVM.class, "ACCSName_HttpProxy", new Object JavaDoc[] {}));
177         proxyCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomizerJVM.class, "ACCSDesc_HttpProxy", new Object JavaDoc[] {}));
178
179         add(jPanel1, java.awt.BorderLayout.CENTER);
180
181     }// </editor-fold>//GEN-END:initComponents
182

183     private void jvmButtonActionPerformed(java.awt.event.ActionEvent JavaDoc evt) {//GEN-FIRST:event_jvmButtonActionPerformed
184
PlatformsCustomizer.showCustomizer(null);
185         custData.loadJvmModel();
186     }//GEN-LAST:event_jvmButtonActionPerformed
187

188     
189     // Variables declaration - do not modify//GEN-BEGIN:variables
190
private javax.swing.JCheckBox JavaDoc jCheckBox1;
191     private javax.swing.JLabel JavaDoc jLabel1;
192     private javax.swing.JLabel JavaDoc jLabel2;
193     private javax.swing.JLabel JavaDoc jLabel3;
194     private javax.swing.JPanel JavaDoc jPanel1;
195     private javax.swing.JTextField JavaDoc jTextField1;
196     private javax.swing.JButton JavaDoc jvmButton;
197     private javax.swing.JComboBox JavaDoc jvmComboBox;
198     private javax.swing.JLabel JavaDoc jvmLabel;
199     private javax.swing.JCheckBox JavaDoc proxyCheckBox;
200     // End of variables declaration//GEN-END:variables
201

202 }
203
Popular Tags