This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 142283
Collapse All | Expand All

(-)a/apisupport.project/nbproject/project.xml (+2 lines)
Lines 447-453 Link Here
447
            <friend-packages>
447
            <friend-packages>
448
                <friend>org.codehaus.mevenide.netbeans.apisupport</friend>
448
                <friend>org.codehaus.mevenide.netbeans.apisupport</friend>
449
                <friend>org.netbeans.modules.maven.apisupport</friend>
449
                <friend>org.netbeans.modules.maven.apisupport</friend>
450
                <friend>org.netbeans.modules.vmd.componentssupport</friend>
450
                <package>org.netbeans.modules.apisupport.project.spi</package>
451
                <package>org.netbeans.modules.apisupport.project.spi</package>
452
                <package>org.netbeans.modules.apisupport.project.ui.wizard.spi</package>
451
            </friend-packages>
453
            </friend-packages>
452
        </data>
454
        </data>
453
    </configuration>
455
    </configuration>
(-)a/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/wizard/BasicInfoVisualPanel.form (-142 / +11 lines)
Lines 1-12 Link Here
1
<?xml version="1.0" encoding="UTF-8" ?>
1
<?xml version="1.0" encoding="UTF-8" ?>
2
2
3
<Form version="1.0" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
3
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <NonVisualComponents>
4
  <NonVisualComponents>
5
    <Component class="javax.swing.ButtonGroup" name="moduleTypeGroup">
5
    <Component class="javax.swing.ButtonGroup" name="moduleTypeGroup">
6
    </Component>
6
    </Component>
7
  </NonVisualComponents>
7
  </NonVisualComponents>
8
  <AuxValues>
8
  <AuxValues>
9
    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
9
    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
10
    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
10
    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
11
    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
11
    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
12
    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
12
    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
13
    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
Lines 191-337 Link Here
191
        </Constraint>
192
        </Constraint>
192
      </Constraints>
193
      </Constraints>
193
    </Component>
194
    </Component>
194
    <Container class="javax.swing.JPanel" name="typeChooserPanel">
195
      <Constraints>
196
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
197
          <GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
198
        </Constraint>
199
      </Constraints>
200
201
      <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
202
      <SubComponents>
203
        <Component class="javax.swing.JRadioButton" name="standAloneModule">
204
          <Properties>
205
            <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
206
              <ComponentRef name="moduleTypeGroup"/>
207
            </Property>
208
            <Property name="selected" type="boolean" value="true"/>
209
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
210
              <ResourceString bundle="org/netbeans/modules/apisupport/project/ui/wizard/Bundle.properties" key="CTL_StandaloneModule" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
211
            </Property>
212
          </Properties>
213
          <Events>
214
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="typeChanged"/>
215
          </Events>
216
          <Constraints>
217
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
218
              <GridBagConstraints gridX="0" gridY="0" gridWidth="3" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="6" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
219
            </Constraint>
220
          </Constraints>
221
        </Component>
222
        <Component class="javax.swing.JLabel" name="platform">
223
          <Properties>
224
            <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
225
              <ComponentRef name="platformValue"/>
226
            </Property>
227
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
228
              <ResourceString bundle="org/netbeans/modules/apisupport/project/ui/wizard/Bundle.properties" key="LBL_NetBeansPlatform" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
229
            </Property>
230
          </Properties>
231
          <Constraints>
232
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
233
              <GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="18" insetsBottom="0" insetsRight="12" anchor="17" weightX="0.0" weightY="0.0"/>
234
            </Constraint>
235
          </Constraints>
236
        </Component>
237
        <Component class="javax.swing.JComboBox" name="platformValue">
238
          <Events>
239
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="platformChosen"/>
240
          </Events>
241
          <AuxValues>
242
            <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="PlatformComponentFactory.getNbPlatformsComboxBox();"/>
243
          </AuxValues>
244
          <Constraints>
245
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
246
              <GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="12" anchor="17" weightX="1.0" weightY="0.0"/>
247
            </Constraint>
248
          </Constraints>
249
        </Component>
250
        <Component class="javax.swing.JButton" name="managePlatform">
251
          <Properties>
252
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
253
              <ResourceString bundle="org/netbeans/modules/apisupport/project/ui/wizard/Bundle.properties" key="CTL_ManagePlatforms_g" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
254
            </Property>
255
          </Properties>
256
          <Events>
257
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="managePlatformActionPerformed"/>
258
          </Events>
259
          <Constraints>
260
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
261
              <GridBagConstraints gridX="2" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
262
            </Constraint>
263
          </Constraints>
264
        </Component>
265
        <Component class="javax.swing.JRadioButton" name="suiteComponent">
266
          <Properties>
267
            <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
268
              <ComponentRef name="moduleTypeGroup"/>
269
            </Property>
270
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
271
              <ResourceString bundle="org/netbeans/modules/apisupport/project/ui/wizard/Bundle.properties" key="CTL_AddToModuleSuite" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
272
            </Property>
273
          </Properties>
274
          <Events>
275
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="typeChanged"/>
276
          </Events>
277
          <Constraints>
278
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
279
              <GridBagConstraints gridX="0" gridY="2" gridWidth="3" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="18" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
280
            </Constraint>
281
          </Constraints>
282
        </Component>
283
        <Component class="javax.swing.JLabel" name="moduleSuite">
284
          <Properties>
285
            <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
286
              <ComponentRef name="moduleSuiteValue"/>
287
            </Property>
288
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
289
              <ResourceString bundle="org/netbeans/modules/apisupport/project/ui/wizard/Bundle.properties" key="LBL_ModuleSuite" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
290
            </Property>
291
          </Properties>
292
          <Constraints>
293
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
294
              <GridBagConstraints gridX="0" gridY="3" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="6" insetsLeft="18" insetsBottom="0" insetsRight="12" anchor="17" weightX="0.0" weightY="0.0"/>
295
            </Constraint>
296
          </Constraints>
297
        </Component>
298
        <Component class="javax.swing.JComboBox" name="moduleSuiteValue">
299
          <Events>
300
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="moduleSuiteChosen"/>
301
          </Events>
302
          <AuxValues>
303
            <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="PlatformComponentFactory.getSuitesComboBox();"/>
304
          </AuxValues>
305
          <Constraints>
306
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
307
              <GridBagConstraints gridX="1" gridY="3" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="6" insetsLeft="0" insetsBottom="0" insetsRight="12" anchor="17" weightX="1.0" weightY="0.0"/>
308
            </Constraint>
309
          </Constraints>
310
        </Component>
311
        <Component class="javax.swing.JButton" name="browseSuiteButton">
312
          <Properties>
313
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
314
              <ResourceString bundle="org/netbeans/modules/apisupport/project/ui/wizard/Bundle.properties" key="CTL_BrowseButton_w" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
315
            </Property>
316
          </Properties>
317
          <Events>
318
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="browseModuleSuite"/>
319
          </Events>
320
          <Constraints>
321
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
322
              <GridBagConstraints gridX="2" gridY="3" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="6" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
323
            </Constraint>
324
          </Constraints>
325
        </Component>
326
        <Component class="javax.swing.JLabel" name="chooserFiller">
327
          <Constraints>
328
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
329
              <GridBagConstraints gridX="0" gridY="4" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="1.0"/>
330
            </Constraint>
331
          </Constraints>
332
        </Component>
333
      </SubComponents>
334
    </Container>
335
    <Container class="javax.swing.JPanel" name="pnlThouShaltBeholdLayout">
195
    <Container class="javax.swing.JPanel" name="pnlThouShaltBeholdLayout">
336
      <Constraints>
196
      <Constraints>
337
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
197
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
Lines 341-345 Link Here
341
201
342
      <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
202
      <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
343
    </Container>
203
    </Container>
204
    <Container class="javax.swing.JPanel" name="typeChooserPanelContainer">
205
      <Constraints>
206
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
207
          <GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
208
        </Constraint>
209
      </Constraints>
210
211
      <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
212
    </Container>
344
  </SubComponents>
213
  </SubComponents>
345
</Form>
214
</Form>
(-)a/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/wizard/BasicInfoVisualPanel.java (-373 / +142 lines)
Lines 43-59 Link Here
43
43
44
import java.awt.event.ActionEvent;
44
import java.awt.event.ActionEvent;
45
import java.awt.event.ActionListener;
45
import java.awt.event.ActionListener;
46
import java.beans.PropertyChangeEvent;
47
import java.beans.PropertyChangeListener;
46
import java.io.File;
48
import java.io.File;
47
import java.io.IOException;
48
import java.text.MessageFormat;
49
import java.text.MessageFormat;
49
import javax.swing.ButtonModel;
50
import javax.swing.JComboBox;
50
import javax.swing.JComboBox;
51
import javax.swing.JFileChooser;
51
import javax.swing.JFileChooser;
52
import javax.swing.event.DocumentEvent;
52
import javax.swing.event.DocumentEvent;
53
import javax.swing.event.DocumentListener;
53
import javax.swing.event.DocumentListener;
54
import org.netbeans.api.project.Project;
55
import org.netbeans.api.project.ProjectManager;
56
import org.netbeans.api.project.ProjectUtils;
57
import org.netbeans.modules.apisupport.project.ui.ModuleUISettings;
54
import org.netbeans.modules.apisupport.project.ui.ModuleUISettings;
58
import org.netbeans.modules.apisupport.project.universe.ModuleList;
55
import org.netbeans.modules.apisupport.project.universe.ModuleList;
59
import org.netbeans.modules.apisupport.project.universe.NbPlatform;
56
import org.netbeans.modules.apisupport.project.universe.NbPlatform;
Lines 61-70 Link Here
61
import org.netbeans.modules.apisupport.project.ui.customizer.SuiteUtils;
58
import org.netbeans.modules.apisupport.project.ui.customizer.SuiteUtils;
62
import org.netbeans.modules.apisupport.project.ui.platform.PlatformComponentFactory;
59
import org.netbeans.modules.apisupport.project.ui.platform.PlatformComponentFactory;
63
import org.netbeans.modules.apisupport.project.ui.platform.NbPlatformCustomizer;
60
import org.netbeans.modules.apisupport.project.ui.platform.NbPlatformCustomizer;
61
import org.netbeans.modules.apisupport.project.ui.wizard.spi.ModuleTypeChooserPanel;
64
import org.netbeans.spi.project.ui.support.ProjectChooser;
62
import org.netbeans.spi.project.ui.support.ProjectChooser;
65
import org.openide.DialogDescriptor;
66
import org.openide.DialogDisplayer;
67
import org.openide.ErrorManager;
68
import org.openide.filesystems.FileUtil;
63
import org.openide.filesystems.FileUtil;
69
import org.openide.util.NbBundle;
64
import org.openide.util.NbBundle;
70
65
Lines 83-95 Link Here
83
 *
78
 *
84
 * @author Martin Krauskopf
79
 * @author Martin Krauskopf
85
 */
80
 */
