KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > clientproject > ui > wizards > 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.j2ee.clientproject.ui.wizards;
21
22 import javax.swing.JPanel JavaDoc;
23 import org.openide.WizardDescriptor;
24 import org.openide.WizardValidationException;
25 import org.openide.util.NbBundle;
26
27 /** First panel in the NewProject wizard. Used for filling in
28  * name, and directory of the project.
29  *
30  * @author Petr Hrebejk
31  */

32 public class PanelConfigureProjectVisual extends JPanel JavaDoc {
33     
34     private PanelConfigureProject panel;
35     
36     private boolean ignoreProjectDirChanges;
37     
38     private boolean ignoreAntProjectNameChanges;
39     
40     private boolean noDir = true;
41     
42     private SettingsPanel projectLocationPanel;
43     
44     private PanelOptionsVisual optionsPanel;
45     
46     /** Creates new form PanelInitProject */
47     public PanelConfigureProjectVisual( PanelConfigureProject panel ) {
48         this.panel = panel;
49         initComponents();
50         setName(NbBundle.getMessage(PanelConfigureProjectVisual.class,"TXT_NameAndLoc")); // NOI18N
51
projectLocationPanel = new PanelProjectLocationVisual( panel );
52         putClientProperty("NewProjectWizard_Title", NbBundle.getMessage(PanelConfigureProjectVisual.class, "TXT_NewAppClient")); // NOI18N
53
jSeparator1.setVisible(true);
54         getAccessibleContext().setAccessibleName(NbBundle.getMessage(PanelConfigureProjectVisual.class, "TXT_NewAppClient")); // NOI18N
55
getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(PanelConfigureProjectVisual.class, "ACSD_NewAppClient")); // NOI18N
56
locationContainer.add( projectLocationPanel, java.awt.BorderLayout.CENTER );
57         optionsPanel = new PanelOptionsVisual( panel );
58         projectLocationPanel.addPropertyChangeListener(optionsPanel);
59         optionsContainer.add( optionsPanel, java.awt.BorderLayout.CENTER );
60     }
61     
62     boolean valid( WizardDescriptor wizardDescriptor ) {
63         wizardDescriptor.putProperty( "WizardPanel_errorMessage", "" ); //NOI18N
64
return projectLocationPanel.valid( wizardDescriptor ) && optionsPanel.valid(wizardDescriptor);
65     }
66     
67     void read(WizardDescriptor d) {
68         projectLocationPanel.read(d);
69         optionsPanel.read(d);
70     }
71     
72     void store( WizardDescriptor d ) {
73         projectLocationPanel.store( d );
74         optionsPanel.store( d );
75     }
76     
77     void validate(WizardDescriptor d) throws WizardValidationException {
78         projectLocationPanel.validate(d);
79     }
80     
81     
82     /** This method is called from within the constructor to
83      * initialize the form.
84      * WARNING: Do NOT modify this code. The content of this method is
85      * always regenerated by the Form Editor.
86      */

87     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
88
private void initComponents() {
89         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
90
91         locationContainer = new javax.swing.JPanel JavaDoc();
92         jSeparator1 = new javax.swing.JSeparator JavaDoc();
93         optionsContainer = new javax.swing.JPanel JavaDoc();
94
95         setLayout(new java.awt.GridBagLayout JavaDoc());
96
97         locationContainer.setLayout(new java.awt.BorderLayout JavaDoc());
98
99         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
100         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
101         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
102         gridBagConstraints.weightx = 1.0;
103         add(locationContainer, gridBagConstraints);
104         locationContainer.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getBundle(PanelConfigureProjectVisual.class).getString("ACSN_locationContainer"));
105         locationContainer.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(PanelConfigureProjectVisual.class).getString("ACSD_locationContainer"));
106
107         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
108         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
109         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
110         gridBagConstraints.weightx = 1.0;
111         gridBagConstraints.insets = new java.awt.Insets JavaDoc(12, 0, 12, 0);
112         add(jSeparator1, gridBagConstraints);
113
114         optionsContainer.setLayout(new java.awt.BorderLayout JavaDoc());
115
116         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
117         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
118         gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
119         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
120         gridBagConstraints.weightx = 1.0;
121         gridBagConstraints.weighty = 1.0;
122         add(optionsContainer, gridBagConstraints);
123         optionsContainer.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getBundle(PanelConfigureProjectVisual.class).getString("ACSN_optionsContainer"));
124         optionsContainer.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(PanelConfigureProjectVisual.class).getString("ACSD_optionsContainer"));
125
126     }// </editor-fold>//GEN-END:initComponents
127

128     /** Currently only handles the "Browse..." button
129      */

130     
131     // Variables declaration - do not modify//GEN-BEGIN:variables
132
private javax.swing.JSeparator JavaDoc jSeparator1;
133     private javax.swing.JPanel JavaDoc locationContainer;
134     private javax.swing.JPanel JavaDoc optionsContainer;
135     // End of variables declaration//GEN-END:variables
136

137     
138 }
139
Popular Tags