001: /*
002: * The contents of this file are subject to the terms of the Common Development
003: * and Distribution License (the License). You may not use this file except in
004: * compliance with the License.
005: *
006: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
007: * or http://www.netbeans.org/cddl.txt.
008: *
009: * When distributing Covered Code, include this CDDL Header Notice in each file
010: * and include the License file at http://www.netbeans.org/cddl.txt.
011: * If applicable, add the following below the CDDL Header, with the fields
012: * enclosed by brackets [] replaced by your own identifying information:
013: * "Portions Copyrighted [year] [name of copyright owner]"
014: *
015: * The Original Software is NetBeans. The Initial Developer of the Original
016: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
017: * Microsystems, Inc. All Rights Reserved.
018: */
019:
020: package org.netbeans.modules.sql.project.ui.wizards;
021:
022: import javax.swing.JPanel;
023:
024: import org.openide.WizardDescriptor;
025: import org.openide.util.NbBundle;
026:
027: public class PanelConfigureProjectVisual extends JPanel implements
028: org.netbeans.modules.sql.project.SQLproConstants {
029:
030: private PanelConfigureProject panel;
031:
032: private PanelProjectLocationVisual projectLocationPanel;
033: private PanelOptionsVisual optionsPanel;
034:
035: /** Creates new form PanelInitProject */
036: public PanelConfigureProjectVisual(PanelConfigureProject panel) {
037: this .panel = panel;
038: initComponents();
039: this .getAccessibleContext().setAccessibleDescription(
040: NbBundle.getBundle(WIZARD_BUNDLE).getString(
041: "ACS_NWP1_NamePanel_A11YDesc")); // NOI18N
042:
043: projectLocationPanel = new PanelProjectLocationVisual(panel);
044: locationContainer.add(projectLocationPanel,
045: java.awt.BorderLayout.NORTH);
046:
047: optionsPanel = new PanelOptionsVisual(panel);
048: optionsContainer.add(optionsPanel, java.awt.BorderLayout.NORTH);
049:
050: ///
051: /* DocumentListener dl = new DocumentListener() {
052: public void changedUpdate(DocumentEvent e) {
053: setContextPath(e);
054: }
055:
056: public void insertUpdate(DocumentEvent e) {
057: setContextPath(e);
058: }
059:
060: public void removeUpdate(DocumentEvent e) {
061: setContextPath(e);
062: }
063:
064: private void setContextPath(DocumentEvent e) {
065: if (!optionsPanel.isContextModified())
066: optionsPanel.jTextFieldContextPath.setText("/" + projectLocationPanel.projectNameTextField.getText().trim().replace(' ', '_'));
067: }
068: };
069: projectLocationPanel.projectNameTextField.getDocument().addDocumentListener(dl);
070: */
071: ///
072: projectLocationPanel.addPropertyChangeListener(optionsPanel);
073:
074: // Provide a name in the title bar.
075: setName(NbBundle.getBundle(WIZARD_BUNDLE).getString(
076: "LBL_NWP1_ProjectTitleName")); //NOI18N
077: putClientProperty("NewProjectWizard_Title", NbBundle.getBundle(
078: WIZARD_BUNDLE).getString("TXT_NewWebApp")); //NOI18N
079: }
080:
081: boolean valid(WizardDescriptor wizardDescriptor) {
082: return projectLocationPanel.valid(wizardDescriptor)
083: && optionsPanel.valid(wizardDescriptor);
084: }
085:
086: void read(WizardDescriptor d) {
087: projectLocationPanel.read(d);
088: optionsPanel.read(d);
089: }
090:
091: void store(WizardDescriptor d) {
092: projectLocationPanel.store(d);
093: optionsPanel.store(d);
094: }
095:
096: /** This method is called from within the constructor to
097: * initialize the form.
098: * WARNING: Do NOT modify this code. The content of this method is
099: * always regenerated by the Form Editor.
100: */
101: // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
102: private void initComponents() {
103: java.awt.GridBagConstraints gridBagConstraints;
104:
105: locationContainer = new javax.swing.JPanel();
106: jSeparator1 = new javax.swing.JSeparator();
107: optionsContainer = new javax.swing.JPanel();
108:
109: setLayout(new java.awt.GridBagLayout());
110:
111: setRequestFocusEnabled(false);
112: locationContainer.setLayout(new java.awt.BorderLayout());
113:
114: gridBagConstraints = new java.awt.GridBagConstraints();
115: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
116: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
117: gridBagConstraints.weightx = 1.0;
118: add(locationContainer, gridBagConstraints);
119:
120: gridBagConstraints = new java.awt.GridBagConstraints();
121: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
122: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
123: gridBagConstraints.weightx = 1.0;
124: gridBagConstraints.insets = new java.awt.Insets(12, 0, 12, 0);
125: add(jSeparator1, gridBagConstraints);
126:
127: optionsContainer.setLayout(new java.awt.BorderLayout());
128:
129: gridBagConstraints = new java.awt.GridBagConstraints();
130: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
131: gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
132: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
133: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
134: gridBagConstraints.weightx = 1.0;
135: gridBagConstraints.weighty = 1.0;
136: add(optionsContainer, gridBagConstraints);
137:
138: }// </editor-fold>//GEN-END:initComponents
139:
140: // Variables declaration - do not modify//GEN-BEGIN:variables
141: private javax.swing.JSeparator jSeparator1;
142: private javax.swing.JPanel locationContainer;
143: private javax.swing.JPanel optionsContainer;
144: // End of variables declaration//GEN-END:variables
145:
146: }
|