86
public class BasicInfoVisualPanel extends BasicVisualPanel.NewTemplatePanel {
81
public class BasicInfoVisualPanel extends BasicVisualPanel.NewTemplatePanel
82
        implements PropertyChangeListener
83
{
87
    
84
    
88
    private ButtonModel lastSelectedType;
89
    private static String lastSelectedSuite;
85
    private static String lastSelectedSuite;
90
    private boolean locationUpdated;
86
    private boolean locationUpdated;
91
    private boolean nameUpdated;
87
    private boolean nameUpdated;
92
    private boolean moduleTypeGroupAttached = true;
93
    private boolean mainProjectTouched;
88
    private boolean mainProjectTouched;
94
    
89
    
95
    /** Creates new form BasicInfoVisualPanel */
90
    /** Creates new form BasicInfoVisualPanel */
Lines 97-122 Link Here
97
        super(data);
92
        super(data);
98
        initComponents();
93
        initComponents();
99
        initAccessibility();
94
        initAccessibility();
100
        initPlatformCombos();
95
        initPlatformCombo(suitePlatformValue);
96
        initPanels();
101
        setComponentsVisibility();
97
        setComponentsVisibility();
102
        switch (data.getWizardType()) {
98
        switch (data.getWizardType()) {
103
            case SUITE:
99
            case SUITE:
104
            case APPLICATION:
100
            case APPLICATION:
105
                detachModuleTypeGroup();
101
            case LIBRARY_MODULE:
106
                break;
102
                break;
107
            case MODULE:
103
            case MODULE:
108
            case SUITE_COMPONENT:
104
            case SUITE_COMPONENT:
109
                if (moduleSuiteValue.getItemCount() > 0) {
105
                if (TypeChooserPanelImpl.getDefaultSuitesComboBox().getItemCount() > 0) {
110
                    restoreSelectedSuite();
111
                    suiteComponent.setSelected(true);
112
                    mainProject.setSelected(false);
106
                    mainProject.setSelected(false);
113
                }
114
                break;
115
            case LIBRARY_MODULE:
116
                moduleSuite.setText(getMessage("LBL_Add_to_Suite")); // NOI18N
117
                suiteComponent.setSelected(true);
118
                if (moduleSuiteValue.getItemCount() > 0) {
119
                    restoreSelectedSuite();
120
                }
107
                }
121
                break;
108
                break;
122
            default:
109
            default:
Lines 125-136 Link Here
125
        attachDocumentListeners();
112
        attachDocumentListeners();
126
        setInitialLocation();
113
        setInitialLocation();
127
        setInitialProjectName();
114
        setInitialProjectName();
128
        updateEnabled();
115
    }
116
    
117
    protected static boolean isNetBeansOrgFolder(File folder) {
118
        return ModuleList.findNetBeansOrg(folder) != null;
119
    }
120
    
121
    protected static void initPlatformCombo(JComboBox combo) {
122
        if (combo == null){
123
            return;
124
        }
125
        if (combo.getItemCount() <= 0) {
126
            return;
127
        }
128
        boolean set = false;
129
        String idToSelect = ModuleUISettings.getDefault().getLastUsedPlatformID();
130
        for (int i = 0; i < combo.getItemCount(); i++) {
131
            if (((NbPlatform) combo.getItemAt(i)).getID().equals(idToSelect)) {
132
                combo.setSelectedIndex(i);
133
                set = true;
134
                break;
135
            }
136
        }
137
        if (!set) {
138
            NbPlatform defPlaf = NbPlatform.getDefaultPlatform();
139
            combo.setSelectedItem(defPlaf == null ? combo.getItemAt(0) : defPlaf);
140
        }
141
    }
142
143
    public void propertyChange(PropertyChangeEvent evt) {
144
        String name = evt.getPropertyName();
145
        Object value = evt.getNewValue();
146
        
147
        if (ModuleTypeChooserPanel.IS_STANDALONE.equals(name)){
148
            standAloneModuletypeChanged(value);
149
        } else if (ModuleTypeChooserPanel.IS_SUITE_COMPONENT.equals(name)){
150
            suiteComponenttypeChanged(value);
151
        } else if (ModuleTypeChooserPanel.SUITE_ROOT.equals(name)){
152
            moduleSuiteValueChanged(value);
153
        }
154
        updateAndCheck();
155
    }
156
    
157
    private void moduleSuiteValueChanged(Object val) {
158
        String suite = null;
159
        if (val != null && val instanceof String){
160
            suite = (String)val;
161
        }
162
        if (!locationUpdated) {
163
            computeAndSetLocation(suite, true);
164
        }
165
        updateAndCheck();
166
    }
167
168
    private void suiteComponenttypeChanged(Object val) {
169
        Boolean isSuiteComp = false;
170
        if (val != null && val instanceof Boolean){
171
            isSuiteComp = ((Boolean)val).booleanValue();
172
        }
173
        
174
        if (!mainProjectTouched) {
175
            mainProject.setSelected(!isSuiteComp);
176
        }
177
        if (!locationUpdated) {
178
            setInitialLocation();
179
        }
180
        if (!nameUpdated) {
181
            setInitialProjectName();
182
        }
183
        updateAndCheck();
184
    }
185
186
    private void standAloneModuletypeChanged(Object val) {
187
        Boolean isStandAlone = false;
188
        if (val != null && val instanceof Boolean){
189
            isStandAlone = ((Boolean)val).booleanValue();
190
        }
191
        
192
        if (!mainProjectTouched) {
193
            mainProject.setSelected(isStandAlone);
194
        }
195
        if (!locationUpdated) {
196
            setInitialLocation();
197
        }
198
        if (!nameUpdated) {
199
            setInitialProjectName();
200
        }
201
        updateAndCheck();
129
    }
202
    }
130
    
203
    
131
    private void setInitialLocation() {
204
    private void setInitialLocation() {
132
        if (isSuiteComponent()) {
205
        if (typeChooserPanel.isSuiteComponent()) {
133
            computeAndSetLocation((String) moduleSuiteValue.getSelectedItem(), true);
206
            computeAndSetLocation(typeChooserPanel.getSelectedSuite(), true);
134
        } else { // suite or standalone module
207
        } else { // suite or standalone module
135
            String location = computeLocationValue(ProjectChooser.getProjectsFolder().getAbsolutePath());
208
            String location = computeLocationValue(ProjectChooser.getProjectsFolder().getAbsolutePath());
136
            File locationF = new File(location);
209
            File locationF = new File(location);
Lines 145-164 Link Here
145
    private void initAccessibility() {
218
    private void initAccessibility() {
146
        this.getAccessibleContext().setAccessibleDescription(getMessage("ACS_BasicInfoVisualPanel"));
219
        this.getAccessibleContext().setAccessibleDescription(getMessage("ACS_BasicInfoVisualPanel"));
147
        browseButton.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_BrowseButton"));
220
        browseButton.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_BrowseButton"));
148
        browseSuiteButton.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_BrowseSuiteButton"));
149
        folderValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_FolderValue"));
221
        folderValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_FolderValue"));
150
        locationValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_LocationValue"));
222
        locationValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_LocationValue"));
151
        mainProject.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_MainProject"));
223
        mainProject.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_MainProject"));
152
        managePlatform.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_ManagePlatform"));
153
        manageSuitePlatform.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_ManageSuitePlatform"));
224
        manageSuitePlatform.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_ManageSuitePlatform"));
154
        moduleSuiteValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_ModuleSuiteValue"));
155
        nameValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_NameValue"));
225
        nameValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_NameValue"));
156
        platformValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_PlatformValue"));
157
        standAloneModule.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_StandAloneModule"));
158
        suiteComponent.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_SuiteModule"));
159
        suitePlatformValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_SuitePlatformValue"));
226
        suitePlatformValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_SuitePlatformValue"));
160
    }
227
    }
161
    
228
    
229
    private void initPanels(){
230
        if (typeChooserPanel != null){
231
            typeChooserPanelContainer.removeAll();
232
            typeChooserPanel = null;
233
        }
234
        typeChooserPanel = new TypeChooserPanelImpl();
235
        typeChooserPanelContainer.add(typeChooserPanel);
236
        typeChooserPanelContainer.validate();
237
    }
238
162
    private void setComponentsVisibility() {
239
    private void setComponentsVisibility() {
163
        boolean isSuiteWizard = isSuiteWizard();
240
        boolean isSuiteWizard = isSuiteWizard();
164
        boolean isSuiteComponentWizard = isSuiteComponentWizard();
241
        boolean isSuiteComponentWizard = isSuiteComponentWizard();
Lines 170-213 Link Here
170
        manageSuitePlatform.setVisible(isSuiteWizard);
247
        manageSuitePlatform.setVisible(isSuiteWizard);
171
        mainProject.setVisible(!isLibraryWizard);
248
        mainProject.setVisible(!isLibraryWizard);
172
        
249
        
173
        suiteComponent.setVisible(!isLibraryWizard);
174
        platform.setVisible(!isLibraryWizard);
175
        platformValue.setVisible(!isLibraryWizard);
176
        managePlatform.setVisible(!isLibraryWizard);
177
        standAloneModule.setVisible(!isLibraryWizard);
178
        mainProject.setSelected(!isLibraryWizard);
250
        mainProject.setSelected(!isLibraryWizard);
179
        
251
        
180
        standAloneModule.setVisible(!isSuiteComponentWizard && !isLibraryWizard);
252
        if (typeChooserPanel != null){
181
        platform.setVisible(!isSuiteComponentWizard && !isLibraryWizard);
253
            typeChooserPanel.setComponentsVisibility(isSuiteComponentWizard, isLibraryWizard);
182
        platformValue.setVisible(!isSuiteComponentWizard && !isLibraryWizard);
183
        managePlatform.setVisible(!isSuiteComponentWizard && !isLibraryWizard);
184
        suiteComponent.setVisible(!isSuiteComponentWizard && !isLibraryWizard);
185
    }
186
    
187
    private void restoreSelectedSuite() {
188
        String preferredSuiteDir  = getPreferredSuiteDir();
189
        if (preferredSuiteDir != null) {
190
            lastSelectedSuite = preferredSuiteDir;
191
        }
254
        }
192
        if (lastSelectedSuite != null) {
193
            int max = moduleSuiteValue.getModel().getSize();
194
            for (int i=0; i < max; i++) {
195
                if (lastSelectedSuite.equals(moduleSuiteValue.getModel().getElementAt(i))) {
196
                    moduleSuiteValue.setSelectedItem(lastSelectedSuite);
197
                    break;
198
                }
199
            }
200
        }
201
    }
202
    
203
    private String getPreferredSuiteDir() {
204
        return (String) getSettings().getProperty(NewNbModuleWizardIterator.PREFERRED_SUITE_DIR);
205
    }
206
    
207
    private boolean isOneSuiteDedicatedMode() {
208
        Boolean b = (Boolean) getSettings().getProperty(
209
                NewNbModuleWizardIterator.ONE_SUITE_DEDICATED_MODE);
210
        return b != null ? b.booleanValue() : false;
211
    }
255
    }
212
    
256
    
213
    private String getNameValue() {
257
    private String getNameValue() {
Lines 222-242 Link Here
222
        return new File(getLocationValue());
266
        return new File(getLocationValue());
223
    }
267
    }
224
    
268
    
225
    private void updateEnabled() {
226
        boolean isNetBeansOrg = isNetBeansOrgFolder();
227
        standAloneModule.setEnabled(!isNetBeansOrg);
228
        suiteComponent.setEnabled(!isNetBeansOrg);
229
        
230
        boolean standalone = isStandAlone();
231
        boolean suiteModuleSelected = isSuiteComponent();
232
        platform.setEnabled(standalone);
233
        platformValue.setEnabled(standalone);
234
        managePlatform.setEnabled(standalone);
235
        moduleSuite.setEnabled(suiteModuleSelected);
236
        moduleSuiteValue.setEnabled(suiteModuleSelected && !isOneSuiteDedicatedMode());
237
        browseSuiteButton.setEnabled(suiteModuleSelected && !isOneSuiteDedicatedMode());
238
    }
239
    
240
    void updateAndCheck() {
269
    void updateAndCheck() {
241
        updateGUI();
270
        updateGUI();
242
        
271
        
Lines 246-256 Link Here
246
            setError(getMessage("MSG_LocationCannotBeEmpty"));
275
            setError(getMessage("MSG_LocationCannotBeEmpty"));
247
        } else if (isLibraryWizard() && isNetBeansOrgFolder()) {
276
        } else if (isLibraryWizard() && isNetBeansOrgFolder()) {
248
            setError(getMessage("MSG_LibraryWrapperForNBOrgUnsupported"));
277
            setError(getMessage("MSG_LibraryWrapperForNBOrgUnsupported"));
249
        } else if (isSuiteComponent() && moduleSuiteValue.getSelectedItem() == null) {
278
        } else if (!typeChooserPanel.validate(getSettings())) {
250
            setError(getMessage("MSG_ChooseRegularSuite"));
279
            markInvalid();
251
        } else if (isStandAlone() &&
252
                (platformValue.getSelectedItem() == null || !((NbPlatform) platformValue.getSelectedItem()).isValid())) {
253
            setError(getMessage("MSG_ChosenPlatformIsInvalid"));
254
        } else if (isSuiteWizard() &&
280
        } else if (isSuiteWizard() &&
255
                (suitePlatformValue.getSelectedItem() == null || !((NbPlatform) suitePlatformValue.getSelectedItem()).isValid())) {
281
                (suitePlatformValue.getSelectedItem() == null || !((NbPlatform) suitePlatformValue.getSelectedItem()).isValid())) {
256
            setError(getMessage("MSG_ChosenPlatformIsInvalid"));
282
            setError(getMessage("MSG_ChosenPlatformIsInvalid"));
Lines 268-304 Link Here
268
    private void updateGUI() {
294
    private void updateGUI() {
269
        // update project folder
295
        // update project folder
270
        folderValue.setText(getFolder().getPath());
296
        folderValue.setText(getFolder().getPath());
271
        
297
272
        if (isSuiteWizard() || isNetBeansOrgFolder()) {
298
        getSettings().putProperty(ModuleTypeChooserPanel.PROJECT_FOLDER, getFolder());
273
            detachModuleTypeGroup();
299
        typeChooserPanel.updateUI(getSettings());
274
        } else {
275
            attachModuleTypeGroup();
276
        }
277
        updateEnabled();
278
    }
279
    
280
    private void detachModuleTypeGroup() {
281
        if (moduleTypeGroupAttached) {
282
            lastSelectedType = moduleTypeGroup.getSelection();
283
            moduleTypeGroup.remove(standAloneModule);
284
            moduleTypeGroup.remove(suiteComponent);
285
            standAloneModule.setSelected(false);
286
            suiteComponent.setSelected(false);
287
            moduleTypeGroupAttached = false;
288
        }
289
    }
290
    
291
    private void attachModuleTypeGroup() {
292
        if (!moduleTypeGroupAttached) {
293
            moduleTypeGroup.add(standAloneModule);
294
            moduleTypeGroup.add(suiteComponent);
295
            if (isLibraryWizard()) {
296
                suiteComponent.setSelected(true);
297
            } else {
298
                moduleTypeGroup.setSelected(lastSelectedType, true);
299
            }
300
            moduleTypeGroupAttached = true;
301
        }
302
    }
300
    }
303
    
301
    
304
    /** Set <em>next</em> free project name. */
302
    /** Set <em>next</em> free project name. */
Lines 324-335 Link Here
324
        getData().setProjectFolder(folderValue.getText());
322
        getData().setProjectFolder(folderValue.getText());
325
        getData().setMainProject(mainProject.isSelected());
323
        getData().setMainProject(mainProject.isSelected());
326
        getData().setNetBeansOrg(isNetBeansOrgFolder());
324
        getData().setNetBeansOrg(isNetBeansOrgFolder());
327
        getData().setStandalone(isStandAlone());
325
        getData().setStandalone(typeChooserPanel.isStandAlone());
328
        getData().setSuiteRoot((String) moduleSuiteValue.getSelectedItem());
326
        getData().setSuiteRoot(typeChooserPanel.getSelectedSuite());
329
        if (isSuiteWizard() && suitePlatformValue.getSelectedItem() != null) {
327
        if (isSuiteWizard() && suitePlatformValue.getSelectedItem() != null) {
330
            getData().setPlatformID(((NbPlatform) suitePlatformValue.getSelectedItem()).getID());
328
            getData().setPlatformID(((NbPlatform) suitePlatformValue.getSelectedItem()).getID());
331
        } else if (platformValue.getSelectedItem() != null) {
329
        } else if (typeChooserPanel.getSelectedPlatform() != null) {
332
            getData().setPlatformID(((NbPlatform) platformValue.getSelectedItem()).getID());
330
            getData().setPlatformID(typeChooserPanel.getSelectedPlatform());
333
        }
331
        }
334
    }
332
    }
335
    
333
    
Lines 387-394 Link Here
387
                updateAndCheck();
385
                updateAndCheck();
388
            }
386
            }
389
        };
387
        };
390
        platformValue.addActionListener(plafAL);
391
        suitePlatformValue.addActionListener(plafAL);
388
        suitePlatformValue.addActionListener(plafAL);
389
        typeChooserPanel.addPropertyChangeListener(this);
392
    }
390
    }
