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.web.wizards;
043:
044: import org.openide.util.NbBundle;
045:
046: /** A single panel for a wizard - the GUI portion.
047: *
048: * @author mk115033
049: */
050: public class WrapperPanel extends javax.swing.JPanel {
051:
052: /** The wizard panel descriptor associated with this GUI panel.
053: * If you need to fire state changes or something similar, you can
054: * use this handle to do so.
055: */
056: private WrapperSelection wizardPanel;
057:
058: /** Create the wizard panel and set up some basic properties. */
059: public WrapperPanel(WrapperSelection wizardPanel) {
060: this .wizardPanel = wizardPanel;
061: initComponents();
062: // Provide a name in the title bar.
063: setName(NbBundle.getMessage(WrapperPanel.class,
064: "TITLE_wrapperPanel"));
065: /*
066: // Optional: provide a special description for this pane.
067: // You must have turned on WizardDescriptor.WizardPanel_helpDisplayed
068: // (see descriptor in standard iterator template for an example of this).
069: try {
070: putClientProperty ("WizardPanel_helpURL", // NOI18N
071: new URL ("nbresloc:/org/netbeans/modules/web/wizards/WrapperPanelHelp.html")); // NOI18N
072: } catch (MalformedURLException mfue) {
073: throw new IllegalStateException (mfue.toString ());
074: }
075: */
076: // a11y part
077: getAccessibleContext().setAccessibleDescription(
078: NbBundle.getMessage(WrapperPanel.class,
079: "A11Y_DESC_wrapperPanel"));
080: jCheckBox1.getAccessibleContext().setAccessibleName(
081: jCheckBox1.getText());
082: jCheckBox1.getAccessibleContext().setAccessibleDescription(
083: NbBundle.getMessage(WrapperPanel.class,
084: "A11Y_DESC_wrapperPanel"));
085: }
086:
087: /** This method is called from within the constructor to
088: * initialize the form.
089: * WARNING: Do NOT modify this code. The content of this method is
090: * always regenerated by the Form Editor.
091: */
092: // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
093: private void initComponents() {
094: java.awt.GridBagConstraints gridBagConstraints;
095:
096: jCheckBox1 = new javax.swing.JCheckBox();
097: jPanel1 = new javax.swing.JPanel();
098:
099: setLayout(new java.awt.GridBagLayout());
100:
101: setRequestFocusEnabled(false);
102: jCheckBox1
103: .setMnemonic(org.openide.util.NbBundle.getMessage(
104: WrapperPanel.class, "LBL_WebModule_Mnemonic")
105: .charAt(0));
106: jCheckBox1.setText(org.openide.util.NbBundle.getMessage(
107: WrapperPanel.class, "OPT_FilterWrapper"));
108: gridBagConstraints = new java.awt.GridBagConstraints();
109: gridBagConstraints.gridx = 0;
110: gridBagConstraints.gridy = 0;
111: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
112: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
113: gridBagConstraints.weightx = 1.0;
114: gridBagConstraints.insets = new java.awt.Insets(40, 10, 10, 0);
115: add(jCheckBox1, gridBagConstraints);
116:
117: gridBagConstraints = new java.awt.GridBagConstraints();
118: gridBagConstraints.gridx = 0;
119: gridBagConstraints.gridy = 1;
120: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
121: gridBagConstraints.weighty = 1.0;
122: add(jPanel1, gridBagConstraints);
123:
124: }// </editor-fold>//GEN-END:initComponents
125:
126: // Variables declaration - do not modify//GEN-BEGIN:variables
127: private javax.swing.JCheckBox jCheckBox1;
128: private javax.swing.JPanel jPanel1;
129:
130: // End of variables declaration//GEN-END:variables
131:
132: boolean isWrapper() {
133: return jCheckBox1.isSelected();
134: }
135:
136: }
|