KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > java > examples > PanelConfigureProjectVisual


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.java.examples;
21
22 import javax.swing.JPanel JavaDoc;
23
24 import org.openide.WizardDescriptor;
25 import org.openide.util.HelpCtx;
26 import org.openide.util.NbBundle;
27
28 public class PanelConfigureProjectVisual extends JPanel JavaDoc implements HelpCtx.Provider {
29
30     private PanelConfigureProject panel;
31
32     private PanelProjectLocationVisual projectLocationPanel;
33     private PanelOptionsVisual optionsPanel;
34
35     /** Creates new form PanelInitProject */
36     public PanelConfigureProjectVisual(PanelConfigureProject panel) {
37         this.panel = panel;
38         initComponents();
39         this.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(PanelConfigureProjectVisual.class, "ACS_NWP1_NamePanel_A11YDesc")); // NOI18N
40

41         projectLocationPanel = new PanelProjectLocationVisual(panel);
42         locationContainer.add(projectLocationPanel, java.awt.BorderLayout.NORTH);
43
44         optionsPanel = new PanelOptionsVisual(panel);
45         optionsContainer.add(optionsPanel, java.awt.BorderLayout.NORTH);
46
47         // Provide a name in the title bar.
48
setName(NbBundle.getMessage(PanelConfigureProjectVisual.class, "LBL_NWP1_ProjectTitleName")); //NOI18N
49
putClientProperty ("NewProjectWizard_Title", NbBundle.getMessage(PanelConfigureProjectVisual.class, "TXT_NewJ2SEApp")); //NOI18N
50
}
51
52     boolean valid(WizardDescriptor wizardDescriptor) {
53         return projectLocationPanel.valid(wizardDescriptor) && optionsPanel.valid(wizardDescriptor);
54     }
55
56     void read (WizardDescriptor d) {
57         projectLocationPanel.read(d);
58         optionsPanel.read(d);
59     }
60
61     void store(WizardDescriptor d) {
62         projectLocationPanel.store(d);
63         optionsPanel.store(d);
64     }
65
66     /** This method is called from within the constructor to
67      * initialize the form.
68      * WARNING: Do NOT modify this code. The content of this method is
69      * always regenerated by the Form Editor.
70      */

71     private void initComponents() {//GEN-BEGIN:initComponents
72
java.awt.GridBagConstraints JavaDoc gridBagConstraints;
73
74         locationContainer = new javax.swing.JPanel JavaDoc();
75         jSeparator1 = new javax.swing.JSeparator JavaDoc();
76         optionsContainer = new javax.swing.JPanel JavaDoc();
77
78         setLayout(new java.awt.GridBagLayout JavaDoc());
79
80         setPreferredSize(new java.awt.Dimension JavaDoc(500, 340));
81         setRequestFocusEnabled(false);
82         locationContainer.setLayout(new java.awt.BorderLayout JavaDoc());
83
84         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
85         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
86         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
87         gridBagConstraints.weightx = 1.0;
88         add(locationContainer, gridBagConstraints);
89
90         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
91         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
92         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
93         gridBagConstraints.weightx = 1.0;
94         gridBagConstraints.insets = new java.awt.Insets JavaDoc(12, 0, 12, 0);
95         add(jSeparator1, gridBagConstraints);
96
97         optionsContainer.setLayout(new java.awt.BorderLayout JavaDoc());
98
99         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
100         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
101         gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
102         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
103         gridBagConstraints.weightx = 1.0;
104         gridBagConstraints.weighty = 1.0;
105         add(optionsContainer, gridBagConstraints);
106
107     }//GEN-END:initComponents
108

109     // Variables declaration - do not modify//GEN-BEGIN:variables
110
private javax.swing.JSeparator JavaDoc jSeparator1;
111     private javax.swing.JPanel JavaDoc locationContainer;
112     private javax.swing.JPanel JavaDoc optionsContainer;
113     // End of variables declaration//GEN-END:variables
114

115     /** Help context where to find more about the paste type action.
116      * @return the help context for this action
117      */

118     public HelpCtx getHelpCtx() {
119         return new HelpCtx(PanelConfigureProjectVisual.class);
120     }
121 }
122
Popular Tags