393
    
391
    
394
    private File getFolder() {
392
    private File getFolder() {
Lines 401-434 Link Here
401
    }
399
    }
402
    
400
    
403
    private boolean isNetBeansOrgFolder() {
401
    private boolean isNetBeansOrgFolder() {
404
        return ModuleList.findNetBeansOrg(getFolder()) != null;
402
        return isNetBeansOrgFolder(getFolder());
405
    }
403
    }
406
    
404
    
407
    private static String getMessage(String key) {
405
    private static String getMessage(String key) {
408
        return NbBundle.getMessage(BasicInfoVisualPanel.class, key);
406
        return NbBundle.getMessage(BasicInfoVisualPanel.class, key);
409
    }
407
    }
410
    
408
    
411
    private void initPlatformCombos() {
409
412
        if (platformValue.getItemCount() <= 0) {
413
            return;
414
        }
415
        boolean set = false;
416
        String idToSelect = ModuleUISettings.getDefault().getLastUsedPlatformID();
417
        for (int i = 0; i < platformValue.getItemCount(); i++) {
418
            if (((NbPlatform) platformValue.getItemAt(i)).getID().equals(idToSelect)) {
419
                platformValue.setSelectedIndex(i);
420
                suitePlatformValue.setSelectedIndex(i);
421
                set = true;
422
                break;
423
            }
424
        }
425
        if (!set) {
426
            NbPlatform defPlaf = NbPlatform.getDefaultPlatform();
427
            platformValue.setSelectedItem(defPlaf == null ? platformValue.getItemAt(0) : defPlaf);
428
            suitePlatformValue.setSelectedItem(defPlaf == null ? suitePlatformValue.getItemAt(0) : defPlaf);
429
        }
430
    }
431
    
432
    private void setLocation(String location, boolean silently) {
410
    private void setLocation(String location, boolean silently) {
433
        boolean revert = silently && !locationUpdated;
411
        boolean revert = silently && !locationUpdated;
434
        locationValue.setText(location);
412
        locationValue.setText(location);
Lines 451-470 Link Here
451
        }
429
        }
452
    }
430
    }
453
    
431
    
454
    private boolean isStandAlone() {
455
        return standAloneModule.isSelected();
456
    }
457
    
458
    private boolean isSuiteComponent() {
459
        return suiteComponent.isSelected();
460
    }
461
    
462
    /** This method is called from within the constructor to
432
    /** This method is called from within the constructor to
463
     * initialize the form.
433
     * initialize the form.
464
     * WARNING: Do NOT modify this code. The content of this method is
434
     * WARNING: Do NOT modify this code. The content of this method is
465
     * always regenerated by the Form Editor.
435
     * always regenerated by the Form Editor.
466
     */
436
     */
467
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
437
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
468
    private void initComponents() {
438
    private void initComponents() {
469
        java.awt.GridBagConstraints gridBagConstraints;
439
        java.awt.GridBagConstraints gridBagConstraints;
470
440
Lines 483-506 Link Here
483
        manageSuitePlatform = new javax.swing.JButton();
453
        manageSuitePlatform = new javax.swing.JButton();
484
        separator3 = new javax.swing.JSeparator();
454
        separator3 = new javax.swing.JSeparator();
485
        mainProject = new javax.swing.JCheckBox();
455
        mainProject = new javax.swing.JCheckBox();
486
        typeChooserPanel = new javax.swing.JPanel();
487
        standAloneModule = new javax.swing.JRadioButton();
488
        platform = new javax.swing.JLabel();
489
        platformValue = PlatformComponentFactory.getNbPlatformsComboxBox();
490
        managePlatform = new javax.swing.JButton();
491
        suiteComponent = new javax.swing.JRadioButton();
492
        moduleSuite = new javax.swing.JLabel();
493
        moduleSuiteValue = PlatformComponentFactory.getSuitesComboBox();
494
        browseSuiteButton = new javax.swing.JButton();
495
        chooserFiller = new javax.swing.JLabel();
496
        pnlThouShaltBeholdLayout = new javax.swing.JPanel();
456
        pnlThouShaltBeholdLayout = new javax.swing.JPanel();
457
        typeChooserPanelContainer = new javax.swing.JPanel();
497
458
498
        setLayout(new java.awt.GridBagLayout());
459
        setLayout(new java.awt.GridBagLayout());
499
460
500
        infoPanel.setLayout(new java.awt.GridBagLayout());
461
        infoPanel.setLayout(new java.awt.GridBagLayout());
501
462
502
        nameLbl.setLabelFor(nameValue);
463
        nameLbl.setLabelFor(nameValue);
503
        org.openide.awt.Mnemonics.setLocalizedText(nameLbl, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_ProjectName"));
464
        org.openide.awt.Mnemonics.setLocalizedText(nameLbl, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_ProjectName")); // NOI18N
504
        gridBagConstraints = new java.awt.GridBagConstraints();
465
        gridBagConstraints = new java.awt.GridBagConstraints();
505
        gridBagConstraints.gridx = 0;
466
        gridBagConstraints.gridx = 0;
506
        gridBagConstraints.gridy = 0;
467
        gridBagConstraints.gridy = 0;
Lines 509-515 Link Here
509
        infoPanel.add(nameLbl, gridBagConstraints);
470
        infoPanel.add(nameLbl, gridBagConstraints);
510
471
511
        locationLbl.setLabelFor(locationValue);
472
        locationLbl.setLabelFor(locationValue);
512
        org.openide.awt.Mnemonics.setLocalizedText(locationLbl, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_ProjectLocation"));
473
        org.openide.awt.Mnemonics.setLocalizedText(locationLbl, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_ProjectLocation")); // NOI18N
513
        gridBagConstraints = new java.awt.GridBagConstraints();
474
        gridBagConstraints = new java.awt.GridBagConstraints();
514
        gridBagConstraints.gridx = 0;
475
        gridBagConstraints.gridx = 0;
515
        gridBagConstraints.gridy = 1;
476
        gridBagConstraints.gridy = 1;
Lines 518-524 Link Here
518
        infoPanel.add(locationLbl, gridBagConstraints);
479
        infoPanel.add(locationLbl, gridBagConstraints);
519
480
520
        folderLbl.setLabelFor(folderValue);
481
        folderLbl.setLabelFor(folderValue);
521
        org.openide.awt.Mnemonics.setLocalizedText(folderLbl, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_ProjectFolder"));
482
        org.openide.awt.Mnemonics.setLocalizedText(folderLbl, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_ProjectFolder")); // NOI18N
522
        gridBagConstraints = new java.awt.GridBagConstraints();
483
        gridBagConstraints = new java.awt.GridBagConstraints();
523
        gridBagConstraints.gridx = 0;
484
        gridBagConstraints.gridx = 0;
524
        gridBagConstraints.gridy = 2;
485
        gridBagConstraints.gridy = 2;
Lines 544-562 Link Here
544
        gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 0);
505
        gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 0);
545
        infoPanel.add(locationValue, gridBagConstraints);
506
        infoPanel.add(locationValue, gridBagConstraints);
546
507
547
        org.openide.awt.Mnemonics.setLocalizedText(browseButton, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "CTL_BrowseButton_o"));
508
        org.openide.awt.Mnemonics.setLocalizedText(browseButton, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "CTL_BrowseButton_o")); // NOI18N
548
        browseButton.addActionListener(new java.awt.event.ActionListener() {
509
        browseButton.addActionListener(new java.awt.event.ActionListener() {
549
            public void actionPerformed(java.awt.event.ActionEvent evt) {
510
            public void actionPerformed(java.awt.event.ActionEvent evt) {
550
                browseLocation(evt);
511
                browseLocation(evt);
551
            }
512
            }
552
        });
513
        });
553
554
        gridBagConstraints = new java.awt.GridBagConstraints();
514
        gridBagConstraints = new java.awt.GridBagConstraints();
555
        gridBagConstraints.gridx = 2;
515
        gridBagConstraints.gridx = 2;
556
        gridBagConstraints.gridy = 1;
516
        gridBagConstraints.gridy = 1;
557
        gridBagConstraints.insets = new java.awt.Insets(6, 12, 6, 0);
517
        gridBagConstraints.insets = new java.awt.Insets(6, 12, 6, 0);
558
        infoPanel.add(browseButton, gridBagConstraints);
518
        infoPanel.add(browseButton, gridBagConstraints);
559
560
        gridBagConstraints = new java.awt.GridBagConstraints();
519
        gridBagConstraints = new java.awt.GridBagConstraints();
561
        gridBagConstraints.gridx = 1;
520
        gridBagConstraints.gridx = 1;
562
        gridBagConstraints.gridy = 5;
521
        gridBagConstraints.gridy = 5;
Lines 572-585 Link Here
572
        infoPanel.add(folderValue, gridBagConstraints);
531
        infoPanel.add(folderValue, gridBagConstraints);
573
532
574
        suitePlatform.setLabelFor(suitePlatformValue);
533
        suitePlatform.setLabelFor(suitePlatformValue);
575
        org.openide.awt.Mnemonics.setLocalizedText(suitePlatform, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_NetBeansPlatform"));
534
        org.openide.awt.Mnemonics.setLocalizedText(suitePlatform, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_NetBeansPlatform")); // NOI18N
576
        gridBagConstraints = new java.awt.GridBagConstraints();
535
        gridBagConstraints = new java.awt.GridBagConstraints();
577
        gridBagConstraints.gridx = 0;
536
        gridBagConstraints.gridx = 0;
578
        gridBagConstraints.gridy = 4;
537
        gridBagConstraints.gridy = 4;
579
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
538
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
580
        gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 12);
539
        gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 12);
581
        infoPanel.add(suitePlatform, gridBagConstraints);
540
        infoPanel.add(suitePlatform, gridBagConstraints);
582
583
        gridBagConstraints = new java.awt.GridBagConstraints();
541
        gridBagConstraints = new java.awt.GridBagConstraints();
584
        gridBagConstraints.gridx = 1;
542
        gridBagConstraints.gridx = 1;
585
        gridBagConstraints.gridy = 4;
543
        gridBagConstraints.gridy = 4;
Lines 589-601 Link Here
589
        gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 0);
547
        gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 0);
590
        infoPanel.add(suitePlatformValue, gridBagConstraints);
548
        infoPanel.add(suitePlatformValue, gridBagConstraints);
591
549
592
        org.openide.awt.Mnemonics.setLocalizedText(manageSuitePlatform, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "CTL_ManagePlatforms_g"));
550
        org.openide.awt.Mnemonics.setLocalizedText(manageSuitePlatform, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "CTL_ManagePlatforms_g")); // NOI18N
