KickJava   Java API By Example, From Geeks To Geeks.

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

40         projectLocationPanel = new PanelProjectLocationVisual(panel);
41         locationContainer.add(projectLocationPanel, java.awt.BorderLayout.NORTH);
42
43         optionsPanel = new PanelOptionsVisual(panel);
44         java.awt.GridBagConstraints JavaDoc gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
45         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
46         gridBagConstraints.weightx = 1.0;
47         gridBagConstraints.weighty = 1.0;
48         optionsContainer.add(optionsPanel, gridBagConstraints);
49
50 ///
51
/* DocumentListener dl = new DocumentListener() {
52             public void changedUpdate(DocumentEvent e) {
53                 setContextPath(e);
54             }
55
56             public void insertUpdate(DocumentEvent e) {
57                 setContextPath(e);
58             }
59
60             public void removeUpdate(DocumentEvent e) {
61                 setContextPath(e);
62             }
63
64             private void setContextPath(DocumentEvent e) {
65                 if (!optionsPanel.isContextModified())
66                     optionsPanel.jTextFieldContextPath.setText("/" + projectLocationPanel.projectNameTextField.getText().trim().replace(' ', '_'));
67             }
68         };
69         projectLocationPanel.projectNameTextField.getDocument().addDocumentListener(dl);
70 */

71 ///
72

73
74         // Provide a name in the title bar.
75
setName(NbBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/wizards/Bundle").getString("LBL_NWP1_ProjectTitleName")); //NOI18N
76
putClientProperty ("NewProjectWizard_Title", NbBundle.getMessage(PanelConfigureProjectVisual.class, "TXT_NewWebApp")); //NOI18N
77
}
78
79     boolean valid(WizardDescriptor wizardDescriptor) {
80         return projectLocationPanel.valid(wizardDescriptor) && optionsPanel.valid(wizardDescriptor);
81     }
82
83     void read (WizardDescriptor d) {
84         projectLocationPanel.read(d);
85         optionsPanel.read(d);
86     }
87
88     void store(WizardDescriptor d) {
89         projectLocationPanel.store(d);
90         optionsPanel.store(d);
91     }
92
93     /** This method is called from within the constructor to
94      * initialize the form.
95      * WARNING: Do NOT modify this code. The content of this method is
96      * always regenerated by the Form Editor.
97      */

98     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
99
private void initComponents() {
100         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
101
102         locationContainer = new javax.swing.JPanel JavaDoc();
103         jSeparator1 = new javax.swing.JSeparator JavaDoc();
104         optionsContainer = new javax.swing.JPanel JavaDoc();
105
106         setLayout(new java.awt.GridBagLayout JavaDoc());
107
108         setRequestFocusEnabled(false);
109         locationContainer.setLayout(new java.awt.BorderLayout JavaDoc());
110
111         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
112         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
113         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
114         gridBagConstraints.weightx = 1.0;
115         add(locationContainer, gridBagConstraints);
116
117         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
118         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
119         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
120         gridBagConstraints.weightx = 1.0;
121         gridBagConstraints.insets = new java.awt.Insets JavaDoc(12, 0, 12, 0);
122         add(jSeparator1, gridBagConstraints);
123
124         optionsContainer.setLayout(new java.awt.GridBagLayout JavaDoc());
125
126         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
127         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
128         gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
129         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
130         gridBagConstraints.weightx = 1.0;
131         gridBagConstraints.weighty = 1.0;
132         add(optionsContainer, gridBagConstraints);
133
134     }// </editor-fold>//GEN-END:initComponents
135

136     // Variables declaration - do not modify//GEN-BEGIN:variables
137
private javax.swing.JSeparator JavaDoc jSeparator1;
138     private javax.swing.JPanel JavaDoc locationContainer;
139     private javax.swing.JPanel JavaDoc optionsContainer;
140     // End of variables declaration//GEN-END:variables
141

142 }
143
Popular Tags