001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.modules.tomcat5.customizer;
043:
044: import org.netbeans.api.java.platform.PlatformsCustomizer;
045:
046: /**
047: * Customizer JVM (Platform) tab.
048: *
049: * @author sherold
050: */
051: public class CustomizerJVM extends javax.swing.JPanel {
052:
053: private CustomizerDataSupport custData;
054:
055: /** Creates new form CustomizerJVM */
056: public CustomizerJVM(CustomizerDataSupport custData) {
057: this .custData = custData;
058: initComponents();
059:
060: /*
061: * mnemonics generated in the guarded block do not work
062: * because of change of the model after mnemonic setting
063: * remove the workaround after completion of issue 111094
064: */
065: org.openide.awt.Mnemonics.setLocalizedText(jCheckBox1,
066: org.openide.util.NbBundle.getMessage(
067: CustomizerJVM.class, "TXT_SecurityMan")); // NOI18N
068: org.openide.awt.Mnemonics.setLocalizedText(proxyCheckBox,
069: org.openide.util.NbBundle.getMessage(
070: CustomizerJVM.class, "LBL_HttpProxy",
071: new Object[] {})); // NOI18N
072: }
073:
074: /** This method is called from within the constructor to
075: * initialize the form.
076: * WARNING: Do NOT modify this code. The content of this method is
077: * always regenerated by the Form Editor.
078: */
079: // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
080: private void initComponents() {
081: java.awt.GridBagConstraints gridBagConstraints;
082:
083: jPanel1 = new javax.swing.JPanel();
084: jvmLabel = new javax.swing.JLabel();
085: jvmButton = new javax.swing.JButton();
086: jvmComboBox = new javax.swing.JComboBox();
087: jCheckBox1 = new javax.swing.JCheckBox();
088: jLabel1 = new javax.swing.JLabel();
089: jTextField1 = new javax.swing.JTextField();
090: jLabel2 = new javax.swing.JLabel();
091: jLabel3 = new javax.swing.JLabel();
092: proxyCheckBox = new javax.swing.JCheckBox();
093:
094: setLayout(new java.awt.BorderLayout());
095:
096: jPanel1.setLayout(new java.awt.GridBagLayout());
097:
098: jvmLabel.setLabelFor(jvmComboBox);
099: org.openide.awt.Mnemonics.setLocalizedText(jvmLabel,
100: org.openide.util.NbBundle.getMessage(
101: CustomizerJVM.class, "TXT_JVM")); // NOI18N
102: gridBagConstraints = new java.awt.GridBagConstraints();
103: gridBagConstraints.gridx = 0;
104: gridBagConstraints.gridy = 0;
105: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
106: gridBagConstraints.insets = new java.awt.Insets(12, 12, 0, 0);
107: jPanel1.add(jvmLabel, gridBagConstraints);
108: jvmLabel.getAccessibleContext().setAccessibleName(
109: org.openide.util.NbBundle.getMessage(
110: CustomizerJVM.class, "ASCN_JVM")); // NOI18N
111: jvmLabel.getAccessibleContext().setAccessibleDescription(
112: org.openide.util.NbBundle.getMessage(
113: CustomizerJVM.class, "ASCD_JavaPlatform")); // NOI18N
114:
115: org.openide.awt.Mnemonics.setLocalizedText(jvmButton,
116: org.openide.util.NbBundle.getMessage(
117: CustomizerJVM.class, "TXT_ManagePlatforms")); // NOI18N
118: jvmButton
119: .addActionListener(new java.awt.event.ActionListener() {
120: public void actionPerformed(
121: java.awt.event.ActionEvent evt) {
122: jvmButtonActionPerformed(evt);
123: }
124: });
125: gridBagConstraints = new java.awt.GridBagConstraints();
126: gridBagConstraints.gridx = 2;
127: gridBagConstraints.gridy = 0;
128: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
129: gridBagConstraints.insets = new java.awt.Insets(12, 5, 0, 12);
130: jPanel1.add(jvmButton, gridBagConstraints);
131: jvmButton.getAccessibleContext().setAccessibleName(
132: org.openide.util.NbBundle.getMessage(
133: CustomizerJVM.class, "ASCN_ManagerPlatform")); // NOI18N
134: jvmButton.getAccessibleContext().setAccessibleDescription(
135: org.openide.util.NbBundle.getMessage(
136: CustomizerJVM.class, "ASCD_JavaPlatform")); // NOI18N
137:
138: jvmComboBox.setModel(custData.getJvmModel());
139: gridBagConstraints = new java.awt.GridBagConstraints();
140: gridBagConstraints.gridx = 1;
141: gridBagConstraints.gridy = 0;
142: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
143: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
144: gridBagConstraints.weightx = 1.0;
145: gridBagConstraints.insets = new java.awt.Insets(12, 5, 0, 0);
146: jPanel1.add(jvmComboBox, gridBagConstraints);
147:
148: org.openide.awt.Mnemonics.setLocalizedText(jCheckBox1,
149: org.openide.util.NbBundle.getMessage(
150: CustomizerJVM.class, "TXT_SecurityMan")); // NOI18N
151: jCheckBox1.setIconTextGap(5);
152: jCheckBox1.setModel(custData.getSecManagerModel());
153: gridBagConstraints = new java.awt.GridBagConstraints();
154: gridBagConstraints.gridx = 0;
155: gridBagConstraints.gridy = 4;
156: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
157: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
158: gridBagConstraints.weightx = 1.0;
159: gridBagConstraints.weighty = 1.0;
160: gridBagConstraints.insets = new java.awt.Insets(5, 8, 0, 0);
161: jPanel1.add(jCheckBox1, gridBagConstraints);
162: jCheckBox1.getAccessibleContext().setAccessibleName(
163: org.openide.util.NbBundle.getMessage(
164: CustomizerJVM.class, "ASCN_SecManager")); // NOI18N
165: jCheckBox1.getAccessibleContext().setAccessibleDescription(
166: org.openide.util.NbBundle.getMessage(
167: CustomizerJVM.class, "ASCD_SecManager")); // NOI18N
168:
169: jLabel1.setLabelFor(jTextField1);
170: org.openide.awt.Mnemonics.setLocalizedText(jLabel1,
171: org.openide.util.NbBundle.getMessage(
172: CustomizerJVM.class, "TXT_VMOptions")); // NOI18N
173: gridBagConstraints = new java.awt.GridBagConstraints();
174: gridBagConstraints.gridx = 0;
175: gridBagConstraints.gridy = 1;
176: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
177: gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 0);
178: jPanel1.add(jLabel1, gridBagConstraints);
179: jLabel1.getAccessibleContext().setAccessibleName(
180: org.openide.util.NbBundle.getMessage(
181: CustomizerJVM.class, "ASCN_VMOpts")); // NOI18N
182: jLabel1.getAccessibleContext().setAccessibleDescription(
183: org.openide.util.NbBundle.getMessage(
184: CustomizerJVM.class, "ASCD_VMOpts")); // NOI18N
185:
186: jTextField1.setColumns(30);
187: jTextField1.setDocument(custData.getJavaOptsModel());
188: gridBagConstraints = new java.awt.GridBagConstraints();
189: gridBagConstraints.gridx = 1;
190: gridBagConstraints.gridy = 1;
191: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
192: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
193: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
194: gridBagConstraints.insets = new java.awt.Insets(5, 5, 0, 12);
195: jPanel1.add(jTextField1, gridBagConstraints);
196:
197: org.openide.awt.Mnemonics.setLocalizedText(jLabel2,
198: org.openide.util.NbBundle.getMessage(
199: CustomizerJVM.class, "TXT_VMOptionsEG")); // NOI18N
200: gridBagConstraints = new java.awt.GridBagConstraints();
201: gridBagConstraints.gridx = 1;
202: gridBagConstraints.gridy = 2;
203: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
204: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
205: gridBagConstraints.insets = new java.awt.Insets(5, 5, 0, 0);
206: jPanel1.add(jLabel2, gridBagConstraints);
207: jLabel2.getAccessibleContext().setAccessibleName(
208: org.openide.util.NbBundle.getMessage(
209: CustomizerJVM.class, "ASCN_VMOptEG")); // NOI18N
210: jLabel2.getAccessibleContext().setAccessibleDescription(
211: org.openide.util.NbBundle.getMessage(
212: CustomizerJVM.class, "ASCD_VmOptsEG")); // NOI18N
213:
214: org.openide.awt.Mnemonics.setLocalizedText(jLabel3,
215: org.openide.util.NbBundle.getMessage(
216: CustomizerJVM.class,
217: "TXT_NoteChangesTakeAffect")); // NOI18N
218: gridBagConstraints = new java.awt.GridBagConstraints();
219: gridBagConstraints.gridx = 0;
220: gridBagConstraints.gridy = 5;
221: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
222: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
223: gridBagConstraints.insets = new java.awt.Insets(5, 12, 12, 0);
224: jPanel1.add(jLabel3, gridBagConstraints);
225: jLabel3.getAccessibleContext().setAccessibleName(
226: org.openide.util.NbBundle.getMessage(
227: CustomizerJVM.class, "ASCN_Note")); // NOI18N
228: jLabel3.getAccessibleContext().setAccessibleDescription(
229: org.openide.util.NbBundle.getMessage(
230: CustomizerJVM.class, "ASCD_Note")); // NOI18N
231:
232: org.openide.awt.Mnemonics.setLocalizedText(proxyCheckBox,
233: org.openide.util.NbBundle.getMessage(
234: CustomizerJVM.class, "LBL_HttpProxy",
235: new Object[] {})); // NOI18N
236: proxyCheckBox.setBorder(javax.swing.BorderFactory
237: .createEmptyBorder(0, 0, 0, 0));
238: proxyCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
239: proxyCheckBox.setModel(custData.getProxyModel());
240: gridBagConstraints = new java.awt.GridBagConstraints();
241: gridBagConstraints.gridx = 0;
242: gridBagConstraints.gridy = 3;
243: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
244: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
245: gridBagConstraints.weightx = 1.0;
246: gridBagConstraints.insets = new java.awt.Insets(11, 12, 0, 0);
247: jPanel1.add(proxyCheckBox, gridBagConstraints);
248: proxyCheckBox.getAccessibleContext().setAccessibleName(
249: org.openide.util.NbBundle.getMessage(
250: CustomizerJVM.class, "ACCSName_HttpProxy",
251: new Object[] {})); // NOI18N
252: proxyCheckBox.getAccessibleContext().setAccessibleDescription(
253: org.openide.util.NbBundle.getMessage(
254: CustomizerJVM.class, "ACCSDesc_HttpProxy",
255: new Object[] {})); // NOI18N
256:
257: add(jPanel1, java.awt.BorderLayout.CENTER);
258: }// </editor-fold>//GEN-END:initComponents
259:
260: private void jvmButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jvmButtonActionPerformed
261: PlatformsCustomizer.showCustomizer(null);
262: custData.loadJvmModel();
263: }//GEN-LAST:event_jvmButtonActionPerformed
264:
265: // Variables declaration - do not modify//GEN-BEGIN:variables
266: private javax.swing.JCheckBox jCheckBox1;
267: private javax.swing.JLabel jLabel1;
268: private javax.swing.JLabel jLabel2;
269: private javax.swing.JLabel jLabel3;
270: private javax.swing.JPanel jPanel1;
271: private javax.swing.JTextField jTextField1;
272: private javax.swing.JButton jvmButton;
273: private javax.swing.JComboBox jvmComboBox;
274: private javax.swing.JLabel jvmLabel;
275: private javax.swing.JCheckBox proxyCheckBox;
276: // End of variables declaration//GEN-END:variables
277:
278: }
|