593
        manageSuitePlatform.addActionListener(new java.awt.event.ActionListener() {
551
        manageSuitePlatform.addActionListener(new java.awt.event.ActionListener() {
594
            public void actionPerformed(java.awt.event.ActionEvent evt) {
552
            public void actionPerformed(java.awt.event.ActionEvent evt) {
595
                manageSuitePlatformActionPerformed(evt);
553
                manageSuitePlatformActionPerformed(evt);
596
            }
554
            }
597
        });
555
        });
598
599
        gridBagConstraints = new java.awt.GridBagConstraints();
556
        gridBagConstraints = new java.awt.GridBagConstraints();
600
        gridBagConstraints.gridx = 2;
557
        gridBagConstraints.gridx = 2;
601
        gridBagConstraints.gridy = 4;
558
        gridBagConstraints.gridy = 4;
Lines 603-609 Link Here
603
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
560
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
604
        gridBagConstraints.insets = new java.awt.Insets(6, 12, 6, 0);
561
        gridBagConstraints.insets = new java.awt.Insets(6, 12, 6, 0);
605
        infoPanel.add(manageSuitePlatform, gridBagConstraints);
562
        infoPanel.add(manageSuitePlatform, gridBagConstraints);
606
607
        gridBagConstraints = new java.awt.GridBagConstraints();
563
        gridBagConstraints = new java.awt.GridBagConstraints();
608
        gridBagConstraints.gridx = 0;
564
        gridBagConstraints.gridx = 0;
609
        gridBagConstraints.gridy = 3;
565
        gridBagConstraints.gridy = 3;
Lines 621-764 Link Here
621
        add(infoPanel, gridBagConstraints);
577
        add(infoPanel, gridBagConstraints);
622
578
623
        mainProject.setSelected(true);
579
        mainProject.setSelected(true);
624
        org.openide.awt.Mnemonics.setLocalizedText(mainProject, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "CTL_SetAsMainProject"));
580
        org.openide.awt.Mnemonics.setLocalizedText(mainProject, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "CTL_SetAsMainProject")); // NOI18N
625
        mainProject.addActionListener(new java.awt.event.ActionListener() {
581
        mainProject.addActionListener(new java.awt.event.ActionListener() {
626
            public void actionPerformed(java.awt.event.ActionEvent evt) {
582
            public void actionPerformed(java.awt.event.ActionEvent evt) {
627
                mainProjectActionPerformed(evt);
583
                mainProjectActionPerformed(evt);
628
            }
584
            }
629
        });
585
        });
630
631
        gridBagConstraints = new java.awt.GridBagConstraints();
586
        gridBagConstraints = new java.awt.GridBagConstraints();
632
        gridBagConstraints.gridx = 0;
587
        gridBagConstraints.gridx = 0;
633
        gridBagConstraints.gridy = 2;
588
        gridBagConstraints.gridy = 2;
634
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
589
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
635
        gridBagConstraints.insets = new java.awt.Insets(12, 0, 0, 0);
590
        gridBagConstraints.insets = new java.awt.Insets(12, 0, 0, 0);
636
        add(mainProject, gridBagConstraints);
591
        add(mainProject, gridBagConstraints);
637
638
        typeChooserPanel.setLayout(new java.awt.GridBagLayout());
639
640
        moduleTypeGroup.add(standAloneModule);
641
        standAloneModule.setSelected(true);
642
        org.openide.awt.Mnemonics.setLocalizedText(standAloneModule, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "CTL_StandaloneModule"));
643
        standAloneModule.addActionListener(new java.awt.event.ActionListener() {
644
            public void actionPerformed(java.awt.event.ActionEvent evt) {
645
                typeChanged(evt);
646
            }
647
        });
648
649
        gridBagConstraints = new java.awt.GridBagConstraints();
650
        gridBagConstraints.gridx = 0;
651
        gridBagConstraints.gridy = 0;
652
        gridBagConstraints.gridwidth = 3;
653
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
654
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 0);
655
        typeChooserPanel.add(standAloneModule, gridBagConstraints);
656
657
        platform.setLabelFor(platformValue);
658
        org.openide.awt.Mnemonics.setLocalizedText(platform, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_NetBeansPlatform"));
659
        gridBagConstraints = new java.awt.GridBagConstraints();
660
        gridBagConstraints.gridx = 0;
661
        gridBagConstraints.gridy = 1;
662
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
663
        gridBagConstraints.insets = new java.awt.Insets(0, 18, 0, 12);
664
        typeChooserPanel.add(platform, gridBagConstraints);
665
666
        platformValue.addActionListener(new java.awt.event.ActionListener() {
667
            public void actionPerformed(java.awt.event.ActionEvent evt) {
668
                platformChosen(evt);
669
            }
670
        });
671
672
        gridBagConstraints = new java.awt.GridBagConstraints();
673
        gridBagConstraints.gridx = 1;
674
        gridBagConstraints.gridy = 1;
675
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
676
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
677
        gridBagConstraints.weightx = 1.0;
678
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 12);
679
        typeChooserPanel.add(platformValue, gridBagConstraints);
680
681
        org.openide.awt.Mnemonics.setLocalizedText(managePlatform, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "CTL_ManagePlatforms_g"));
682
        managePlatform.addActionListener(new java.awt.event.ActionListener() {
683
            public void actionPerformed(java.awt.event.ActionEvent evt) {
684
                managePlatformActionPerformed(evt);
685
            }
686
        });
687
688
        gridBagConstraints = new java.awt.GridBagConstraints();
689
        gridBagConstraints.gridx = 2;
690
        gridBagConstraints.gridy = 1;
691
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
692
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
693
        typeChooserPanel.add(managePlatform, gridBagConstraints);
694
695
        moduleTypeGroup.add(suiteComponent);
696
        org.openide.awt.Mnemonics.setLocalizedText(suiteComponent, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "CTL_AddToModuleSuite"));
697
        suiteComponent.addActionListener(new java.awt.event.ActionListener() {
698
            public void actionPerformed(java.awt.event.ActionEvent evt) {
699
                typeChanged(evt);
700
            }
701
        });
702
703
        gridBagConstraints = new java.awt.GridBagConstraints();
704
        gridBagConstraints.gridx = 0;
705
        gridBagConstraints.gridy = 2;
706
        gridBagConstraints.gridwidth = 3;
707
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
708
        gridBagConstraints.insets = new java.awt.Insets(18, 0, 0, 0);
709
        typeChooserPanel.add(suiteComponent, gridBagConstraints);
710
711
        moduleSuite.setLabelFor(moduleSuiteValue);
712
        org.openide.awt.Mnemonics.setLocalizedText(moduleSuite, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_ModuleSuite"));
713
        gridBagConstraints = new java.awt.GridBagConstraints();
714
        gridBagConstraints.gridx = 0;
715
        gridBagConstraints.gridy = 3;
716
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
717
        gridBagConstraints.insets = new java.awt.Insets(6, 18, 0, 12);
718
        typeChooserPanel.add(moduleSuite, gridBagConstraints);
719
720
        moduleSuiteValue.addActionListener(new java.awt.event.ActionListener() {
721
            public void actionPerformed(java.awt.event.ActionEvent evt) {
722
                moduleSuiteChosen(evt);
723
            }
724
        });
725
726
        gridBagConstraints = new java.awt.GridBagConstraints();
727
        gridBagConstraints.gridx = 1;
728
        gridBagConstraints.gridy = 3;
729
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
730
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
731
        gridBagConstraints.weightx = 1.0;
732
        gridBagConstraints.insets = new java.awt.Insets(6, 0, 0, 12);
733
        typeChooserPanel.add(moduleSuiteValue, gridBagConstraints);
734
735
        org.openide.awt.Mnemonics.setLocalizedText(browseSuiteButton, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "CTL_BrowseButton_w"));
736
        browseSuiteButton.addActionListener(new java.awt.event.ActionListener() {
737
            public void actionPerformed(java.awt.event.ActionEvent evt) {
738
                browseModuleSuite(evt);
739
            }
740
        });
741
742
        gridBagConstraints = new java.awt.GridBagConstraints();
743
        gridBagConstraints.gridx = 2;
744
        gridBagConstraints.gridy = 3;
745
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
746
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
747
        gridBagConstraints.insets = new java.awt.Insets(6, 0, 0, 0);
748
        typeChooserPanel.add(browseSuiteButton, gridBagConstraints);
749
750
        gridBagConstraints = new java.awt.GridBagConstraints();
751
        gridBagConstraints.gridx = 0;
752
        gridBagConstraints.gridy = 4;
753
        gridBagConstraints.weighty = 1.0;
754
        typeChooserPanel.add(chooserFiller, gridBagConstraints);
755
756
        gridBagConstraints = new java.awt.GridBagConstraints();
757
        gridBagConstraints.gridx = 0;
758
        gridBagConstraints.gridy = 1;
759
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
760
        add(typeChooserPanel, gridBagConstraints);
761
762
        gridBagConstraints = new java.awt.GridBagConstraints();
592
        gridBagConstraints = new java.awt.GridBagConstraints();
763
        gridBagConstraints.gridx = 0;
593
        gridBagConstraints.gridx = 0;
764
        gridBagConstraints.gridy = 3;
594
        gridBagConstraints.gridy = 3;
Lines 768-773 Link Here
768
        gridBagConstraints.weighty = 1.0;
598
        gridBagConstraints.weighty = 1.0;
769
        add(pnlThouShaltBeholdLayout, gridBagConstraints);
599
        add(pnlThouShaltBeholdLayout, gridBagConstraints);
770
600
601
        typeChooserPanelContainer.setLayout(new java.awt.BorderLayout());
602
        gridBagConstraints = new java.awt.GridBagConstraints();
603
        gridBagConstraints.gridx = 0;
604
        gridBagConstraints.gridy = 1;
605
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
606
        add(typeChooserPanelContainer, gridBagConstraints);
771
    }// </editor-fold>//GEN-END:initComponents
607
    }// </editor-fold>//GEN-END:initComponents
772
    
608
    
773
    private void manageSuitePlatformActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_manageSuitePlatformActionPerformed
609
    private void manageSuitePlatformActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_manageSuitePlatformActionPerformed
Lines 777-849 Link Here
777
    private void mainProjectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mainProjectActionPerformed
613
    private void mainProjectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mainProjectActionPerformed
778
        mainProjectTouched = true;
614
        mainProjectTouched = true;
779
    }//GEN-LAST:event_mainProjectActionPerformed
615
    }//GEN-LAST:event_mainProjectActionPerformed
780
    
616
        
781
    private void managePlatformActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_managePlatformActionPerformed
782
        managePlatform(platformValue);
783
    }//GEN-LAST:event_managePlatformActionPerformed
784
    
785
    private void managePlatform(final JComboBox platformCombo) {
617
    private void managePlatform(final JComboBox platformCombo) {
786
        NbPlatformCustomizer.showCustomizer();
618
        NbPlatformCustomizer.showCustomizer();
787
        platformCombo.setModel(new PlatformComponentFactory.NbPlatformListModel()); // refresh
619
        platformCombo.setModel(new PlatformComponentFactory.NbPlatformListModel()); // refresh
788
        platformCombo.requestFocus();
620
        platformCombo.requestFocus();
789
        updateAndCheck();
621
        updateAndCheck();
790
    }
622
    }
791
    
623
                    
792
    private void platformChosen(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_platformChosen
793
        updateAndCheck();
794
    }//GEN-LAST:event_platformChosen
795
    
796
    private void moduleSuiteChosen(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_moduleSuiteChosen
797
        if (!locationUpdated) {
798
            String suite = (String) moduleSuiteValue.getSelectedItem();
799
            computeAndSetLocation(suite, true);
800
            lastSelectedSuite = suite;
801
        }
802
        updateAndCheck();
803
    }//GEN-LAST:event_moduleSuiteChosen
804
    
805
    private void browseModuleSuite(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseModuleSuite
806
        JFileChooser chooser = ProjectChooser.projectChooser();
807
        int option = chooser.showOpenDialog(this);
808
        if (option == JFileChooser.APPROVE_OPTION) {
809
            File projectDir = chooser.getSelectedFile();
810
            UIUtil.setProjectChooserDirParent(projectDir);
811
            try {
812
                Project suite = ProjectManager.getDefault().findProject(
813
                        FileUtil.toFileObject(projectDir));
814
                if (suite != null) {
815
                    String suiteDir = SuiteUtils.getSuiteDirectoryPath(suite);
816
                    if (suiteDir != null) {
817
                        // register for this session
818
                        PlatformComponentFactory.addUserSuite(suiteDir);
819
                        // add to current combobox
820
                        moduleSuiteValue.addItem(suiteDir);
821
                        moduleSuiteValue.setSelectedItem(suiteDir);
822
                    } else {
823
                        DialogDisplayer.getDefault().notify(new DialogDescriptor.Message(
824
                                NbBundle.getMessage(BasicInfoVisualPanel.class, "MSG_NotRegularSuite",
825
                                ProjectUtils.getInformation(suite).getDisplayName())));
826
                    }
827
                }
828
            } catch (IOException e) {
829
                ErrorManager.getDefault().notify(ErrorManager.WARNING, e);
830
            }
831
        }
832
    }//GEN-LAST:event_browseModuleSuite
833
    
834
    private void typeChanged(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_typeChanged
835
        if (!mainProjectTouched) {
836
            mainProject.setSelected(isStandAlone());
837
        }
838
        if (!locationUpdated) {
839
            setInitialLocation();
840
        }
841
        if (!nameUpdated) {
842
            setInitialProjectName();
843
        }
844
        updateAndCheck();
845
    }//GEN-LAST:event_typeChanged
846
    
847
    private void browseLocation(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseLocation
624
    private void browseLocation(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseLocation
848
        JFileChooser chooser = new JFileChooser(getLocationValue());
625
        JFileChooser chooser = new JFileChooser(getLocationValue());
849
        chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
626
        chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
Lines 855-862 Link Here
855
    
632
    
856
    // Variables declaration - do not modify//GEN-BEGIN:variables
633
    // Variables declaration - do not modify//GEN-BEGIN:variables
857
    private javax.swing.JButton browseButton;
634
    private javax.swing.JButton browseButton;
858
    private javax.swing.JButton browseSuiteButton;
859
    private javax.swing.JLabel chooserFiller;
860
    private javax.swing.JLabel filler;
635
    private javax.swing.JLabel filler;
861
    private javax.swing.JLabel folderLbl;
636
    private javax.swing.JLabel folderLbl;
862
    private javax.swing.JTextField folderValue;
637
    private javax.swing.JTextField folderValue;
Lines 864-885 Link Here
864
    private javax.swing.JLabel locationLbl;
639
    private javax.swing.JLabel locationLbl;
865
    private javax.swing.JTextField locationValue;
640
    private javax.swing.JTextField locationValue;
866
    private javax.swing.JCheckBox mainProject;
641
    private javax.swing.JCheckBox mainProject;
867
    private javax.swing.JButton managePlatform;
868
    private javax.swing.JButton manageSuitePlatform;
642
    private javax.swing.JButton manageSuitePlatform;
869
    private javax.swing.JLabel moduleSuite;
870
    private javax.swing.JComboBox moduleSuiteValue;
871
    private javax.swing.ButtonGroup moduleTypeGroup;
643
    private javax.swing.ButtonGroup moduleTypeGroup;
872
    private javax.swing.JLabel nameLbl;
644
    private javax.swing.JLabel nameLbl;
873
    javax.swing.JTextField nameValue;
645
    javax.swing.JTextField nameValue;
874
    private javax.swing.JLabel platform;
875
    private javax.swing.JComboBox platformValue;
876
    private javax.swing.JPanel pnlThouShaltBeholdLayout;
646
    private javax.swing.JPanel pnlThouShaltBeholdLayout;
877
    private javax.swing.JSeparator separator3;
647
    private javax.swing.JSeparator separator3;
878
    private javax.swing.JRadioButton standAloneModule;
879
    private javax.swing.JRadioButton suiteComponent;
880
    private javax.swing.JLabel suitePlatform;
648
    private javax.swing.JLabel suitePlatform;
881
    private javax.swing.JComboBox suitePlatformValue;
649
    private javax.swing.JComboBox suitePlatformValue;
882
    private javax.swing.JPanel typeChooserPanel;
650
    private javax.swing.JPanel typeChooserPanelContainer;
883
    // End of variables declaration//GEN-END:variables
651
    // End of variables declaration//GEN-END:variables
884
    
652
    
653
    private TypeChooserPanelImpl typeChooserPanel;
885
}
654
}
(-)a/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/wizard/BasicVisualPanel.java (-3 / +3 lines)
Lines 166-180 Link Here
166
        }
166
        }
167
        
167
        
168
        protected boolean isSuiteWizard() {
168
        protected boolean isSuiteWizard() {
169
            return getData().getWizardType() == NewNbModuleWizardIterator.Type.SUITE || getData().getWizardType() == NewNbModuleWizardIterator.Type.APPLICATION;
169
            return NewNbModuleWizardIterator.isSuiteWizard(getData().getWizardType());
170
        }
170
        }
171
        
171
        
172
        protected boolean isSuiteComponentWizard() {
172
        protected boolean isSuiteComponentWizard() {
173
            return getData().getWizardType() == NewNbModuleWizardIterator.Type.SUITE_COMPONENT;
173
            return NewNbModuleWizardIterator.isSuiteComponentWizard(getData().getWizardType());
174
        }
174
        }
175
175
176
        protected boolean isLibraryWizard() {
176
        protected boolean isLibraryWizard() {
177
            return getData().getWizardType() == NewNbModuleWizardIterator.Type.LIBRARY_MODULE;
177
            return NewNbModuleWizardIterator.isLibraryWizard(getData().getWizardType());
178
        }
178
        }
179
        
179
        
180
    }
180
    }
(-)a/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/wizard/NewNbModuleWizardIterator.java (-1 / +13 lines)
Lines 152-158 Link Here
152
    public static NewNbModuleWizardIterator createLibraryModuleIterator() {
152
    public static NewNbModuleWizardIterator createLibraryModuleIterator() {
153
        return new NewNbModuleWizardIterator(Type.LIBRARY_MODULE);
153
        return new NewNbModuleWizardIterator(Type.LIBRARY_MODULE);
154
    }
154
    }
155
    
155
156
    static boolean isSuiteWizard(Type type) {
157
        return type == Type.SUITE || type == Type.APPLICATION;
158
    }
159
160
    static boolean isSuiteComponentWizard(Type type) {
161
        return type == Type.SUITE_COMPONENT;
162
    }
163
164
    static boolean isLibraryWizard(Type type) {
165
        return type == Type.LIBRARY_MODULE;
166
    }
167
156
    public FileObject getCreateProjectFolder() {
168
    public FileObject getCreateProjectFolder() {
157
        return createdProjectFolder;
169
        return createdProjectFolder;
158
    }
170
    }
(-)41a80a61376e (+74 lines)
Added Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 * 
4
 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
5
 * 
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 * 
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 * 
35
 * Contributor(s):
36
 * 
37
 * Portions Copyrighted 2008 Sun Microsystems, Inc.
38
 */
39
40
package org.netbeans.modules.apisupport.project.ui.wizard;
41
42
import java.awt.Component;
43
import org.netbeans.modules.apisupport.project.ui.wizard.spi.ModuleTypeChooserPanelExt;
44
import org.openide.WizardDescriptor;
45
46
/**
47
 *
48
 * @author akorostelev
49
 */
50
public class TypeChooserPanelExternalImpl extends TypeChooserPanelImpl 
51
        implements ModuleTypeChooserPanelExt
52
{
53
54
    public TypeChooserPanelExternalImpl() {
55
        super();
56
        attachModuleTypeGroup();
57
    }
58
    
59
    public void read(WizardDescriptor settings) {
60
    }
61
62
    public void store(WizardDescriptor settings) {
63
        settings.putProperty(IS_NETBEANS_ORG, isNetBeansOrgFolder());
64
        settings.putProperty(IS_STANDALONE, isStandAlone());
65
        settings.putProperty(IS_SUITE_COMPONENT, isSuiteComponent());
66
        settings.putProperty(SUITE_ROOT, getSelectedSuite());
67
        settings.putProperty(ACTIVE_PLATFORM, getSelectedPlatform());
68
    }
69
70
    public Component getComponent() {
71
        return this;
72
    }
73
74
}
(-)41a80a61376e (+181 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8" ?>
2
3
<Form version="1.5" maxVersion="1.6" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <NonVisualComponents>
5
    <Component class="javax.swing.ButtonGroup" name="moduleTypeGroup">
6
    </Component>
7
  </NonVisualComponents>
8
  <AuxValues>
9
    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
10
    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
11
    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
12
    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
13
    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
14
    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
15
    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
16
    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
17
  </AuxValues>
18
19
  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
20
  <SubComponents>
21
    <Container class="javax.swing.JPanel" name="typeChooserPanel">
22
      <Constraints>
23
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
24
          <BorderConstraints direction="Center"/>
25
        </Constraint>
26
      </Constraints>
27
28
      <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
29
      <SubComponents>
30
        <Component class="javax.swing.JRadioButton" name="standAloneModule">
31
          <Properties>
32
            <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
33
              <ComponentRef name="moduleTypeGroup"/>
34
            </Property>
35
            <Property name="selected" type="boolean" value="true"/>
36
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
37
              <ResourceString bundle="org/netbeans/modules/apisupport/project/ui/wizard/Bundle.properties" key="CTL_StandaloneModule" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
38
            </Property>
39
          </Properties>
40
          <Events>
41
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="standAloneModuleTypeChanged"/>
42
          </Events>
43
          <AuxValues>
44
            <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
45
          </AuxValues>
46
          <Constraints>
47
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
48
              <GridBagConstraints gridX="0" gridY="0" gridWidth="3" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="6" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
49
            </Constraint>
50
          </Constraints>
51
        </Component>
52
        <Component class="javax.swing.JLabel" name="platform">
53
          <Properties>
54
            <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
55
              <ComponentRef name="platformValue"/>
56
            </Property>
57
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
58
              <ResourceString bundle="org/netbeans/modules/apisupport/project/ui/wizard/Bundle.properties" key="LBL_NetBeansPlatform" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
59
            </Property>
60
          </Properties>
61
          <AuxValues>
62
            <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
63
          </AuxValues>
64
          <Constraints>
65
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
66
              <GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="18" insetsBottom="0" insetsRight="12" anchor="17" weightX="0.0" weightY="0.0"/>
67
            </Constraint>
68
          </Constraints>
69
        </Component>
70
        <Component class="javax.swing.JComboBox" name="platformValue">
71
          <Events>
72
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="platformChosen"/>
73
          </Events>
74
          <AuxValues>
75
            <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="PlatformComponentFactory.getNbPlatformsComboxBox();"/>
76
          </AuxValues>
77
          <Constraints>
78
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
79
              <GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="12" anchor="17" weightX="1.0" weightY="0.0"/>
80
            </Constraint>
81
          </Constraints>
82
        </Component>
83
        <Component class="javax.swing.JButton" name="managePlatform">
84
          <Properties>
85
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
86
              <ResourceString bundle="org/netbeans/modules/apisupport/project/ui/wizard/Bundle.properties" key="CTL_ManagePlatforms_g" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
87
            </Property>
88
          </Properties>
89
          <Events>
90
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="managePlatformActionPerformed"/>
91
          </Events>
92
          <AuxValues>
93
            <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
94
          </AuxValues>
95
          <Constraints>
96
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
97
              <GridBagConstraints gridX="2" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
98
            </Constraint>
99
          </Constraints>
100
        </Component>
101
        <Component class="javax.swing.JRadioButton" name="suiteComponent">
102
          <Properties>
103
            <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
104
              <ComponentRef name="moduleTypeGroup"/>
105
            </Property>
106
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
107
              <ResourceString bundle="org/netbeans/modules/apisupport/project/ui/wizard/Bundle.properties" key="CTL_AddToModuleSuite" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
108
            </Property>
109
          </Properties>
110
          <Events>
111
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="suiteComponentTypeChanged"/>
112
          </Events>
113
          <AuxValues>
114
            <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
115
          </AuxValues>
116
          <Constraints>
117
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
118
              <GridBagConstraints gridX="0" gridY="2" gridWidth="3" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="18" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
119
            </Constraint>
120
          </Constraints>
121
        </Component>
122
        <Component class="javax.swing.JLabel" name="moduleSuite">
123
          <Properties>
124
            <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
125
              <ComponentRef name="moduleSuiteValue"/>
126
            </Property>
127
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
128
              <ResourceString bundle="org/netbeans/modules/apisupport/project/ui/wizard/Bundle.properties" key="LBL_ModuleSuite" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
129
            </Property>
130
          </Properties>
131
          <AuxValues>
132
            <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
133
          </AuxValues>
134
          <Constraints>
135
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
136
              <GridBagConstraints gridX="0" gridY="3" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="6" insetsLeft="18" insetsBottom="0" insetsRight="12" anchor="17" weightX="0.0" weightY="0.0"/>
137
            </Constraint>
138
          </Constraints>
139
        </Component>
140
        <Component class="javax.swing.JComboBox" name="moduleSuiteValue">
141
          <Events>
142
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="moduleSuiteChosen"/>
143
          </Events>
144
          <AuxValues>
145
            <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="getDefaultSuitesComboBox();"/>
146
          </AuxValues>
147
          <Constraints>
148
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
149
              <GridBagConstraints gridX="1" gridY="3" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="6" insetsLeft="0" insetsBottom="0" insetsRight="12" anchor="17" weightX="1.0" weightY="0.0"/>
150
            </Constraint>
151
          </Constraints>
152
        </Component>
153
        <Component class="javax.swing.JButton" name="browseSuiteButton">
154
          <Properties>
155
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
156
              <ResourceString bundle="org/netbeans/modules/apisupport/project/ui/wizard/Bundle.properties" key="CTL_BrowseButton_w" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
157
            </Property>
158
          </Properties>
159
          <Events>
160
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="browseModuleSuite"/>
161
          </Events>
162
          <AuxValues>
163
            <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
164
          </AuxValues>
165
          <Constraints>
166
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
167
              <GridBagConstraints gridX="2" gridY="3" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="6" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
168
            </Constraint>
169
          </Constraints>
170
        </Component>
171
        <Component class="javax.swing.JLabel" name="chooserFiller">
172
          <Constraints>
173
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
174
              <GridBagConstraints gridX="0" gridY="4" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="1.0"/>
175
            </Constraint>
176
          </Constraints>
177
        </Component>
178
      </SubComponents>
179
    </Container>
180
  </SubComponents>
181
</Form>
(-)41a80a61376e (+503 lines)
Added Link Here
1
/*
2
 * TypeChooserPanel.java
3
 *
4
 * Created on 22 Июль 2008 г., 16:08
5
 */
6
7
package org.netbeans.modules.apisupport.project.ui.wizard;
8
9
import java.io.File;
10
import java.io.IOException;
11
import javax.swing.ButtonModel;
12
import javax.swing.JComboBox;
13
import javax.swing.JFileChooser;
14
import org.netbeans.api.project.Project;
15
import org.netbeans.api.project.ProjectManager;
16
import org.netbeans.api.project.ProjectUtils;
17
import org.netbeans.modules.apisupport.project.ui.UIUtil;
18
import org.netbeans.modules.apisupport.project.ui.customizer.SuiteUtils;
19
import org.netbeans.modules.apisupport.project.ui.platform.PlatformComponentFactory;
20
import org.netbeans.modules.apisupport.project.ui.wizard.NewNbModuleWizardIterator.Type;
21
import org.netbeans.modules.apisupport.project.ui.wizard.spi.ModuleTypeChooserPanel;
22
import org.netbeans.modules.apisupport.project.universe.NbPlatform;
23
import org.netbeans.modules.apisupport.project.ui.platform.NbPlatformCustomizer;
24
import org.netbeans.spi.project.ui.support.ProjectChooser;
25
import org.openide.DialogDescriptor;
26
import org.openide.DialogDisplayer;
27
import org.openide.ErrorManager;
28
import org.openide.WizardDescriptor;
29
import org.openide.filesystems.FileUtil;
30
import org.openide.util.NbBundle;
31
32
/**
33
 *
34
 * @author  akorostelev
35
 */
36
class TypeChooserPanelImpl extends javax.swing.JPanel 
37
        implements ModuleTypeChooserPanel
38
{
39
40
    private ButtonModel lastSelectedType;
41
    private static String lastSelectedSuite;
42
    private boolean moduleTypeGroupAttached = false;
43
    private WizardDescriptor settings;
44
    private Type wizardType;
45
    
46
    public TypeChooserPanelImpl() {
47
        initComponents();
48
        initAccessibility();
49
        init();
50
    }
51
52
    /** Creates new form TypeChooserPanel */
53
    protected TypeChooserPanelImpl(final WizardDescriptor settings, Type wizardType) {
54
        this();
55
        this.settings = settings;
56
        this.wizardType = wizardType;
57
        switch (wizardType) {
58
            case SUITE:
59
            case APPLICATION:
60
                detachModuleTypeGroup();
61
                break;
62
            case LIBRARY_MODULE:
63
                moduleSuite.setText(getMessage("LBL_Add_to_Suite")); // NOI18N
64
                suiteComponent.setSelected(true);
65
                if (moduleSuiteValue.getItemCount() > 0) {
66
                    restoreSelectedSuite();
67
                }
68
                break;
69
            case MODULE:
70
            case SUITE_COMPONENT:
71
            default:
72
                if (moduleSuiteValue.getItemCount() > 0) {
73
                    restoreSelectedSuite();
74
                    suiteComponent.setSelected(true);
75
                }
76
        }
77
    }
78
    
79
    protected static JComboBox getDefaultSuitesComboBox(){
80
        return PlatformComponentFactory.getSuitesComboBox();
81
    }
82
    
83
    public boolean validate(WizardDescriptor settings) {
84
        this.settings = settings;
85
        if (isSuiteComponent() && moduleSuiteValue.getSelectedItem() == null) {
86
            setMessage(getMessage("MSG_ChooseRegularSuite"));// NOI18N
87
            return false;
88
        } else if (isStandAlone() &&
89
                (platformValue.getSelectedItem() == null || !((NbPlatform) platformValue.getSelectedItem()).isValid())) {
90
            setMessage(getMessage("MSG_ChosenPlatformIsInvalid"));// NOI18N
91
            return false;
92
        }
93
        return true;
94
    }
95
96
    public void updateUI(WizardDescriptor settings) {
97
        this.settings = settings;
98
        if (isSuiteWizard() || isNetBeansOrgFolder()) {
99
            detachModuleTypeGroup();
100
        } else {
101
            attachModuleTypeGroup();
102
        }
103
        updateEnabled();
104
    }
105
106
    protected boolean isStandAlone() {
107
        return standAloneModule.isSelected();
108
    }
109
    
110
    protected boolean isSuiteComponent() {
111
        return suiteComponent.isSelected();
112
    }
113
    
114
    protected String getSelectedSuite() {
115
        return (String) moduleSuiteValue.getSelectedItem();
116
    }
117
    
118
    protected boolean isNetBeansOrgFolder() {
119
        File folder = getFolder();
120
        if (folder != null){
121
            return BasicInfoVisualPanel.isNetBeansOrgFolder(folder);
122
        }
123
        return false;
124
    }
125
    
126
    protected String getSelectedPlatform() {
127
        Object selected = platformValue.getSelectedItem();
128
        if (selected != null){
129
            return ((NbPlatform) platformValue.getSelectedItem()).getID();
130
        } else {
131
            return null;
132
        }
133
    }
134
    
135
    protected void setComponentsVisibility(boolean isSuiteComponentWizard, 
136
            boolean isLibraryWizard)
137
    {
138
        suiteComponent.setVisible(!isLibraryWizard);
139
        platform.setVisible(!isLibraryWizard);
140
        platformValue.setVisible(!isLibraryWizard);
141
        managePlatform.setVisible(!isLibraryWizard);
142
        standAloneModule.setVisible(!isLibraryWizard);
143
        
144
        standAloneModule.setVisible(!isSuiteComponentWizard && !isLibraryWizard);
145
        platform.setVisible(!isSuiteComponentWizard && !isLibraryWizard);
146
        platformValue.setVisible(!isSuiteComponentWizard && !isLibraryWizard);
147
        managePlatform.setVisible(!isSuiteComponentWizard && !isLibraryWizard);
148
        suiteComponent.setVisible(!isSuiteComponentWizard && !isLibraryWizard);
149
        
150
    }
151
    
152
    private void updateEnabled(){
153
        boolean isNetBeansOrg = isNetBeansOrgFolder();
154
        standAloneModule.setEnabled(!isNetBeansOrg);
155
        suiteComponent.setEnabled(!isNetBeansOrg);
156
        
157
        boolean standalone = isStandAlone();
158
        boolean suiteModuleSelected = isSuiteComponent();
159
        platform.setEnabled(standalone);
160
        platformValue.setEnabled(standalone);
161
        managePlatform.setEnabled(standalone);
162
        moduleSuite.setEnabled(suiteModuleSelected);
163
        moduleSuiteValue.setEnabled(suiteModuleSelected && !isOneSuiteDedicatedMode());
164
        browseSuiteButton.setEnabled(suiteModuleSelected && !isOneSuiteDedicatedMode());
165
    }
166
    
167
    private void detachModuleTypeGroup() {
168
        if (moduleTypeGroupAttached) {
169
            lastSelectedType = moduleTypeGroup.getSelection();
170
            moduleTypeGroup.remove(standAloneModule);
171
            moduleTypeGroup.remove(suiteComponent);
172
            standAloneModule.setSelected(false);
173
            suiteComponent.setSelected(false);
174
            moduleTypeGroupAttached = false;
175
        }
176
    }
177
    
178
    /**
179
     * Adds radiobuttons to ButtonGroup and sets selection.
180
     */
181
    protected void attachModuleTypeGroup() {
182
        if (!moduleTypeGroupAttached) {
183
            moduleTypeGroup.add(standAloneModule);
184
            moduleTypeGroup.add(suiteComponent);
185
            if (isLibraryWizard()) {
186
                suiteComponent.setSelected(true);
187
            } else {
188
                moduleTypeGroup.setSelected(lastSelectedType, true);
189
            }
190
            moduleTypeGroupAttached = true;
191
        }
192
    }
193
    
194
    private void init(){
195
        BasicInfoVisualPanel.initPlatformCombo(platformValue);
196
        if (moduleSuiteValue.getItemCount() > 0) {
197
            restoreSelectedSuite();
198
            suiteComponent.setSelected(true);
199
        }
200
    }
201
    
202
    private void restoreSelectedSuite() {
203
        String preferredSuiteDir  = getPreferredSuiteDir();
204
        if (preferredSuiteDir != null) {
205
            lastSelectedSuite = preferredSuiteDir;
206
        }
207
        if (lastSelectedSuite != null) {
208
            int max = moduleSuiteValue.getModel().getSize();
209
            for (int i=0; i < max; i++) {
210
                if (lastSelectedSuite.equals(moduleSuiteValue.getModel().getElementAt(i))) {
211
                    moduleSuiteValue.setSelectedItem(lastSelectedSuite);
212
                    break;
213
                }
214
            }
215
        }
216
    }
217
    
218
    private String getPreferredSuiteDir() {
219
        if (getSettings() != null){
220
            return (String) getSettings().getProperty(NewNbModuleWizardIterator.PREFERRED_SUITE_DIR);
221
        }
222
        return null;
223
    }
224
    
225
    private boolean isOneSuiteDedicatedMode() {
226
        Boolean b = false;
227
        if (getSettings() != null){
228
            b = (Boolean) getSettings().getProperty(
229
                    NewNbModuleWizardIterator.ONE_SUITE_DEDICATED_MODE);
230
        }
231
        return b != null ? b.booleanValue() : false;
232
    }
233
    
234
    private File getFolder() {
235
        if (getSettings() != null){
236
            return (File)getSettings().getProperty(PROJECT_FOLDER);
237
        }
238
        return null;
239
    }
240
241
    private void initAccessibility() {
242
        browseSuiteButton.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_BrowseSuiteButton"));// NOI18N
243
        managePlatform.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_ManagePlatform"));// NOI18N
244
        moduleSuiteValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_ModuleSuiteValue"));// NOI18N
245
        platformValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_PlatformValue"));// NOI18N
246
        standAloneModule.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_StandAloneModule"));// NOI18N
247
        suiteComponent.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_SuiteModule"));// NOI18N
248
    }
249
250
    /** This method is called from within the constructor to
251
     * initialize the form.
252
     * WARNING: Do NOT modify this code. The content of this method is
253
     * always regenerated by the Form Editor.
254
     */
255
    @SuppressWarnings("unchecked")
256
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
257
    private void initComponents() {
258
        java.awt.GridBagConstraints gridBagConstraints;
259
260
        moduleTypeGroup = new javax.swing.ButtonGroup();
261
        typeChooserPanel = new javax.swing.JPanel();
262
        standAloneModule = new javax.swing.JRadioButton();
263
        platform = new javax.swing.JLabel();
264
        platformValue = PlatformComponentFactory.getNbPlatformsComboxBox();
265
        managePlatform = new javax.swing.JButton();
266
        suiteComponent = new javax.swing.JRadioButton();
267
        moduleSuite = new javax.swing.JLabel();
268
        moduleSuiteValue = getDefaultSuitesComboBox();
269
        browseSuiteButton = new javax.swing.JButton();
270
        chooserFiller = new javax.swing.JLabel();
271
272
        setLayout(new java.awt.BorderLayout());
273
274
        typeChooserPanel.setLayout(new java.awt.GridBagLayout());
275
276
        moduleTypeGroup.add(standAloneModule);
277
        standAloneModule.setSelected(true);
278
        org.openide.awt.Mnemonics.setLocalizedText(standAloneModule, org.openide.util.NbBundle.getMessage(TypeChooserPanelImpl.class, "CTL_StandaloneModule")); // NOI18N
279
        standAloneModule.addActionListener(new java.awt.event.ActionListener() {
280
            public void actionPerformed(java.awt.event.ActionEvent evt) {
281
                standAloneModuleTypeChanged(evt);
282
            }
283
        });
284
        gridBagConstraints = new java.awt.GridBagConstraints();
285
        gridBagConstraints.gridx = 0;
286
        gridBagConstraints.gridy = 0;
287
        gridBagConstraints.gridwidth = 3;
288
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
289
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 0);
290
        typeChooserPanel.add(standAloneModule, gridBagConstraints);
291
292
        platform.setLabelFor(platformValue);
293
        org.openide.awt.Mnemonics.setLocalizedText(platform, org.openide.util.NbBundle.getMessage(TypeChooserPanelImpl.class, "LBL_NetBeansPlatform")); // NOI18N
294
        gridBagConstraints = new java.awt.GridBagConstraints();
295
        gridBagConstraints.gridx = 0;
296
        gridBagConstraints.gridy = 1;
297
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
298
        gridBagConstraints.insets = new java.awt.Insets(0, 18, 0, 12);
299
        typeChooserPanel.add(platform, gridBagConstraints);
300
301
        platformValue.addActionListener(new java.awt.event.ActionListener() {
302
            public void actionPerformed(java.awt.event.ActionEvent evt) {
303
                platformChosen(evt);
304
            }
305
        });
306
        gridBagConstraints = new java.awt.GridBagConstraints();
307
        gridBagConstraints.gridx = 1;
308
        gridBagConstraints.gridy = 1;
309
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
310
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
311
        gridBagConstraints.weightx = 1.0;
312
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 12);
313
        typeChooserPanel.add(platformValue, gridBagConstraints);
314
315
        org.openide.awt.Mnemonics.setLocalizedText(managePlatform, org.openide.util.NbBundle.getMessage(TypeChooserPanelImpl.class, "CTL_ManagePlatforms_g")); // NOI18N
316
        managePlatform.addActionListener(new java.awt.event.ActionListener() {
317
            public void actionPerformed(java.awt.event.ActionEvent evt) {
318
                managePlatformActionPerformed(evt);
319
            }
320
        });
321
        gridBagConstraints = new java.awt.GridBagConstraints();
322
        gridBagConstraints.gridx = 2;
323
        gridBagConstraints.gridy = 1;
324
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
325
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
326
        typeChooserPanel.add(managePlatform, gridBagConstraints);
327
328
        moduleTypeGroup.add(suiteComponent);
329
        org.openide.awt.Mnemonics.setLocalizedText(suiteComponent, org.openide.util.NbBundle.getMessage(TypeChooserPanelImpl.class, "CTL_AddToModuleSuite")); // NOI18N
330
        suiteComponent.addActionListener(new java.awt.event.ActionListener() {
331
            public void actionPerformed(java.awt.event.ActionEvent evt) {
332
                suiteComponentTypeChanged(evt);
333
            }
334
        });
335
        gridBagConstraints = new java.awt.GridBagConstraints();
336
        gridBagConstraints.gridx = 0;
337
        gridBagConstraints.gridy = 2;
338
        gridBagConstraints.gridwidth = 3;
339
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
340
        gridBagConstraints.insets = new java.awt.Insets(18, 0, 0, 0);
341
        typeChooserPanel.add(suiteComponent, gridBagConstraints);
342
343
        moduleSuite.setLabelFor(moduleSuiteValue);
344
        org.openide.awt.Mnemonics.setLocalizedText(moduleSuite, org.openide.util.NbBundle.getMessage(TypeChooserPanelImpl.class, "LBL_ModuleSuite")); // NOI18N
345
        gridBagConstraints = new java.awt.GridBagConstraints();
346
        gridBagConstraints.gridx = 0;
347
        gridBagConstraints.gridy = 3;
348
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
349
        gridBagConstraints.insets = new java.awt.Insets(6, 18, 0, 12);
350
        typeChooserPanel.add(moduleSuite, gridBagConstraints);
351
352
        moduleSuiteValue.addActionListener(new java.awt.event.ActionListener() {
353
            public void actionPerformed(java.awt.event.ActionEvent evt) {
354
                moduleSuiteChosen(evt);
355
            }
356
        });
357
        gridBagConstraints = new java.awt.GridBagConstraints();
358
        gridBagConstraints.gridx = 1;
359
        gridBagConstraints.gridy = 3;
360
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
361
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
362
        gridBagConstraints.weightx = 1.0;
363
        gridBagConstraints.insets = new java.awt.Insets(6, 0, 0, 12);
364
        typeChooserPanel.add(moduleSuiteValue, gridBagConstraints);
365
366
        org.openide.awt.Mnemonics.setLocalizedText(browseSuiteButton, org.openide.util.NbBundle.getMessage(TypeChooserPanelImpl.class, "CTL_BrowseButton_w")); // NOI18N
367
        browseSuiteButton.addActionListener(new java.awt.event.ActionListener() {
368
            public void actionPerformed(java.awt.event.ActionEvent evt) {
369
                browseModuleSuite(evt);
370
            }
371
        });
372
        gridBagConstraints = new java.awt.GridBagConstraints();
373
        gridBagConstraints.gridx = 2;
374
        gridBagConstraints.gridy = 3;
375
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
376
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
377
        gridBagConstraints.insets = new java.awt.Insets(6, 0, 0, 0);
378
        typeChooserPanel.add(browseSuiteButton, gridBagConstraints);
379
        gridBagConstraints = new java.awt.GridBagConstraints();
380
        gridBagConstraints.gridx = 0;
381
        gridBagConstraints.gridy = 4;
382
        gridBagConstraints.weighty = 1.0;
383
        typeChooserPanel.add(chooserFiller, gridBagConstraints);
384
385
        add(typeChooserPanel, java.awt.BorderLayout.CENTER);
386
    }// </editor-fold>//GEN-END:initComponents
387
388
private void standAloneModuleTypeChanged(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_standAloneModuleTypeChanged
389
    firePropertyChange(IS_STANDALONE, null, new Boolean(isStandAlone()));
390
    updateEnabled();
391
}//GEN-LAST:event_standAloneModuleTypeChanged
392
393
private void platformChosen(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_platformChosen
394
    firePropertyChange("prop_platform", null, platformValue.getModel().getSelectedItem()); //NOI18N
395
    updateEnabled();
396
}//GEN-LAST:event_platformChosen
397
398
private void managePlatformActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_managePlatformActionPerformed
399
    managePlatform(platformValue);
400
    firePropertyChange("prop_platform_managed", null, platformValue.getModel().getSelectedItem());//NOI18N
401
    updateEnabled();
402
}//GEN-LAST:event_managePlatformActionPerformed
403
404
    private void managePlatform(final JComboBox platformCombo) {
405
        NbPlatformCustomizer.showCustomizer();
406
        platformCombo.setModel(new PlatformComponentFactory.NbPlatformListModel()); // refresh
407
        platformCombo.requestFocus();
408
    }
409
410
private void suiteComponentTypeChanged(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_suiteComponentTypeChanged
411
    firePropertyChange(IS_SUITE_COMPONENT, null, new Boolean(isSuiteComponent()));
412
    updateEnabled();
413
}//GEN-LAST:event_suiteComponentTypeChanged
414
415
private void moduleSuiteChosen(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_moduleSuiteChosen
416
    String suite = (String) moduleSuiteValue.getSelectedItem();
417
    lastSelectedSuite = suite;
418
    firePropertyChange(SUITE_ROOT, null, suite);
419
    updateEnabled();
420
}//GEN-LAST:event_moduleSuiteChosen
421
422
private void browseModuleSuite(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseModuleSuite
423
JFileChooser chooser = ProjectChooser.projectChooser();
424
        int option = chooser.showOpenDialog(this);
425
        if (option == JFileChooser.APPROVE_OPTION) {
426
            File projectDir = chooser.getSelectedFile();
427
            UIUtil.setProjectChooserDirParent(projectDir);
428
            try {
429
                Project suite = ProjectManager.getDefault().findProject(
430
                        FileUtil.toFileObject(projectDir));
431
                if (suite != null) {
432
                    String suiteDir = SuiteUtils.getSuiteDirectoryPath(suite);
433
                    if (suiteDir != null) {
434
                        // register for this session
435
                        PlatformComponentFactory.addUserSuite(suiteDir);
436
                        // add to current combobox
437
                        moduleSuiteValue.addItem(suiteDir);
438
                        moduleSuiteValue.setSelectedItem(suiteDir);
439
                    } else {
440
                        DialogDisplayer.getDefault().notify(new DialogDescriptor.Message(
441
                                NbBundle.getMessage(BasicInfoVisualPanel.class, "MSG_NotRegularSuite",
442
                                ProjectUtils.getInformation(suite).getDisplayName())));
443
                    }
444
                }
445
            } catch (IOException e) {
446
                ErrorManager.getDefault().notify(ErrorManager.WARNING, e);
447
            }
448
        }
449
}//GEN-LAST:event_browseModuleSuite
450
451
452
    // Variables declaration - do not modify//GEN-BEGIN:variables
453
    private javax.swing.JButton browseSuiteButton;
454
    private javax.swing.JLabel chooserFiller;
455
    private javax.swing.JButton managePlatform;
456
    private javax.swing.JLabel moduleSuite;
457
    private javax.swing.JComboBox moduleSuiteValue;
458
    private javax.swing.ButtonGroup moduleTypeGroup;
459
    private javax.swing.JLabel platform;
460
    private javax.swing.JComboBox platformValue;
461
    private javax.swing.JRadioButton standAloneModule;
462
    private javax.swing.JRadioButton suiteComponent;
463
    private javax.swing.JPanel typeChooserPanel;
464
    // End of variables declaration//GEN-END:variables
465
466
    
467
    
468
    private final void setMessage(String message) {
469
        getSettings().putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, message); 
470
    }
471
472
    private static String getMessage(String key) {
473
        return NbBundle.getMessage(TypeChooserPanelImpl.class, key);
474
    }
475
    
476
    private WizardDescriptor getSettings(){
477
        return settings;
478
    }
479
    
480
    private Type getWizardType(){
481
        return this.wizardType;
482
    }
483
484
    // TODO movo implementation to static methods
485
    private boolean isSuiteWizard() {
486
        return getWizardType() != null 
487
            ? NewNbModuleWizardIterator.isSuiteWizard(getWizardType())
488
            : false;
489
    }
490
491
    private boolean isSuiteComponentWizard() {
492
        return getWizardType() != null 
493
            ? NewNbModuleWizardIterator.isSuiteComponentWizard(getWizardType())
494
            : false;
495
    }
496
497
    private boolean isLibraryWizard() {
498
        return getWizardType() != null 
499
            ? NewNbModuleWizardIterator.isLibraryWizard(getWizardType())
500
            : false;
501
    }
502
    
503
}
(-)41a80a61376e (+141 lines)
Added Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 * 
4
 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
5
 * 
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 * 
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 * 
35
 * Contributor(s):
36
 * 
37
 * Portions Copyrighted 2008 Sun Microsystems, Inc.
38
 */
39
40
package org.netbeans.modules.apisupport.project.ui.wizard.spi;
41
42
import java.beans.PropertyChangeListener;
43
import org.openide.WizardDescriptor;
44
45
/**
46
 * Interface of UI panel for embedding into the First step 
47
 * of NetBeans module project wizard.
48
 * Panel contains UI to select
49
 * <ul>
50
 *  <li>NetBeans Platform (for standalone modules)</li>
51
 *  <li>Module Suite (for suite modules)</li>
52
 * </ul>
53
 * 
54
 * Is used by internal implementation of panel and is extended by 
55
 * ModuleTypeChooserPanel interface, that is targeted for external usage.
56
 * 
57
 * @author akorostelev
58
 */
59
public interface ModuleTypeChooserPanel {
60
61
    /** 
62
     * key for File value. 
63
     * Is used to provide project's folder to TypeChooserPanel before
64
     * updateUI(WizardDescriptor) invocation. Is used by TypeChooserPanel
65
     * implementation to decide whether specified forder 
66
     * is in NetBeans.org repository.
67
     */
68
    String PROJECT_FOLDER               = "tc_projectFolderForTypeChooser";     // NOI18N
69
70
    /** key for Boolean value. 
71
     * True if "Standalone Module" radiobutton is selected */
72
    String IS_STANDALONE                = "tc_isStandalone";                    // NOI18N
73
    
74
    /** key for Boolean value. 
75
     * True if "Add To Module Suite" radiobutton is selected */
76
    String IS_SUITE_COMPONENT           = "tc_isSuiteComponent";                // NOI18N
77
    
78
    /** key for String value. Suite root directory */
79
    String SUITE_ROOT                   = "tc_suiteRoot";                       // NOI18N
80
    
81
    /** 
82
     * key for String value. 
83
     * Active platform ID value to be used as value 
84
     * for nbplatform.active property in platform.properties file.
85
     */
86
    String ACTIVE_PLATFORM              = "tc_activePlatform";                  // NOI18N
87
    
88
    /**
89
     * validates panel. Error messages should be added to provided settings 
90
     * by setting WizardDescriptor.PROP_ERROR_MESSAGE property value:
91
     * <pre>
92
     * settings.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, message); 
93
     * </pre>
94
     * @param settings 
95
     * @return true if panel is valid. false otherwise.
96
     */
97
    boolean validate(WizardDescriptor settings);
98
99
    /**
100
     * updates panel UI basing on provided WizardDescriptor.
101
     * @param settings Wizard descriptor with external data 
102
     * useful for UI updating (e.g. PROJECT_FOLDER value 
103
     * to calculate IS_NETBEANS_ORG value ).
104
     */
105
    void updateUI(WizardDescriptor settings);
106
    
107
    /**
108
     * Adds a PropertyChangeListener to the listener list. The listener is
109
     * registered for all bound properties of this class, including changes in 
110
     * this panel UI:
111
     * <ul>
112
     *  <li>IS_STANDALONE</li>
113
     *  <li>IS_SUITE_COMPONENT</li>
114
     *  <li>SUITE_ROOT</li>
115
     *  <li>ACTIVE_PLATFORM</li>
116
     * </ul>
117
     * 
118
     * @param    listener  the PropertyChangeListener to be added
119
     * 
120
     * @see java.awt.Component#addPropertyChangeListener(java.beans.PropertyChangeListener)
121
     * @see #removePropertyChangeListener(java.beans.PropertyChangeListener)
122
     */
123
    void addPropertyChangeListener(PropertyChangeListener listener);
124
    
125
   /**
126
     * Removes a PropertyChangeListener from the listener list. This method
127
     * should be used to remove PropertyChangeListeners that were registered
128
     * for all bound properties of this class.
129
     * <p>
130
     * If listener is null, no exception is thrown and no action is performed.
131
     * <p>
132
     *
133
     * @param listener the PropertyChangeListener to be removed
134
     *
135
     * @see java.awt.Component#removePropertyChangeListener(java.beans.PropertyChangeListener)
136
     * @see #addPropertyChangeListener(java.beans.PropertyChangeListener)
137
     */
138
    void removePropertyChangeListener(PropertyChangeListener listener);
139
    
140
    
141
}
(-)41a80a61376e (+94 lines)
Added Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 * 
4
 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
5
 * 
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 * 
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 * 
35
 * Contributor(s):
36
 * 
37
 * Portions Copyrighted 2008 Sun Microsystems, Inc.
38
 */
39
40
package org.netbeans.modules.apisupport.project.ui.wizard.spi;
41
42
import org.netbeans.modules.apisupport.project.ui.wizard.spi.ModuleTypeChooserPanel;
43
import java.awt.Component;
44
import org.netbeans.modules.apisupport.project.ui.wizard.TypeChooserPanelExternalImpl;
45
import org.openide.WizardDescriptor;
46
47
/**
48
 * UI panel for embedding into the First step of NetBeans module project wizard.
49
 * For using outside of apisupport.project.
50
 * Panel contains UI to select
51
 * <ul>
52
 *  <li>NetBeans Platform (for standalone modules)</li>
53
 *  <li>Module Suite (for suite modules)</li>
54
 * </ul>
55
 * 
56
 * @author akorostelev
57
 */
58
public interface ModuleTypeChooserPanelExt extends ModuleTypeChooserPanel{
59
60
    /*
61
     * keys for properties to be stored/loaded in WizardDescriptor.
62
     * only properties visible to PlatformCustomizerPanel are described here.
63
     * Others (e.g. platform Id with NbPlatform as value) are up to 
64
     * PlatformCustomizerPanel implementation.
65
     */
66
    
67
    /** key for Boolean value. true if project is created in NetBeans sources */
68
    String IS_NETBEANS_ORG                  = "isNetBeansOrg";                  // NOI18N
69
    
70
    /**
71
     * returns java.awt.Component for this panel
72
     * @return
73
     */
74
    Component getComponent();
75
    
76
    /**
77
     * Loads values from provided WizardDescriptor
78
     * @param settings
79
     */
80
    void read(WizardDescriptor settings);
81
    
82
    /**
83
     * Stores values to provided wizard Descriptor
84
     * @param settings
85
     */
86
    void store(WizardDescriptor settings);
87
    
88
    public static class PanelCreator {
89
        public static ModuleTypeChooserPanelExt create(){
90
            return (ModuleTypeChooserPanelExt)new TypeChooserPanelExternalImpl();
91
        }
92
    }
93
    
94
}

Return to bug 142283