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 166780
Collapse All | Expand All

(-)a/ant.freeform/src/org/netbeans/modules/ant/freeform/resources/layer.xml (-4 lines)
Lines 82-91 Link Here
82
                    <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
82
                    <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
83
                    <attr name="position" intvalue="600"/>
83
                    <attr name="position" intvalue="600"/>
84
                </file>
84
                </file>
85
                <file name="org-netbeans-modules-project-ui-SetMainProject.shadow">
86
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-SetMainProject.instance"/>
87
                    <attr name="position" intvalue="700"/>
88
                </file>
89
                <file name="org-netbeans-modules-project-ui-actions-OpenSubprojects.shadow">
85
                <file name="org-netbeans-modules-project-ui-actions-OpenSubprojects.shadow">
90
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-actions-OpenSubprojects.instance"/>
86
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-actions-OpenSubprojects.instance"/>
91
                    <attr name="position" intvalue="800"/>
87
                    <attr name="position" intvalue="800"/>
(-)a/ant.freeform/src/org/netbeans/modules/ant/freeform/ui/BasicProjectInfoPanel.form (-21 / +1 lines)
Lines 1-4 Link Here
1
<?xml version="1.1" encoding="UTF-8" ?>
1
<?xml version="1.0" encoding="UTF-8" ?>
2
2
3
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
3
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <Properties>
4
  <Properties>
Lines 256-281 Link Here
256
        </Constraint>
256
        </Constraint>
257
      </Constraints>
257
      </Constraints>
258
    </Component>
258
    </Component>
259
    <Component class="javax.swing.JCheckBox" name="mainProject">
260
      <Properties>
261
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
262
          <ResourceString bundle="org/netbeans/modules/ant/freeform/ui/Bundle.properties" key="LBL_BasicProjectInfoPanel_mainProject" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
263
        </Property>
264
      </Properties>
265
      <AccessibilityProperties>
266
        <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
267
          <ResourceString bundle="org/netbeans/modules/ant/freeform/ui/Bundle.properties" key="ACSD_BasicProjectInfoPanel_mainProject" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
268
        </Property>
269
      </AccessibilityProperties>
270
      <AuxValues>
271
        <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
272
      </AuxValues>
273
      <Constraints>
274
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
275
          <GridBagConstraints gridX="0" gridY="7" gridWidth="3" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/>
276
        </Constraint>
277
      </Constraints>
278
    </Component>
279
    <Container class="javax.swing.JPanel" name="jPanel2">
259
    <Container class="javax.swing.JPanel" name="jPanel2">
280
      <Properties>
260
      <Properties>
281
        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
261
        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
(-)a/ant.freeform/src/org/netbeans/modules/ant/freeform/ui/BasicProjectInfoPanel.java (-21 lines)
Lines 61-75 Link Here
61
import org.openide.filesystems.FileUtil;
61
import org.openide.filesystems.FileUtil;
62
import org.openide.util.HelpCtx;
62
import org.openide.util.HelpCtx;
63
import org.openide.util.NbBundle;
63
import org.openide.util.NbBundle;
64
import org.openide.util.NbPreferences;
65
64
66
/**
65
/**
67
 * @author  David Konecny
66
 * @author  David Konecny
68
 */
67
 */
69
public class BasicProjectInfoPanel extends javax.swing.JPanel implements HelpCtx.Provider{
68
public class BasicProjectInfoPanel extends javax.swing.JPanel implements HelpCtx.Provider{
70
69
71
    private static final String SET_AS_MAIN_PREF = "setAsMain"; // NOI18N
72
    
73
    private DocumentListener documentListener;
70
    private DocumentListener documentListener;
74
    private ChangeListener listener;
71
    private ChangeListener listener;
75
    /** Was antScript property edited by user? */
72
    /** Was antScript property edited by user? */
Lines 84-90 Link Here
84
    public BasicProjectInfoPanel(String projectLocation, String antScript, String projectName, String projectFolder,
81
    public BasicProjectInfoPanel(String projectLocation, String antScript, String projectName, String projectFolder,
85
            ChangeListener listener) {
82
            ChangeListener listener) {
86
        initComponents();
83
        initComponents();
87
        mainProject.setSelected(NbPreferences.forModule(BasicProjectInfoPanel.class).getBoolean(SET_AS_MAIN_PREF, true));
88
        this.projectLocation.setText(projectLocation);
84
        this.projectLocation.setText(projectLocation);
89
        this.antScript.setText(antScript);
85
        this.antScript.setText(antScript);
90
        this.projectName.setText(projectName);
86
        this.projectName.setText(projectName);
Lines 129-140 Link Here
129
        return getAsFile(projectFolder.getText());
125
        return getAsFile(projectFolder.getText());
130
    }
126
    }
131
127
132
    public boolean getMainProject() {
133
        boolean b = mainProject.isSelected();
134
        NbPreferences.forModule(BasicProjectInfoPanel.class).putBoolean(SET_AS_MAIN_PREF, b);
135
        return b;
136
    }
137
138
    public String[] getError() {
128
    public String[] getError() {
139
        if (projectLocation.getText().length() == 0) {
129
        if (projectLocation.getText().length() == 0) {
140
            return new String[] { org.openide.util.NbBundle.getMessage(BasicProjectInfoPanel.class, "LBL_BasicProjectInfoPanel_Error_1"), WizardDescriptor.PROP_INFO_MESSAGE };  //NOI18N
130
            return new String[] { org.openide.util.NbBundle.getMessage(BasicProjectInfoPanel.class, "LBL_BasicProjectInfoPanel_Error_1"), WizardDescriptor.PROP_INFO_MESSAGE };  //NOI18N
Lines 310-316 Link Here
310
        jLabel6 = new javax.swing.JLabel();
300
        jLabel6 = new javax.swing.JLabel();
311
        browseProjectLocation = new javax.swing.JButton();
301
        browseProjectLocation = new javax.swing.JButton();
312
        jSeparator1 = new javax.swing.JSeparator();
302
        jSeparator1 = new javax.swing.JSeparator();
313
        mainProject = new javax.swing.JCheckBox();
314
        jPanel2 = new javax.swing.JPanel();
303
        jPanel2 = new javax.swing.JPanel();
315
        jLabel7 = new javax.swing.JLabel();
304
        jLabel7 = new javax.swing.JLabel();
316
        jTextArea2 = new javax.swing.JTextArea();
305
        jTextArea2 = new javax.swing.JTextArea();
Lines 452-466 Link Here
452
        gridBagConstraints.insets = new java.awt.Insets(12, 0, 10, 0);
441
        gridBagConstraints.insets = new java.awt.Insets(12, 0, 10, 0);
453
        add(jSeparator1, gridBagConstraints);
442
        add(jSeparator1, gridBagConstraints);
454
443
455
        org.openide.awt.Mnemonics.setLocalizedText(mainProject, org.openide.util.NbBundle.getMessage(BasicProjectInfoPanel.class, "LBL_BasicProjectInfoPanel_mainProject")); // NOI18N
456
        gridBagConstraints = new java.awt.GridBagConstraints();
457
        gridBagConstraints.gridx = 0;
458
        gridBagConstraints.gridy = 7;
459
        gridBagConstraints.gridwidth = 3;
460
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
461
        add(mainProject, gridBagConstraints);
462
        mainProject.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BasicProjectInfoPanel.class, "ACSD_BasicProjectInfoPanel_mainProject")); // NOI18N
463
464
        jPanel2.setBorder(javax.swing.BorderFactory.createLineBorder(javax.swing.UIManager.getDefaults().getColor("Label.disabledForeground")));
444
        jPanel2.setBorder(javax.swing.BorderFactory.createLineBorder(javax.swing.UIManager.getDefaults().getColor("Label.disabledForeground")));
465
        jPanel2.setLayout(new java.awt.GridBagLayout());
445
        jPanel2.setLayout(new java.awt.GridBagLayout());
466
446
Lines 564-570 Link Here
564
    private javax.swing.JPanel jPanel2;
544
    private javax.swing.JPanel jPanel2;
565
    private javax.swing.JSeparator jSeparator1;
545
    private javax.swing.JSeparator jSeparator1;
566
    private javax.swing.JTextArea jTextArea2;
546
    private javax.swing.JTextArea jTextArea2;
567
    private javax.swing.JCheckBox mainProject;
568
    private javax.swing.JTextField projectFolder;
547
    private javax.swing.JTextField projectFolder;
569
    private javax.swing.JTextField projectLocation;
548
    private javax.swing.JTextField projectLocation;
570
    private javax.swing.JTextField projectName;
549
    private javax.swing.JTextField projectName;
(-)a/ant.freeform/src/org/netbeans/modules/ant/freeform/ui/BasicProjectInfoWizardPanel.java (-2 lines)
Lines 48-54 Link Here
48
import javax.swing.event.ChangeEvent;
48
import javax.swing.event.ChangeEvent;
49
import javax.swing.event.ChangeListener;
49
import javax.swing.event.ChangeListener;
50
import org.netbeans.modules.ant.freeform.spi.support.NewFreeformProjectSupport;
50
import org.netbeans.modules.ant.freeform.spi.support.NewFreeformProjectSupport;
51
import org.netbeans.spi.project.ui.templates.support.Templates;
52
import org.openide.WizardDescriptor;
51
import org.openide.WizardDescriptor;
53
import org.openide.util.ChangeSupport;
52
import org.openide.util.ChangeSupport;
54
import org.openide.util.HelpCtx;
53
import org.openide.util.HelpCtx;
Lines 110-116 Link Here
110
        wizardDescriptor.putProperty(NewFreeformProjectSupport.PROP_PROJECT_LOCATION, component.getProjectLocation());
109
        wizardDescriptor.putProperty(NewFreeformProjectSupport.PROP_PROJECT_LOCATION, component.getProjectLocation());
111
        wizardDescriptor.putProperty(NewFreeformProjectSupport.PROP_PROJECT_FOLDER, component.getProjectFolder());
110
        wizardDescriptor.putProperty(NewFreeformProjectSupport.PROP_PROJECT_FOLDER, component.getProjectFolder());
112
        wizardDescriptor.putProperty("NewProjectWizard_Title", null); // NOI18N
111
        wizardDescriptor.putProperty("NewProjectWizard_Title", null); // NOI18N
113
        Templates.setDefinesMainProject(wizardDescriptor, component.getMainProject());
114
    }
112
    }
115
    
113
    
116
    public void stateChanged(ChangeEvent e) {
114
    public void stateChanged(ChangeEvent e) {
(-)a/ant.freeform/src/org/netbeans/modules/ant/freeform/ui/Bundle.properties (-2 lines)
Lines 58-65 Link Here
58
ACSD_BasicProjectInfoPanel_jLabel3=N/A
58
ACSD_BasicProjectInfoPanel_jLabel3=N/A
59
ACSD_BasicProjectInfoPanel_jLabel4=N/A
59
ACSD_BasicProjectInfoPanel_jLabel4=N/A
60
ACSD_BasicProjectInfoPanel_jLabel5=N/A
60
ACSD_BasicProjectInfoPanel_jLabel5=N/A
61
ACSD_BasicProjectInfoPanel_mainProject=N/A
62
LBL_BasicProjectInfoPanel_mainProject=Set as &Main Project
63
LBL_BasicProjectInfoPanel_jLabel5=&Project Folder\:
61
LBL_BasicProjectInfoPanel_jLabel5=&Project Folder\:
64
LBL_BasicProjectInfoPanel_jLabel4=Project &Name\:
62
LBL_BasicProjectInfoPanel_jLabel4=Project &Name\:
65
BTN_BasicProjectInfoPanel_browseProjectLocation=Bro&wse...
63
BTN_BasicProjectInfoPanel_browseProjectLocation=Bro&wse...
(-)a/apisupport.ant/src/org/netbeans/modules/apisupport/project/resources/layer.xml (-8 lines)
Lines 64-73 Link Here
64
                    <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>                 
64
                    <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>                 
65
                    <attr name="position" intvalue="2000"/>
65
                    <attr name="position" intvalue="2000"/>
66
                </file>
66
                </file>
67
                <file name="org-netbeans-modules-project-ui-SetMainProject.shadow">
68
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-SetMainProject.instance"/>
69
                    <attr name="position" intvalue="2100"/>
70
                </file>
71
                <file name="org-netbeans-modules-project-ui-actions-OpenSubprojects.shadow">
67
                <file name="org-netbeans-modules-project-ui-actions-OpenSubprojects.shadow">
72
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-actions-OpenSubprojects.instance"/>
68
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-actions-OpenSubprojects.instance"/>
73
                    <attr name="position" intvalue="2200"/>
69
                    <attr name="position" intvalue="2200"/>
Lines 176-185 Link Here
176
                    <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
172
                    <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
177
                    <attr name="position" intvalue="1500"/>
173
                    <attr name="position" intvalue="1500"/>
178
                </file>
174
                </file>
179
                <file name="org-netbeans-modules-project-ui-SetMainProject.shadow">
180
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-SetMainProject.instance"/>
181
                    <attr name="position" intvalue="1600"/>
182
                </file>
183
                <file name="org-netbeans-modules-project-ui-actions-OpenSubprojects.shadow">
175
                <file name="org-netbeans-modules-project-ui-actions-OpenSubprojects.shadow">
184
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-actions-OpenSubprojects.instance"/>
176
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-actions-OpenSubprojects.instance"/>
185
                    <attr name="position" intvalue="1700"/>
177
                    <attr name="position" intvalue="1700"/>
(-)a/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/ApisupportAntUIUtils.java (-3 lines)
Lines 215-223 Link Here
215
            try {
215
            try {
216
                project = (NbModuleProject) ProjectManager.getDefault().findProject(folder);
216
                project = (NbModuleProject) ProjectManager.getDefault().findProject(folder);
217
                OpenProjects.getDefault().open(new Project[] { project }, false);
217
                OpenProjects.getDefault().open(new Project[] { project }, false);
218
                if (Templates.getDefinesMainProject(wd)) {
219
                    OpenProjects.getDefault().setMainProject(project);
220
                }
221
            } catch (IOException e) {
218
            } catch (IOException e) {
222
                ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e);
219
                ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e);
223
            }
220
            }
(-)a/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/ModuleUISettings.java (-9 lines)
Lines 61-67 Link Here
61
    private static final String LAST_USED_PLATFORM_ID = "lastUsedPlatformID"; // NOI18N
61
    private static final String LAST_USED_PLATFORM_ID = "lastUsedPlatformID"; // NOI18N
62
    private static final String HARNESSES_UPGRADED = "harnessesUpgraded"; // NOI18N
62
    private static final String HARNESSES_UPGRADED = "harnessesUpgraded"; // NOI18N
63
    private static final String LAST_USED_CLUSTER_LOCATION = "lastUsedClusterLocation";    // NOI18N
63
    private static final String LAST_USED_CLUSTER_LOCATION = "lastUsedClusterLocation";    // NOI18N
64
    private static final String SET_AS_MAIN = "setAsMain"; // NOI18N
65
64
66
    public static ModuleUISettings getDefault() {
65
    public static ModuleUISettings getDefault() {
67
        return new ModuleUISettings(); // stateless
66
        return new ModuleUISettings(); // stateless
Lines 139-150 Link Here
139
        prefs().putBoolean(HARNESSES_UPGRADED, b);
138
        prefs().putBoolean(HARNESSES_UPGRADED, b);
140
    }
139
    }
141
140
142
    public boolean getSetAsMain() {
143
        return prefs().getBoolean(SET_AS_MAIN, true);
144
    }
145
146
    public void setSetAsMain(boolean b) {
147
        prefs().putBoolean(SET_AS_MAIN, b);
148
    }
149
150
}
141
}
(-)a/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/wizard/BasicInfoVisualPanel.form (-24 / +1 lines)
Lines 1-4 Link Here
1
<?xml version="1.1" encoding="UTF-8" ?>
1
<?xml version="1.0" encoding="UTF-8" ?>
2
2
3
<Form version="1.2" maxVersion="1.2" 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>
Lines 233-261 Link Here
233
        </Component>
233
        </Component>
234
      </SubComponents>
234
      </SubComponents>
235
    </Container>
235
    </Container>
236
    <Component class="javax.swing.JCheckBox" name="mainProject">
237
      <Properties>
238
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
239
          <ResourceString bundle="org/netbeans/modules/apisupport/project/ui/wizard/Bundle.properties" key="CTL_SetAsMainProject" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
240
        </Property>
241
      </Properties>
242
      <AccessibilityProperties>
243
        <Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
244
          <ResourceString bundle="org/netbeans/modules/apisupport/project/ui/wizard/Bundle.properties" key="ACS_CTL_MainProject" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
245
        </Property>
246
        <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
247
          <ResourceString bundle="org/netbeans/modules/apisupport/project/ui/wizard/Bundle.properties" key="ACS_CTL_MainProject" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
248
        </Property>
249
      </AccessibilityProperties>
250
      <Events>
251
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="mainProjectActionPerformed"/>
252
      </Events>
253
      <Constraints>
254
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
255
          <GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="12" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/>
256
        </Constraint>
257
      </Constraints>
258
    </Component>
259
    <Container class="javax.swing.JPanel" name="pnlThouShaltBeholdLayout">
236
    <Container class="javax.swing.JPanel" name="pnlThouShaltBeholdLayout">
260
      <Constraints>
237
      <Constraints>
261
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
238
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
(-)a/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/wizard/BasicInfoVisualPanel.java (-45 / +1 lines)
Lines 91-97 Link Here
91
    
91
    
92
    private boolean locationUpdated;
92
    private boolean locationUpdated;
93
    private boolean nameUpdated;
93
    private boolean nameUpdated;
94
    private boolean mainProjectTouched;
95
    
94
    
96
    /** Creates new form BasicInfoVisualPanel */
95
    /** Creates new form BasicInfoVisualPanel */
97
    BasicInfoVisualPanel(final NewModuleProjectData data) {
96
    BasicInfoVisualPanel(final NewModuleProjectData data) {
Lines 101-121 Link Here
101
        initPlatformCombo(suitePlatformValue);
100
        initPlatformCombo(suitePlatformValue);
102
        initPanels();
101
        initPanels();
103
        setComponentsVisibility();
102
        setComponentsVisibility();
104
        mainProject.setSelected(!isLibraryWizard() && ModuleUISettings.getDefault().getSetAsMain());
105
        switch (data.getWizardType()) {
106
            case SUITE:
107
            case APPLICATION:
108
            case LIBRARY_MODULE:
109
                break;
110
            case MODULE:
111
            case SUITE_COMPONENT:
112
                if (TypeChooserPanelImpl.getDefaultSuitesComboBox().getItemCount() > 0) {
113
                    mainProject.setSelected(false);
114
                }
115
                break;
116
            default:
117
                assert false : "Unknown wizard type = " + data.getWizardType();
118
        }
119
        attachDocumentListeners();
103
        attachDocumentListeners();
120
        setInitialLocation();
104
        setInitialLocation();
121
        setInitialProjectName();
105
        setInitialProjectName();
Lines 162-170 Link Here
162
                    return;
146
                    return;
163
                }
147
                }
164
148
165
                if (!mainProjectTouched) {
166
                    mainProject.setSelected(isStandAlone);
167
                }
168
                if (!locationUpdated) {
149
                if (!locationUpdated) {
169
                    setInitialLocation();
150
                    setInitialLocation();
170
                }
151
                }
Lines 212-218 Link Here
212
        suitePlatform.setVisible(isSuiteWizard);
193
        suitePlatform.setVisible(isSuiteWizard);
213
        suitePlatformValue.setVisible(isSuiteWizard);
194
        suitePlatformValue.setVisible(isSuiteWizard);
214
        manageSuitePlatform.setVisible(isSuiteWizard);
195
        manageSuitePlatform.setVisible(isSuiteWizard);
215
        mainProject.setVisible(!isLibraryWizard);
216
        
196
        
217
        if (typeChooserPanel != null){
197
        if (typeChooserPanel != null){
218
            typeChooserPanel.setComponentsVisibility(isSuiteComponentWizard, isLibraryWizard);
198
            typeChooserPanel.setComponentsVisibility(isSuiteComponentWizard, isLibraryWizard);
Lines 304-311 Link Here
304
        getData().setProjectName(getNameValue());
284
        getData().setProjectName(getNameValue());
305
        getData().setProjectLocation(getLocationValue());
285
        getData().setProjectLocation(getLocationValue());
306
        getData().setProjectFolder(folderValue.getText());
286
        getData().setProjectFolder(folderValue.getText());
307
        getData().setMainProject(mainProject.isSelected());
308
        ModuleUISettings.getDefault().setSetAsMain(mainProject.isSelected());
309
        getData().setNetBeansOrg(isNetBeansOrgFolder());
287
        getData().setNetBeansOrg(isNetBeansOrgFolder());
310
        getData().setStandalone(ModuleTypePanel.isStandalone(getSettings()));
288
        getData().setStandalone(ModuleTypePanel.isStandalone(getSettings()));
311
        getData().setSuiteRoot(ModuleTypePanel.getSuiteRoot(getSettings()));
289
        getData().setSuiteRoot(ModuleTypePanel.getSuiteRoot(getSettings()));
Lines 432-438 Link Here
432
        suitePlatformValue = PlatformComponentFactory.getNbPlatformsComboxBox();
410
        suitePlatformValue = PlatformComponentFactory.getNbPlatformsComboxBox();
433
        manageSuitePlatform = new javax.swing.JButton();
411
        manageSuitePlatform = new javax.swing.JButton();
434
        separator3 = new javax.swing.JSeparator();
412
        separator3 = new javax.swing.JSeparator();
435
        mainProject = new javax.swing.JCheckBox();
436
        pnlThouShaltBeholdLayout = new javax.swing.JPanel();
413
        pnlThouShaltBeholdLayout = new javax.swing.JPanel();
437
        typeChooserPanelContainer = new javax.swing.JPanel();
414
        typeChooserPanelContainer = new javax.swing.JPanel();
438
415
Lines 569-590 Link Here
569
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
546
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
570
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
547
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
571
        add(infoPanel, gridBagConstraints);
548
        add(infoPanel, gridBagConstraints);
572
573
        org.openide.awt.Mnemonics.setLocalizedText(mainProject, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "CTL_SetAsMainProject")); // NOI18N
574
        mainProject.addActionListener(new java.awt.event.ActionListener() {
575
            public void actionPerformed(java.awt.event.ActionEvent evt) {
576
                mainProjectActionPerformed(evt);
577
            }
578
        });
579
        gridBagConstraints = new java.awt.GridBagConstraints();
580
        gridBagConstraints.gridx = 0;
581
        gridBagConstraints.gridy = 2;
582
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
583
        gridBagConstraints.insets = new java.awt.Insets(12, 0, 0, 0);
584
        add(mainProject, gridBagConstraints);
585
        mainProject.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "ACS_CTL_MainProject")); // NOI18N
586
        mainProject.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "ACS_CTL_MainProject")); // NOI18N
587
588
        gridBagConstraints = new java.awt.GridBagConstraints();
549
        gridBagConstraints = new java.awt.GridBagConstraints();
589
        gridBagConstraints.gridx = 0;
550
        gridBagConstraints.gridx = 0;
590
        gridBagConstraints.gridy = 3;
551
        gridBagConstraints.gridy = 3;
Lines 608-618 Link Here
608
    private void manageSuitePlatformActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_manageSuitePlatformActionPerformed
569
    private void manageSuitePlatformActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_manageSuitePlatformActionPerformed
609
        managePlatform(suitePlatformValue);
570
        managePlatform(suitePlatformValue);
610
    }//GEN-LAST:event_manageSuitePlatformActionPerformed
571
    }//GEN-LAST:event_manageSuitePlatformActionPerformed
611
    
572
            
612
    private void mainProjectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mainProjectActionPerformed
613
        mainProjectTouched = true;
614
    }//GEN-LAST:event_mainProjectActionPerformed
615
        
616
    private void managePlatform(final JComboBox platformCombo) {
573
    private void managePlatform(final JComboBox platformCombo) {
617
        NbPlatformCustomizer.showCustomizer();
574
        NbPlatformCustomizer.showCustomizer();
618
        platformCombo.setModel(new PlatformComponentFactory.NbPlatformListModel()); // refresh
575
        platformCombo.setModel(new PlatformComponentFactory.NbPlatformListModel()); // refresh
Lines 637-643 Link Here
637
    private javax.swing.JPanel infoPanel;
594
    private javax.swing.JPanel infoPanel;
638
    private javax.swing.JLabel locationLbl;
595
    private javax.swing.JLabel locationLbl;
639
    private javax.swing.JTextField locationValue;
596
    private javax.swing.JTextField locationValue;
640
    private javax.swing.JCheckBox mainProject;
641
    private javax.swing.JButton manageSuitePlatform;
597
    private javax.swing.JButton manageSuitePlatform;
642
    private javax.swing.ButtonGroup moduleTypeGroup;
598
    private javax.swing.ButtonGroup moduleTypeGroup;
643
    private javax.swing.JLabel nameLbl;
599
    private javax.swing.JLabel nameLbl;
(-)a/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/wizard/Bundle.properties (-2 lines)
Lines 51-57 Link Here
51
CTL_AddToModuleSuite=&Add to Module Suite
51
CTL_AddToModuleSuite=&Add to Module Suite
52
CTL_ManagePlatforms=&Manage...
52
CTL_ManagePlatforms=&Manage...
53
CTL_ManagePlatforms_g=Mana&ge...
53
CTL_ManagePlatforms_g=Mana&ge...
54
CTL_SetAsMainProject=Set as &Main Project
55
CTL_StandaloneModule=S&tandalone Module
54
CTL_StandaloneModule=S&tandalone Module
56
LBL_Add_to_Suite=Add to Module Suite:
55
LBL_Add_to_Suite=Add to Module Suite:
57
LBL_BasicInfoPanel_Title=Name and Location
56
LBL_BasicInfoPanel_Title=Name and Location
Lines 83-89 Link Here
83
ACS_CTL_BrowseSuiteButton=Browse Suite
82
ACS_CTL_BrowseSuiteButton=Browse Suite
84
ACS_CTL_FolderValue=Project Folder
83
ACS_CTL_FolderValue=Project Folder
85
ACS_CTL_LocationValue=Project Location
84
ACS_CTL_LocationValue=Project Location
86
ACS_CTL_MainProject=Set as Main Project
87
ACS_CTL_ManagePlatform=Manage platform
85
ACS_CTL_ManagePlatform=Manage platform
88
ACS_CTL_ManageSuitePlatform=Manage suite platform
86
ACS_CTL_ManageSuitePlatform=Manage suite platform
89
ACS_CTL_ModuleSuiteValue=Module Suite
87
ACS_CTL_ModuleSuiteValue=Module Suite
(-)a/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/wizard/NewModuleProjectData.java (-9 lines)
Lines 65-71 Link Here
65
    private String projectLocation;
65
    private String projectLocation;
66
    private String projectFolder;
66
    private String projectFolder;
67
    private String suiteRoot;
67
    private String suiteRoot;
68
    private boolean mainProject;
69
    private String codeNameBase;
68
    private String codeNameBase;
70
    private String platformID;
69
    private String platformID;
71
    private String bundle;
70
    private String bundle;
Lines 149-162 Link Here
149
        this.suiteRoot = suiteRoot;
148
        this.suiteRoot = suiteRoot;
150
    }
149
    }
151
    
150
    
152
    protected boolean isMainProject() {
153
        return mainProject;
154
    }
155
    
156
    protected void setMainProject(boolean mainProject) {
157
        this.mainProject = mainProject;
158
    }
159
    
160
    String getCodeNameBase() {
151
    String getCodeNameBase() {
161
        return codeNameBase;
152
        return codeNameBase;
162
    }
153
    }
(-)a/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/wizard/NewNbModuleWizardIterator.java (-3 lines)
Lines 63-69 Link Here
63
import org.netbeans.modules.apisupport.project.ui.ModuleUISettings;
63
import org.netbeans.modules.apisupport.project.ui.ModuleUISettings;
64
import org.netbeans.modules.apisupport.project.ui.ApisupportAntUIUtils;
64
import org.netbeans.modules.apisupport.project.ui.ApisupportAntUIUtils;
65
import org.netbeans.modules.apisupport.project.ui.customizer.SuiteUtils;
65
import org.netbeans.modules.apisupport.project.ui.customizer.SuiteUtils;
66
import org.netbeans.spi.project.ui.templates.support.Templates;
67
import org.openide.WizardDescriptor;
66
import org.openide.WizardDescriptor;
68
import org.openide.filesystems.FileObject;
67
import org.openide.filesystems.FileObject;
69
import org.openide.filesystems.FileUtil;
68
import org.openide.filesystems.FileUtil;
Lines 247-254 Link Here
247
            ApisupportAntUIUtils.setProjectChooserDirParent(projectFolder);
246
            ApisupportAntUIUtils.setProjectChooserDirParent(projectFolder);
248
        }
247
        }
249
248
250
        Templates.setDefinesMainProject(settings, data.isMainProject());
251
        
252
        return resultSet;
249
        return resultSet;
253
    }
250
    }
254
    
251
    
(-)a/cnd.discovery/src/org/netbeans/modules/cnd/discovery/projectimport/ImportExecutable.java (-1 lines)
Lines 226-232 Link Here
226
            map.put("DW:consolidationLevel", ConsolidationStrategy.FILE_LEVEL); // NOI18N
226
            map.put("DW:consolidationLevel", ConsolidationStrategy.FILE_LEVEL); // NOI18N
227
            map.put("DW:rootFolder", lastSelectedProject.getProjectDirectory().getPath()); // NOI18N
227
            map.put("DW:rootFolder", lastSelectedProject.getProjectDirectory().getPath()); // NOI18N
228
            OpenProjects.getDefault().open(new Project[]{lastSelectedProject}, false);
228
            OpenProjects.getDefault().open(new Project[]{lastSelectedProject}, false);
229
            OpenProjects.getDefault().setMainProject(lastSelectedProject);
230
        } catch (IOException ex) {
229
        } catch (IOException ex) {
231
            Exceptions.printStackTrace(ex);
230
            Exceptions.printStackTrace(ex);
232
        }
231
        }
(-)a/cnd.discovery/src/org/netbeans/modules/cnd/discovery/projectimport/ImportProject.java (-9 lines)
Lines 164-170 Link Here
164
    private boolean runConfigure = false;
164
    private boolean runConfigure = false;
165
    private boolean manualCA = false;
165
    private boolean manualCA = false;
166
    private boolean buildArifactWasAnalyzed = false;
166
    private boolean buildArifactWasAnalyzed = false;
167
    private boolean setAsMain;
168
    private final String hostUID;
167
    private final String hostUID;
169
    private final ExecutionEnvironment executionEnvironment;
168
    private final ExecutionEnvironment executionEnvironment;
170
    private final ExecutionEnvironment fileSystemExecutionEnvironment;
169
    private final ExecutionEnvironment fileSystemExecutionEnvironment;
Lines 226-232 Link Here
226
            makefilePath = (String) wizard.getProperty(WizardConstants.PROPERTY_USER_MAKEFILE_PATH); 
225
            makefilePath = (String) wizard.getProperty(WizardConstants.PROPERTY_USER_MAKEFILE_PATH); 
227
        }
226
        }
228
        runMake = Boolean.TRUE.equals(wizard.getProperty("buildProject"));  // NOI18N
227
        runMake = Boolean.TRUE.equals(wizard.getProperty("buildProject"));  // NOI18N
229
        setAsMain = Boolean.TRUE.equals(wizard.getProperty("setMain"));  // NOI18N
230
        toolchain = (CompilerSet)wizard.getProperty(WizardConstants.PROPERTY_TOOLCHAIN);
228
        toolchain = (CompilerSet)wizard.getProperty(WizardConstants.PROPERTY_TOOLCHAIN);
231
        defaultToolchain = Boolean.TRUE.equals(wizard.getProperty(WizardConstants.PROPERTY_TOOLCHAIN_DEFAULT));
229
        defaultToolchain = Boolean.TRUE.equals(wizard.getProperty(WizardConstants.PROPERTY_TOOLCHAIN_DEFAULT));
232
        
230
        
Lines 279-285 Link Here
279
            runMake = "true".equals(wizard.getProperty(WizardConstants.PROPERTY_RUN_REBUILD)); // NOI18N
277
            runMake = "true".equals(wizard.getProperty(WizardConstants.PROPERTY_RUN_REBUILD)); // NOI18N
280
        }
278
        }
281
        manualCA = "true".equals(wizard.getProperty(WizardConstants.PROPERTY_MANUAL_CODE_ASSISTANCE)); // NOI18N
279
        manualCA = "true".equals(wizard.getProperty(WizardConstants.PROPERTY_MANUAL_CODE_ASSISTANCE)); // NOI18N
282
        setAsMain = Boolean.TRUE.equals(wizard.getProperty(WizardConstants.PROPERTY_SET_AS_MAIN));
283
        toolchain = (CompilerSet)wizard.getProperty(WizardConstants.PROPERTY_TOOLCHAIN);
280
        toolchain = (CompilerSet)wizard.getProperty(WizardConstants.PROPERTY_TOOLCHAIN);
284
        defaultToolchain = Boolean.TRUE.equals(wizard.getProperty(WizardConstants.PROPERTY_TOOLCHAIN_DEFAULT));
281
        defaultToolchain = Boolean.TRUE.equals(wizard.getProperty(WizardConstants.PROPERTY_TOOLCHAIN_DEFAULT));
285
    }
282
    }
Lines 386-394 Link Here
386
                    return;
383
                    return;
387
                }
384
                }
388
                OpenProjects.getDefault().removePropertyChangeListener(this);
385
                OpenProjects.getDefault().removePropertyChangeListener(this);
389
                //if (setAsMain) {
390
                //    OpenProjects.getDefault().setMainProject(makeProject);
391
                //}
392
                RP.post(new Runnable() {
386
                RP.post(new Runnable() {
393
387
394
                    @Override
388
                    @Override
Lines 412-420 Link Here
412
    private void doWork() {
406
    private void doWork() {
413
        try {
407
        try {
414
            //OpenProjects.getDefault().open(new Project[]{makeProject}, false);
408
            //OpenProjects.getDefault().open(new Project[]{makeProject}, false);
415
            //if (setAsMain) {
416
            //    OpenProjects.getDefault().setMainProject(makeProject);
417
            //}
418
            if (makeProject instanceof Runnable) {
409
            if (makeProject instanceof Runnable) {
419
                ((Runnable)makeProject).run();
410
                ((Runnable)makeProject).run();
420
            }
411
            }
(-)a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/MakeProjectGeneratorImpl.java (-1 lines)
Lines 165-171 Link Here
165
165
166
        if (prjParams.getOpenFlag()) {
166
        if (prjParams.getOpenFlag()) {
167
            OpenProjects.getDefault().open(new Project[]{p}, false);
167
            OpenProjects.getDefault().open(new Project[]{p}, false);
168
            OpenProjects.getDefault().setMainProject(p);
169
        }
168
        }
170
169
171
        return p;
170
        return p;
(-)a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/RunDialogPanel.java (-2 lines)
Lines 1019-1025 Link Here
1019
        lastSelectedProject = project;
1019
        lastSelectedProject = project;
1020
        OpenProjects.getDefault().addPropertyChangeListener(this);
1020
        OpenProjects.getDefault().addPropertyChangeListener(this);
1021
        OpenProjects.getDefault().open(new Project[]{project}, false);
1021
        OpenProjects.getDefault().open(new Project[]{project}, false);
1022
        OpenProjects.getDefault().setMainProject(project);
1023
        return project;
1022
        return project;
1024
    }
1023
    }
1025
1024
Lines 1085-1091 Link Here
1085
        }
1084
        }
1086
        OpenProjects.getDefault().addPropertyChangeListener(this);
1085
        OpenProjects.getDefault().addPropertyChangeListener(this);
1087
        OpenProjects.getDefault().open(new Project[]{project}, false);
1086
        OpenProjects.getDefault().open(new Project[]{project}, false);
1088
        OpenProjects.getDefault().setMainProject(project);
1089
        return project;
1087
        return project;
1090
    }
1088
    }
1091
1089
(-)a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/wizards/WizardConstants.java (-1 lines)
Lines 60-66 Link Here
60
    public static final String PROPERTY_NAME = "name"; // String // NOI18N
60
    public static final String PROPERTY_NAME = "name"; // String // NOI18N
61
    public static final String MAIN_CLASS = "mainClass"; // String // NOI18N
61
    public static final String MAIN_CLASS = "mainClass"; // String // NOI18N
62
    public static final String PROPERTY_PROJECT_FOLDER = "projdir"; // File // NOI18N
62
    public static final String PROPERTY_PROJECT_FOLDER = "projdir"; // File // NOI18N
63
    public static final String PROPERTY_SET_AS_MAIN = "setAsMain"; // Boolean // NOI18N
64
    public static final String PROPERTY_SIMPLE_MODE = "simpleMode"; // Boolean // NOI18N
63
    public static final String PROPERTY_SIMPLE_MODE = "simpleMode"; // Boolean // NOI18N
65
    public static final String PROPERTY_FULL_REMOTE = "fullRemote"; // Boolean // NOI18N
64
    public static final String PROPERTY_FULL_REMOTE = "fullRemote"; // Boolean // NOI18N
66
    public static final String PROPERTY_HOST_UID = "hostUID"; // String // NOI18N
65
    public static final String PROPERTY_HOST_UID = "hostUID"; // String // NOI18N
(-)a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/MakeLogicalViewRootNode.java (-2 lines)
Lines 557-563 Link Here
557
            ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_TEST, bundle.getString("LBL_TestAction_Name"), null),
557
            ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_TEST, bundle.getString("LBL_TestAction_Name"), null),
558
            //SystemAction.get(RunTestAction.class),
558
            //SystemAction.get(RunTestAction.class),
559
            null,
559
            null,
560
            CommonProjectActions.setAsMainProjectAction(),
561
            CommonProjectActions.openSubprojectsAction(),
560
            CommonProjectActions.openSubprojectsAction(),
562
            CommonProjectActions.closeProjectAction(),
561
            CommonProjectActions.closeProjectAction(),
563
            null,
562
            null,
Lines 596-602 Link Here
596
            ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_DEBUG, bundle.getString("LBL_DebugAction_Name"), null),
595
            ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_DEBUG, bundle.getString("LBL_DebugAction_Name"), null),
597
            ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_DEBUG_STEP_INTO, bundle.getString("LBL_DebugAction_Step_Name"), null),
596
            ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_DEBUG_STEP_INTO, bundle.getString("LBL_DebugAction_Step_Name"), null),
598
            null,
597
            null,
599
            CommonProjectActions.setAsMainProjectAction(),
600
            CommonProjectActions.openSubprojectsAction(),
598
            CommonProjectActions.openSubprojectsAction(),
601
            CommonProjectActions.closeProjectAction(),
599
            CommonProjectActions.closeProjectAction(),
602
            null,
600
            null,
(-)a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/wizards/Bundle.properties (-4 lines)
Lines 123-131 Link Here
123
# PanelConfigureProjectVisual
123
# PanelConfigureProjectVisual
124
TXT_NameAndLoc=Project Name and Location
124
TXT_NameAndLoc=Project Name and Location
125
125
126
LBL_setAsMainCheckBox=Set as &Main Project
127
ACSN_setAsMainCheckBox=Set as Main Project
128
ACSD_setAsMainCheckBox=N/A
129
LBL_CreateMainFile=Create Main File
126
LBL_CreateMainFile=Create Main File
130
ACSN_jPanel1=N/A
127
ACSN_jPanel1=N/A
131
ASCD_jPanel1=N/A
128
ASCD_jPanel1=N/A
Lines 371-377 Link Here
371
SOURCES_DIR_BUTTON_TXT=Select
368
SOURCES_DIR_BUTTON_TXT=Select
372
ImportProjectPanel.configureFlags.text=
369
ImportProjectPanel.configureFlags.text=
373
ImportProjectPanel.browseButton.text=Bro&wse...
370
ImportProjectPanel.browseButton.text=Bro&wse...
374
ImportProjectPanel.setMainProjectCheckBox.text=Set as &Main Project
375
ImportProjectPanel.buildProjectCheckBox.text=&Build Project
371
ImportProjectPanel.buildProjectCheckBox.text=&Build Project
376
LBL_createMainfile=Create Main F&ile
372
LBL_createMainfile=Create Main F&ile
377
373
(-)a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/wizards/PanelProjectLocationVisual.form (-17 / +1 lines)
Lines 1-4 Link Here
1
<?xml version="1.1" encoding="UTF-8" ?>
1
<?xml version="1.0" encoding="UTF-8" ?>
2
2
3
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
3
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <Properties>
4
  <Properties>
Lines 226-247 Link Here
226
        </Constraint>
226
        </Constraint>
227
      </Constraints>
227
      </Constraints>
228
    </Component>
228
    </Component>
229
    <Component class="javax.swing.JCheckBox" name="setAsMainCheckBox">
230
      <Properties>
231
        <Property name="selected" type="boolean" value="true"/>
232
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
233
          <ResourceString bundle="org/netbeans/modules/cnd/makeproject/ui/wizards/Bundle.properties" key="LBL_setAsMainCheckBox" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
234
        </Property>
235
      </Properties>
236
      <AuxValues>
237
        <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
238
      </AuxValues>
239
      <Constraints>
240
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
241
          <GridBagConstraints gridX="0" gridY="7" gridWidth="0" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="4" insetsRight="0" anchor="18" weightX="0.0" weightY="1.0"/>
242
        </Constraint>
243
      </Constraints>
244
    </Component>
245
    <Component class="javax.swing.JLabel" name="hostLabel">
229
    <Component class="javax.swing.JLabel" name="hostLabel">
246
      <Properties>
230
      <Properties>
247
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
231
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
(-)a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/wizards/PanelProjectLocationVisual.java (-18 lines)
Lines 116-123 Link Here
116
        // Accessibility
116
        // Accessibility
117
        makefileTextField.getAccessibleContext().setAccessibleDescription(getString("AD_MAKEFILE"));
117
        makefileTextField.getAccessibleContext().setAccessibleDescription(getString("AD_MAKEFILE"));
118
118
119
        setAsMainCheckBox.setVisible(true);
120
121
        createMainTextField.setText("main"); // NOI18N
119
        createMainTextField.setText("main"); // NOI18N
122
        createMainTextField.getDocument().addDocumentListener(PanelProjectLocationVisual.this);
120
        createMainTextField.getDocument().addDocumentListener(PanelProjectLocationVisual.this);
123
121
Lines 258-264 Link Here
258
        createMainCheckBox = new javax.swing.JCheckBox();
256
        createMainCheckBox = new javax.swing.JCheckBox();
259
        createMainTextField = new javax.swing.JTextField();
257
        createMainTextField = new javax.swing.JTextField();
260
        createMainComboBox = new javax.swing.JComboBox();
258
        createMainComboBox = new javax.swing.JComboBox();
261
        setAsMainCheckBox = new javax.swing.JCheckBox();
262
        hostLabel = new javax.swing.JLabel();
259
        hostLabel = new javax.swing.JLabel();
263
        toolchainLabel = new javax.swing.JLabel();
260
        toolchainLabel = new javax.swing.JLabel();
264
        hostComboBox = new javax.swing.JComboBox();
261
        hostComboBox = new javax.swing.JComboBox();
Lines 359-365 Link Here
359
356
360
        createMainCheckBox.setSelected(true);
357
        createMainCheckBox.setSelected(true);
361
        org.openide.awt.Mnemonics.setLocalizedText(createMainCheckBox, bundle.getString("LBL_createMainfile")); // NOI18N
358
        org.openide.awt.Mnemonics.setLocalizedText(createMainCheckBox, bundle.getString("LBL_createMainfile")); // NOI18N
362
        createMainCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
363
        createMainCheckBox.addActionListener(new java.awt.event.ActionListener() {
359
        createMainCheckBox.addActionListener(new java.awt.event.ActionListener() {
364
            public void actionPerformed(java.awt.event.ActionEvent evt) {
360
            public void actionPerformed(java.awt.event.ActionEvent evt) {
365
                createMainCheckBoxActionPerformed(evt);
361
                createMainCheckBoxActionPerformed(evt);
Lines 388-405 Link Here
388
        gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
384
        gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
389
        add(createMainComboBox, gridBagConstraints);
385
        add(createMainComboBox, gridBagConstraints);
390
386
391
        setAsMainCheckBox.setSelected(true);
392
        org.openide.awt.Mnemonics.setLocalizedText(setAsMainCheckBox, bundle.getString("LBL_setAsMainCheckBox")); // NOI18N
393
        setAsMainCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
394
        gridBagConstraints = new java.awt.GridBagConstraints();
395
        gridBagConstraints.gridx = 0;
396
        gridBagConstraints.gridy = 7;
397
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
398
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
399
        gridBagConstraints.weighty = 1.0;
400
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 4, 0);
401
        add(setAsMainCheckBox, gridBagConstraints);
402
403
        hostLabel.setLabelFor(hostComboBox);
387
        hostLabel.setLabelFor(hostComboBox);
404
        org.openide.awt.Mnemonics.setLocalizedText(hostLabel, org.openide.util.NbBundle.getMessage(PanelProjectLocationVisual.class, "LBL_HOST")); // NOI18N
388
        org.openide.awt.Mnemonics.setLocalizedText(hostLabel, org.openide.util.NbBundle.getMessage(PanelProjectLocationVisual.class, "LBL_HOST")); // NOI18N
405
        gridBagConstraints = new java.awt.GridBagConstraints();
389
        gridBagConstraints = new java.awt.GridBagConstraints();
Lines 654-660 Link Here
654
            }
638
            }
655
        }
639
        }
656
640
657
        d.putProperty(WizardConstants.PROPERTY_SET_AS_MAIN, setAsMainCheckBox.isSelected() && setAsMainCheckBox.isVisible() ? Boolean.TRUE : Boolean.FALSE);
658
        d.putProperty(WizardConstants.MAIN_CLASS, null); // NOI18N
641
        d.putProperty(WizardConstants.MAIN_CLASS, null); // NOI18N
659
642
660
        MIMEExtensions cExtensions = MIMEExtensions.get(MIMENames.C_MIME_TYPE);
643
        MIMEExtensions cExtensions = MIMEExtensions.get(MIMENames.C_MIME_TYPE);
Lines 770-776 Link Here
770
    private javax.swing.JTextField projectLocationTextField;
753
    private javax.swing.JTextField projectLocationTextField;
771
    private javax.swing.JLabel projectNameLabel;
754
    private javax.swing.JLabel projectNameLabel;
772
    private javax.swing.JTextField projectNameTextField;
755
    private javax.swing.JTextField projectNameTextField;
773
    private javax.swing.JCheckBox setAsMainCheckBox;
774
    private javax.swing.JComboBox toolchainComboBox;
756
    private javax.swing.JComboBox toolchainComboBox;
775
    private javax.swing.JLabel toolchainLabel;
757
    private javax.swing.JLabel toolchainLabel;
776
    // End of variables declaration//GEN-END:variables
758
    // End of variables declaration//GEN-END:variables
(-)a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/wizards/SelectModePanel.java (-1 lines)
Lines 480-486 Link Here
480
    void store(WizardDescriptor wizardDescriptor) {
480
    void store(WizardDescriptor wizardDescriptor) {
481
        if (simpleMode.isSelected()) {
481
        if (simpleMode.isSelected()) {
482
            wizardDescriptor.putProperty(WizardConstants.PROPERTY_SIMPLE_MODE, Boolean.TRUE);
482
            wizardDescriptor.putProperty(WizardConstants.PROPERTY_SIMPLE_MODE, Boolean.TRUE);
483
            wizardDescriptor.putProperty(WizardConstants.PROPERTY_SET_AS_MAIN,  Boolean.TRUE);
484
        } else {
483
        } else {
485
            wizardDescriptor.putProperty(WizardConstants.PROPERTY_SIMPLE_MODE, Boolean.FALSE);
484
            wizardDescriptor.putProperty(WizardConstants.PROPERTY_SIMPLE_MODE, Boolean.FALSE);
486
        }
485
        }
(-)a/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/ui/GrailsLogicalViewProvider.java (-1 lines)
Lines 160-166 Link Here
160
            actions.add(ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_TEST,
160
            actions.add(ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_TEST,
161
                    NbBundle.getMessage(GrailsLogicalViewProvider.class, "LBL_TestAction_Name"), null));
161
                    NbBundle.getMessage(GrailsLogicalViewProvider.class, "LBL_TestAction_Name"), null));
162
            actions.add(null);
162
            actions.add(null);
163
            actions.add(CommonProjectActions.setAsMainProjectAction());
164
            actions.add(CommonProjectActions.closeProjectAction());
163
            actions.add(CommonProjectActions.closeProjectAction());
165
            actions.add(null);
164
            actions.add(null);
166
            actions.add(SystemAction.get(FindAction.class));
165
            actions.add(SystemAction.get(FindAction.class));
(-)a/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/ui/wizards/Bundle.properties (-2 lines)
Lines 74-80 Link Here
74
GetProjectLocationPanel.projectNameTextField.AccessibleContext.accessibleDescription=Project Name
74
GetProjectLocationPanel.projectNameTextField.AccessibleContext.accessibleDescription=Project Name
75
GetProjectLocationPanel.projectFolderTextField.AccessibleContext.accessibleDescription=Project Folder
75
GetProjectLocationPanel.projectFolderTextField.AccessibleContext.accessibleDescription=Project Folder
76
GetProjectLocationPanel.browseLocationJButton.AccessibleContext.accessibleDescription=Browse Project Location
76
GetProjectLocationPanel.browseLocationJButton.AccessibleContext.accessibleDescription=Browse Project Location
77
GetProjectLocationPanel.setAsMainCheckBox.AccessibleContext.accessibleDescription=Set as Main Project
78
GetProjectLocationPanel.AccessibleContext.accessibleDescription=New Project Location
77
GetProjectLocationPanel.AccessibleContext.accessibleDescription=New Project Location
79
GetProjectLocationPanel.projectLocationTextField.AccessibleContext.accessibleDescription=Project Location
78
GetProjectLocationPanel.projectLocationTextField.AccessibleContext.accessibleDescription=Project Location
80
GetArtifactNamePanel.projectTextField.AccessibleContext.accessibleDescription=Project
79
GetArtifactNamePanel.projectTextField.AccessibleContext.accessibleDescription=Project
Lines 112-115 Link Here
112
ACSN_optionsContainer=N/A
111
ACSN_optionsContainer=N/A
113
ACSD_optionsContainer=N/A
112
ACSD_optionsContainer=N/A
114
PanelOptionsVisual.configureButton.text=Configure &Grails...
113
PanelOptionsVisual.configureButton.text=Configure &Grails...
115
PanelOptionsVisual.setAsMainCheckBox.text=Set as &Main Project
(-)a/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/ui/wizards/PanelOptionsVisual.form (-19 / +3 lines)
Lines 1-4 Link Here
1
<?xml version="1.1" encoding="UTF-8" ?>
1
<?xml version="1.0" encoding="UTF-8" ?>
2
2
3
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
3
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <AuxValues>
4
  <AuxValues>
Lines 17-26 Link Here
17
    <DimensionLayout dim="0">
17
    <DimensionLayout dim="0">
18
      <Group type="103" groupAlignment="0" attributes="0">
18
      <Group type="103" groupAlignment="0" attributes="0">
19
          <Group type="102" attributes="0">
19
          <Group type="102" attributes="0">
20
              <Group type="103" groupAlignment="0" attributes="0">
20
              <Component id="configureButton" min="-2" max="-2" attributes="0"/>
21
                  <Component id="configureButton" alignment="0" min="-2" max="-2" attributes="0"/>
22
                  <Component id="setAsMainCheckBox" alignment="0" min="-2" max="-2" attributes="0"/>
23
              </Group>
24
              <EmptySpace pref="246" max="32767" attributes="0"/>
21
              <EmptySpace pref="246" max="32767" attributes="0"/>
25
          </Group>
22
          </Group>
26
      </Group>
23
      </Group>
Lines 29-37 Link Here
29
      <Group type="103" groupAlignment="0" attributes="0">
26
      <Group type="103" groupAlignment="0" attributes="0">
30
          <Group type="102" alignment="0" attributes="0">
27
          <Group type="102" alignment="0" attributes="0">
31
              <Component id="configureButton" min="-2" max="-2" attributes="0"/>
28
              <Component id="configureButton" min="-2" max="-2" attributes="0"/>
32
              <EmptySpace type="unrelated" max="-2" attributes="0"/>
29
              <EmptySpace pref="75" max="32767" attributes="0"/>
33
              <Component id="setAsMainCheckBox" min="-2" max="-2" attributes="0"/>
34
              <EmptySpace pref="44" max="32767" attributes="0"/>
35
          </Group>
30
          </Group>
36
      </Group>
31
      </Group>
37
    </DimensionLayout>
32
    </DimensionLayout>
Lines 50-65 Link Here
50
        <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
45
        <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
51
      </AuxValues>
46
      </AuxValues>
52
    </Component>
47
    </Component>
53
    <Component class="javax.swing.JCheckBox" name="setAsMainCheckBox">
54
      <Properties>
55
        <Property name="selected" type="boolean" value="true"/>
56
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
57
          <ResourceString bundle="org/netbeans/modules/groovy/grailsproject/ui/wizards/Bundle.properties" key="PanelOptionsVisual.setAsMainCheckBox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
58
        </Property>
59
      </Properties>
60
      <AuxValues>
61
        <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
62
      </AuxValues>
63
    </Component>
64
  </SubComponents>
48
  </SubComponents>
65
</Form>
49
</Form>
(-)a/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/ui/wizards/PanelOptionsVisual.java (-13 / +2 lines)
Lines 79-86 Link Here
79
    @Override
79
    @Override
80
    void store(WizardDescriptor settings) {
80
    void store(WizardDescriptor settings) {
81
        GrailsPlatform.getDefault().removeChangeListener(this);
81
        GrailsPlatform.getDefault().removeChangeListener(this);
82
        settings.putProperty( /*XXX Define somewhere */ "setAsMain", // NOI18N
83
                setAsMainCheckBox.isSelected() && setAsMainCheckBox.isVisible() ? Boolean.TRUE : Boolean.FALSE );
84
    }
82
    }
85
83
86
    @Override
84
    @Override
Lines 113-119 Link Here
113
    private void initComponents() {
111
    private void initComponents() {
114
112
115
        configureButton = new javax.swing.JButton();
113
        configureButton = new javax.swing.JButton();
116
        setAsMainCheckBox = new javax.swing.JCheckBox();
117
114
118
        org.openide.awt.Mnemonics.setLocalizedText(configureButton, org.openide.util.NbBundle.getMessage(PanelOptionsVisual.class, "PanelOptionsVisual.configureButton.text")); // NOI18N
115
        org.openide.awt.Mnemonics.setLocalizedText(configureButton, org.openide.util.NbBundle.getMessage(PanelOptionsVisual.class, "PanelOptionsVisual.configureButton.text")); // NOI18N
119
        configureButton.addActionListener(new java.awt.event.ActionListener() {
116
        configureButton.addActionListener(new java.awt.event.ActionListener() {
Lines 122-147 Link Here
122
            }
119
            }
123
        });
120
        });
124
121
125
        setAsMainCheckBox.setSelected(true);
126
        org.openide.awt.Mnemonics.setLocalizedText(setAsMainCheckBox, org.openide.util.NbBundle.getMessage(PanelOptionsVisual.class, "PanelOptionsVisual.setAsMainCheckBox.text")); // NOI18N
127
128
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
122
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
129
        this.setLayout(layout);
123
        this.setLayout(layout);
130
        layout.setHorizontalGroup(
124
        layout.setHorizontalGroup(
131
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
125
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
132
            .addGroup(layout.createSequentialGroup()
126
            .addGroup(layout.createSequentialGroup()
133
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
127
                .addComponent(configureButton)
134
                    .addComponent(configureButton)
135
                    .addComponent(setAsMainCheckBox))
136
                .addContainerGap(246, Short.MAX_VALUE))
128
                .addContainerGap(246, Short.MAX_VALUE))
137
        );
129
        );
138
        layout.setVerticalGroup(
130
        layout.setVerticalGroup(
139
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
131
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
140
            .addGroup(layout.createSequentialGroup()
132
            .addGroup(layout.createSequentialGroup()
141
                .addComponent(configureButton)
133
                .addComponent(configureButton)
142
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
134
                .addContainerGap(75, Short.MAX_VALUE))
143
                .addComponent(setAsMainCheckBox)
144
                .addContainerGap(44, Short.MAX_VALUE))
145
        );
135
        );
146
    }// </editor-fold>//GEN-END:initComponents
136
    }// </editor-fold>//GEN-END:initComponents
147
137
Lines 153-159 Link Here
153
143
154
    // Variables declaration - do not modify//GEN-BEGIN:variables
144
    // Variables declaration - do not modify//GEN-BEGIN:variables
155
    private javax.swing.JButton configureButton;
145
    private javax.swing.JButton configureButton;
156
    private javax.swing.JCheckBox setAsMainCheckBox;
157
    // End of variables declaration//GEN-END:variables
146
    // End of variables declaration//GEN-END:variables
158
147
159
}
148
}
(-)a/groovy.grailsproject/src/org/netbeans/modules/groovy/grailsproject/ui/wizards/PanelProjectLocationVisual.java (-1 lines)
Lines 118-124 Link Here
118
    }
118
    }
119
119
120
    void store( WizardDescriptor d ) {
120
    void store( WizardDescriptor d ) {
121
        // d.putProperty( "setAsMain", setAsMainCheckBox.isSelected() && setAsMainCheckBox.isVisible() ? Boolean.TRUE : Boolean.FALSE ); // NOI18N
122
        d.putProperty( "projectFolder", new File(projectFolderTextField.getText().trim()) ); // NOI18N
121
        d.putProperty( "projectFolder", new File(projectFolderTextField.getText().trim()) ); // NOI18N
123
        d.putProperty( "projectName", projectNameTextField.getText().trim() ); // NOI18N
122
        d.putProperty( "projectName", projectNameTextField.getText().trim() ); // NOI18N
124
    }
123
    }
(-)a/j2ee.archive/src/org/netbeans/modules/j2ee/archive/ui/RootNode.java (-1 lines)
Lines 118-124 Link Here
118
        actions.add(ProjectSensitiveActions.projectCommandAction(
118
        actions.add(ProjectSensitiveActions.projectCommandAction(
119
                ActionProvider.COMMAND_RUN, bundle.getString("LBL_RunAction_Name"), null)); // NOI18N
119
                ActionProvider.COMMAND_RUN, bundle.getString("LBL_RunAction_Name"), null)); // NOI18N
120
        actions.add(null);
120
        actions.add(null);
121
        actions.add(CommonProjectActions.setAsMainProjectAction());
122
        actions.add(CommonProjectActions.openSubprojectsAction());
121
        actions.add(CommonProjectActions.openSubprojectsAction());
123
        actions.add(CommonProjectActions.closeProjectAction());
122
        actions.add(CommonProjectActions.closeProjectAction());
124
        actions.add(null);
123
        actions.add(null);
(-)a/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/ui/resources/layer.xml (-4 lines)
Lines 187-196 Link Here
187
                    <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
187
                    <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
188
                    <attr name="position" intvalue="1300"/>
188
                    <attr name="position" intvalue="1300"/>
189
                </file>
189
                </file>
190
                <file name="org-netbeans-modules-project-ui-SetMainProject.shadow">
191
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-SetMainProject.instance"/>
192
                    <attr name="position" intvalue="1400"/>
193
                </file>
194
                <file name="org-netbeans-modules-project-ui-actions-OpenSubprojects.shadow">
190
                <file name="org-netbeans-modules-project-ui-actions-OpenSubprojects.shadow">
195
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-actions-OpenSubprojects.instance"/>
191
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-actions-OpenSubprojects.instance"/>
196
                    <attr name="position" intvalue="1500"/>
192
                    <attr name="position" intvalue="1500"/>
(-)a/j2ee.common/src/org/netbeans/modules/j2ee/common/project/ui/Bundle.properties (-2 lines)
Lines 104-110 Link Here
104
ProjectLocationPanel.librariesLabel.text=Libraries Folder:
104
ProjectLocationPanel.librariesLabel.text=Libraries Folder:
105
105
106
#PanelServerPanel
106
#PanelServerPanel
107
LBL_NWP1_SetAsMain_CheckBox=&Set as Main Project
108
LBL_NWP1_J2EESpecLevel_Label=&Java EE Version\:
107
LBL_NWP1_J2EESpecLevel_Label=&Java EE Version\:
109
LBL_NWP1_ContextPath_Label=Context &Path:
108
LBL_NWP1_ContextPath_Label=Context &Path:
110
LBL_NWP1_AddToEnterprise_Label=&Add to Enterprise Application:
109
LBL_NWP1_AddToEnterprise_Label=&Add to Enterprise Application:
Lines 112-118 Link Here
112
LBL_PanelOptions_SharableProject_Checkbox=Project Shared With Other Users
111
LBL_PanelOptions_SharableProject_Checkbox=Project Shared With Other Users
113
LBL_PanelOptions_Location_Label=Sharable Libraries Location:
112
LBL_PanelOptions_Location_Label=Sharable Libraries Location:
114
LBL_Browse_Libraries_AcceptedFiles=*.properties files
113
LBL_Browse_Libraries_AcceptedFiles=*.properties files
115
ACS_LBL_NWP1_SetAsMain_A11YDesc=Set as Main Project
116
ACS_LBL_NPW1_J2EESpecLevel_A11YDesc=Java EE Version Combo Box
114
ACS_LBL_NPW1_J2EESpecLevel_A11YDesc=Java EE Version Combo Box
117
ACS_LBL_NWP1_ContextPath_A11YDesc=Context Path
115
ACS_LBL_NWP1_ContextPath_A11YDesc=Context Path
118
ACS_LBL_NWP1_AddToEnterpriseCheckBox_A11YDesc=Add to Enterprise Application Check Box
116
ACS_LBL_NWP1_AddToEnterpriseCheckBox_A11YDesc=Add to Enterprise Application Check Box
(-)a/j2ee.common/src/org/netbeans/modules/j2ee/common/project/ui/ProjectImportLocationPanel.form (-31 / +9 lines)
Lines 1-4 Link Here
1
<?xml version="1.1" encoding="UTF-8" ?>
1
<?xml version="1.0" encoding="UTF-8" ?>
2
2
3
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
3
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <AccessibilityProperties>
4
  <AccessibilityProperties>
Lines 42-68 Link Here
42
                  <Component id="jButtonPrjLocation" alignment="1" min="-2" max="-2" attributes="0"/>
42
                  <Component id="jButtonPrjLocation" alignment="1" min="-2" max="-2" attributes="0"/>
43
              </Group>
43
              </Group>
44
          </Group>
44
          </Group>
45
          <Group type="102" alignment="0" attributes="0">
46
              <Component id="jLabelPrjLocationDesc" min="-2" max="-2" attributes="0"/>
47
              <EmptySpace max="-2" attributes="0"/>
48
          </Group>
49
          <Component id="jSeparator1" alignment="0" pref="639" max="32767" attributes="0"/>
45
          <Component id="jSeparator1" alignment="0" pref="639" max="32767" attributes="0"/>
50
          <Group type="102" alignment="0" attributes="0">
46
          <Group type="102" alignment="0" attributes="0">
51
              <Component id="sharableProject" min="-2" max="-2" attributes="0"/>
52
              <EmptySpace pref="304" max="32767" attributes="0"/>
53
          </Group>
54
          <Group type="102" alignment="0" attributes="0">
55
              <Component id="librariesLabel" min="-2" max="-2" attributes="0"/>
47
              <Component id="librariesLabel" min="-2" max="-2" attributes="0"/>
56
              <EmptySpace max="-2" attributes="0"/>
48
              <EmptySpace max="-2" attributes="0"/>
57
              <Component id="librariesLocation" pref="403" max="32767" attributes="0"/>
49
              <Component id="librariesLocation" pref="403" max="32767" attributes="0"/>
58
              <EmptySpace max="-2" attributes="0"/>
50
              <EmptySpace max="-2" attributes="0"/>
59
              <Component id="browseLibraries" min="-2" max="-2" attributes="0"/>
51
              <Component id="browseLibraries" min="-2" max="-2" attributes="0"/>
60
          </Group>
52
          </Group>
61
          <Group type="102" alignment="0" attributes="0">
53
          <Component id="jLabelSrcLocationDesc" alignment="0" pref="639" max="32767" attributes="0"/>
62
              <Component id="setAsMainCheckBox" min="-2" max="-2" attributes="0"/>
54
          <Group type="102" attributes="0">
63
              <EmptySpace max="-2" attributes="0"/>
55
              <Group type="103" groupAlignment="0" attributes="0">
56
                  <Component id="jLabelPrjLocationDesc" alignment="0" min="-2" max="-2" attributes="0"/>
57
                  <Component id="sharableProject" alignment="0" min="-2" max="-2" attributes="0"/>
58
              </Group>
59
              <EmptySpace max="32767" attributes="0"/>
64
          </Group>
60
          </Group>
65
          <Component id="jLabelSrcLocationDesc" alignment="0" pref="639" max="32767" attributes="0"/>
66
      </Group>
61
      </Group>
67
    </DimensionLayout>
62
    </DimensionLayout>
68
    <DimensionLayout dim="1">
63
    <DimensionLayout dim="1">
Lines 98-106 Link Here
98
                  <Component id="browseLibraries" alignment="3" min="-2" max="-2" attributes="0"/>
93
                  <Component id="browseLibraries" alignment="3" min="-2" max="-2" attributes="0"/>
99
                  <Component id="librariesLocation" alignment="3" min="-2" max="-2" attributes="0"/>
94
                  <Component id="librariesLocation" alignment="3" min="-2" max="-2" attributes="0"/>
100
              </Group>
95
              </Group>
101
              <EmptySpace type="separate" max="-2" attributes="0"/>
96
              <EmptySpace min="-2" pref="93" max="-2" attributes="0"/>
102
              <Component id="setAsMainCheckBox" min="-2" max="-2" attributes="0"/>
103
              <EmptySpace min="-2" pref="52" max="-2" attributes="0"/>
104
          </Group>
97
          </Group>
105
      </Group>
98
      </Group>
106
    </DimensionLayout>
99
    </DimensionLayout>
Lines 345-364 Link Here
345
        <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
338
        <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
346
      </AuxValues>
339
      </AuxValues>
347
    </Component>
340
    </Component>
348
    <Component class="javax.swing.JCheckBox" name="setAsMainCheckBox">
349
      <Properties>
350
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
351
          <ResourceString bundle="org/netbeans/modules/j2ee/common/project/ui/Bundle.properties" key="LBL_NWP1_SetAsMain_CheckBox" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
352
        </Property>
353
        <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
354
          <Insets value="[2, 0, 2, 2]"/>
355
        </Property>
356
      </Properties>
357
      <AccessibilityProperties>
358
        <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
359
          <ResourceString bundle="org/netbeans/modules/j2ee/common/project/ui/Bundle.properties" key="ACSD_ProjectImportLocationPanel_NA" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
360
        </Property>
361
      </AccessibilityProperties>
362
    </Component>
363
  </SubComponents>
341
  </SubComponents>
364
</Form>
342
</Form>
(-)a/j2ee.common/src/org/netbeans/modules/j2ee/common/project/ui/ProjectImportLocationPanel.java (-21 / +5 lines)
Lines 61-67 Link Here
61
import org.netbeans.api.project.ProjectManager;
61
import org.netbeans.api.project.ProjectManager;
62
import org.netbeans.api.queries.CollocationQuery;
62
import org.netbeans.api.queries.CollocationQuery;
63
import org.netbeans.modules.j2ee.common.FileSearchUtility;
63
import org.netbeans.modules.j2ee.common.FileSearchUtility;
64
import org.netbeans.modules.j2ee.common.project.ui.UserProjectSettings;
65
import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
64
import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
66
import org.netbeans.spi.project.ui.support.ProjectChooser;
65
import org.netbeans.spi.project.ui.support.ProjectChooser;
67
66
Lines 92-98 Link Here
92
        this.nameFormatter = nameFormatter;
91
        this.nameFormatter = nameFormatter;
93
        this.allowAlternativeBuildXml = allowAlternativeBuildXml;
92
        this.allowAlternativeBuildXml = allowAlternativeBuildXml;
94
        initComponents ();
93
        initComponents ();
95
        setAsMainCheckBox.setSelected(UserProjectSettings.getDefault().getSetAsMainProject(j2eeModuleType));
96
        jLabelSrcLocationDesc.setText(importLabel);
94
        jLabelSrcLocationDesc.setText(importLabel);
97
        currentLibrariesLocation = "."+File.separatorChar+"lib"; // NOI18N
95
        currentLibrariesLocation = "."+File.separatorChar+"lib"; // NOI18N
98
        librariesLocation.setText(currentLibrariesLocation);
96
        librariesLocation.setText(currentLibrariesLocation);
Lines 163-171 Link Here
163
            settings.putProperty (ProjectLocationWizardPanel.PROJECT_DIR, new File(projectLocation));
161
            settings.putProperty (ProjectLocationWizardPanel.PROJECT_DIR, new File(projectLocation));
164
        }
162
        }
165
163
166
        settings.putProperty(ProjectLocationWizardPanel.SET_AS_MAIN, setAsMainCheckBox.isSelected() ? Boolean.TRUE : Boolean.FALSE );
167
        settings.putProperty(ProjectLocationWizardPanel.SHARED_LIBRARIES, sharableProject.isSelected() ? librariesLocation.getText() : null);
164
        settings.putProperty(ProjectLocationWizardPanel.SHARED_LIBRARIES, sharableProject.isSelected() ? librariesLocation.getText() : null);
168
        UserProjectSettings.getDefault().setSetAsMainProject(setAsMainCheckBox.isSelected(), j2eeModuleType);
169
    }
165
    }
170
166
171
    boolean valid (WizardDescriptor settings) {
167
    boolean valid (WizardDescriptor settings) {
Lines 306-312 Link Here
306
        librariesLabel = new javax.swing.JLabel();
302
        librariesLabel = new javax.swing.JLabel();
307
        librariesLocation = new javax.swing.JTextField();
303
        librariesLocation = new javax.swing.JTextField();
308
        browseLibraries = new javax.swing.JButton();
304
        browseLibraries = new javax.swing.JButton();
309
        setAsMainCheckBox = new javax.swing.JCheckBox();
310
305
311
        org.openide.awt.Mnemonics.setLocalizedText(jLabelSrcLocationDesc, NbBundle.getMessage(ProjectImportLocationPanel.class, "LBL_IW_LocationSrcDesc")); // NOI18N
306
        org.openide.awt.Mnemonics.setLocalizedText(jLabelSrcLocationDesc, NbBundle.getMessage(ProjectImportLocationPanel.class, "LBL_IW_LocationSrcDesc")); // NOI18N
312
307
Lines 362-370 Link Here
362
            }
357
            }
363
        });
358
        });
364
359
365
        org.openide.awt.Mnemonics.setLocalizedText(setAsMainCheckBox, org.openide.util.NbBundle.getMessage(ProjectImportLocationPanel.class, "LBL_NWP1_SetAsMain_CheckBox")); // NOI18N
366
        setAsMainCheckBox.setMargin(new java.awt.Insets(2, 0, 2, 2));
367
368
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
360
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
369
        this.setLayout(layout);
361
        this.setLayout(layout);
370
        layout.setHorizontalGroup(
362
        layout.setHorizontalGroup(
Lines 383-405 Link Here
383
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
375
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
384
                    .addComponent(jButtonSrcLocation, javax.swing.GroupLayout.Alignment.TRAILING)
376
                    .addComponent(jButtonSrcLocation, javax.swing.GroupLayout.Alignment.TRAILING)
385
                    .addComponent(jButtonPrjLocation, javax.swing.GroupLayout.Alignment.TRAILING)))
377
                    .addComponent(jButtonPrjLocation, javax.swing.GroupLayout.Alignment.TRAILING)))
386
            .addGroup(layout.createSequentialGroup()
387
                .addComponent(jLabelPrjLocationDesc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
388
                .addContainerGap())
389
            .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 639, Short.MAX_VALUE)
378
            .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 639, Short.MAX_VALUE)
390
            .addGroup(layout.createSequentialGroup()
379
            .addGroup(layout.createSequentialGroup()
391
                .addComponent(sharableProject)
392
                .addContainerGap(304, Short.MAX_VALUE))
393
            .addGroup(layout.createSequentialGroup()
394
                .addComponent(librariesLabel)
380
                .addComponent(librariesLabel)
395
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
381
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
396
                .addComponent(librariesLocation, javax.swing.GroupLayout.DEFAULT_SIZE, 403, Short.MAX_VALUE)
382
                .addComponent(librariesLocation, javax.swing.GroupLayout.DEFAULT_SIZE, 403, Short.MAX_VALUE)
397
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
383
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
398
                .addComponent(browseLibraries))
384
                .addComponent(browseLibraries))
385
            .addComponent(jLabelSrcLocationDesc, javax.swing.GroupLayout.DEFAULT_SIZE, 639, Short.MAX_VALUE)
399
            .addGroup(layout.createSequentialGroup()
386
            .addGroup(layout.createSequentialGroup()
400
                .addComponent(setAsMainCheckBox)
387
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
388
                    .addComponent(jLabelPrjLocationDesc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
389
                    .addComponent(sharableProject))
401
                .addContainerGap())
390
                .addContainerGap())
402
            .addComponent(jLabelSrcLocationDesc, javax.swing.GroupLayout.DEFAULT_SIZE, 639, Short.MAX_VALUE)
403
        );
391
        );
404
        layout.setVerticalGroup(
392
        layout.setVerticalGroup(
405
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
393
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
Lines 430-438 Link Here
430
                    .addComponent(librariesLabel)
418
                    .addComponent(librariesLabel)
431
                    .addComponent(browseLibraries)
419
                    .addComponent(browseLibraries)
432
                    .addComponent(librariesLocation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
420
                    .addComponent(librariesLocation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
433
                .addGap(18, 18, 18)
421
                .addGap(93, 93, 93))
434
                .addComponent(setAsMainCheckBox)
435
                .addGap(52, 52, 52))
436
        );
422
        );
437
423
438
        jLabelSrcLocationDesc.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectImportLocationPanel.class, "ACSD_ProjectImportLocationPanel_NA")); // NOI18N
424
        jLabelSrcLocationDesc.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectImportLocationPanel.class, "ACSD_ProjectImportLocationPanel_NA")); // NOI18N
Lines 451-457 Link Here
451
        librariesLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectImportLocationPanel.class, "ACSD_ProjectImportLocationPanel_NA")); // NOI18N
437
        librariesLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectImportLocationPanel.class, "ACSD_ProjectImportLocationPanel_NA")); // NOI18N
452
        librariesLocation.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectImportLocationPanel.class, "ACSD_ProjectImportLocationPanel_NA")); // NOI18N
438
        librariesLocation.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectImportLocationPanel.class, "ACSD_ProjectImportLocationPanel_NA")); // NOI18N
453
        browseLibraries.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectImportLocationPanel.class, "ACSD_ProjectImportLocationPanel_NA")); // NOI18N
439
        browseLibraries.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectImportLocationPanel.class, "ACSD_ProjectImportLocationPanel_NA")); // NOI18N
454
        setAsMainCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectImportLocationPanel.class, "ACSD_ProjectImportLocationPanel_NA")); // NOI18N
455
440
456
        getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ProjectImportLocationPanel.class, "ACSD_ProjectImportLocationPanel_NA")); // NOI18N
441
        getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ProjectImportLocationPanel.class, "ACSD_ProjectImportLocationPanel_NA")); // NOI18N
457
        getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectImportLocationPanel.class, "ACSD_ProjectImportLocationPanel_NA")); // NOI18N
442
        getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectImportLocationPanel.class, "ACSD_ProjectImportLocationPanel_NA")); // NOI18N
Lines 540-546 Link Here
540
    public javax.swing.JTextField moduleLocationTextField;
525
    public javax.swing.JTextField moduleLocationTextField;
541
    public javax.swing.JTextField projectLocationTextField;
526
    public javax.swing.JTextField projectLocationTextField;
542
    public javax.swing.JTextField projectNameTextField;
527
    public javax.swing.JTextField projectNameTextField;
543
    private javax.swing.JCheckBox setAsMainCheckBox;
544
    private javax.swing.JCheckBox sharableProject;
528
    private javax.swing.JCheckBox sharableProject;
545
    // End of variables declaration//GEN-END:variables
529
    // End of variables declaration//GEN-END:variables
546
530
(-)a/j2ee.common/src/org/netbeans/modules/j2ee/common/project/ui/ProjectLocationPanel.form (-22 / +1 lines)
Lines 50-59 Link Here
50
              <EmptySpace min="-2" max="-2" attributes="0"/>
50
              <EmptySpace min="-2" max="-2" attributes="0"/>
51
              <Component id="browseButton" min="-2" max="-2" attributes="0"/>
51
              <Component id="browseButton" min="-2" max="-2" attributes="0"/>
52
          </Group>
52
          </Group>
53
          <Group type="102" attributes="0">
54
              <Component id="setAsMainCheckBox" min="-2" max="-2" attributes="0"/>
55
              <EmptySpace pref="343" max="32767" attributes="0"/>
56
          </Group>
57
          <Component id="jPanel1" max="32767" attributes="0"/>
53
          <Component id="jPanel1" max="32767" attributes="0"/>
58
          <Component id="sharableProject" max="32767" attributes="0"/>
54
          <Component id="sharableProject" max="32767" attributes="0"/>
59
      </Group>
55
      </Group>
Lines 88-96 Link Here
88
              </Group>
84
              </Group>
89
              <EmptySpace max="-2" attributes="0"/>
85
              <EmptySpace max="-2" attributes="0"/>
90
              <Component id="lblHint" min="-2" max="-2" attributes="0"/>
86
              <Component id="lblHint" min="-2" max="-2" attributes="0"/>
91
              <EmptySpace max="-2" attributes="0"/>
87
              <EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
92
              <Component id="setAsMainCheckBox" min="-2" max="-2" attributes="0"/>
93
              <EmptySpace max="-2" attributes="0"/>
94
              <Component id="jPanel1" min="-2" pref="14" max="-2" attributes="0"/>
88
              <Component id="jPanel1" min="-2" pref="14" max="-2" attributes="0"/>
95
          </Group>
89
          </Group>
96
      </Group>
90
      </Group>
Lines 298-318 Link Here
298
        <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
292
        <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
299
      </AuxValues>
293
      </AuxValues>
300
    </Component>
294
    </Component>
301
    <Component class="javax.swing.JCheckBox" name="setAsMainCheckBox">
302
      <Properties>
303
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
304
          <ResourceString bundle="org/netbeans/modules/j2ee/common/project/ui/Bundle.properties" key="LBL_NWP1_SetAsMain_CheckBox" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
305
        </Property>
306
        <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
307
          <Insets value="[2, 0, 2, 2]"/>
308
        </Property>
309
      </Properties>
310
      <AccessibilityProperties>
311
        <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
312
          <ResourceString bundle="org/netbeans/modules/j2ee/common/project/ui/Bundle.properties" key="ACSD_ProjectLocationPanel_NA" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
313
        </Property>
314
      </AccessibilityProperties>
315
    </Component>
316
    <Container class="javax.swing.JPanel" name="jPanel1">
295
    <Container class="javax.swing.JPanel" name="jPanel1">
317
      <AccessibilityProperties>
296
      <AccessibilityProperties>
318
        <Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
297
        <Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
(-)a/j2ee.common/src/org/netbeans/modules/j2ee/common/project/ui/ProjectLocationPanel.java (-16 / +1 lines)
Lines 53-59 Link Here
53
import javax.swing.event.DocumentListener;
53
import javax.swing.event.DocumentListener;
54
import javax.swing.text.Document;
54
import javax.swing.text.Document;
55
import org.netbeans.api.queries.CollocationQuery;
55
import org.netbeans.api.queries.CollocationQuery;
56
import org.netbeans.modules.j2ee.common.project.ui.UserProjectSettings;
57
import org.netbeans.spi.java.project.support.ui.SharableLibrariesUtils;
56
import org.netbeans.spi.java.project.support.ui.SharableLibrariesUtils;
58
import org.netbeans.spi.project.support.ant.PropertyUtils;
57
import org.netbeans.spi.project.support.ant.PropertyUtils;
59
import org.netbeans.spi.project.ui.support.ProjectChooser;
58
import org.netbeans.spi.project.ui.support.ProjectChooser;
Lines 83-89 Link Here
83
    public ProjectLocationPanel(Object j2eeModuleType, String name, String title, 
82
    public ProjectLocationPanel(Object j2eeModuleType, String name, String title, 
84
            ProjectLocationWizardPanel wizard, String defaultNameFormatter) {
83
            ProjectLocationWizardPanel wizard, String defaultNameFormatter) {
85
        initComponents();
84
        initComponents();
86
        setAsMainCheckBox.setSelected(UserProjectSettings.getDefault().getSetAsMainProject(j2eeModuleType));
87
        this.wizard = wizard;
85
        this.wizard = wizard;
88
        this.j2eeModuleType = j2eeModuleType;
86
        this.j2eeModuleType = j2eeModuleType;
89
        this.nameFormatter = defaultNameFormatter;
87
        this.nameFormatter = defaultNameFormatter;
Lines 120-126 Link Here
120
        librariesLocation = new javax.swing.JTextField();
118
        librariesLocation = new javax.swing.JTextField();
121
        browseLibraries = new javax.swing.JButton();
119
        browseLibraries = new javax.swing.JButton();
122
        sharableProject = new javax.swing.JCheckBox();
120
        sharableProject = new javax.swing.JCheckBox();
123
        setAsMainCheckBox = new javax.swing.JCheckBox();
124
        jPanel1 = new javax.swing.JPanel();
121
        jPanel1 = new javax.swing.JPanel();
125
        lblHint = new javax.swing.JLabel();
122
        lblHint = new javax.swing.JLabel();
126
123
Lines 166-174 Link Here
166
            }
163
            }
167
        });
164
        });
168
165
169
        org.openide.awt.Mnemonics.setLocalizedText(setAsMainCheckBox, org.openide.util.NbBundle.getMessage(ProjectLocationPanel.class, "LBL_NWP1_SetAsMain_CheckBox")); // NOI18N
170
        setAsMainCheckBox.setMargin(new java.awt.Insets(2, 0, 2, 2));
171
172
        org.openide.awt.Mnemonics.setLocalizedText(lblHint, org.openide.util.NbBundle.getMessage(ProjectLocationPanel.class, "HINT_LibrariesFolder")); // NOI18N
166
        org.openide.awt.Mnemonics.setLocalizedText(lblHint, org.openide.util.NbBundle.getMessage(ProjectLocationPanel.class, "HINT_LibrariesFolder")); // NOI18N
173
167
174
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
168
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
Lines 196-204 Link Here
196
                    .addComponent(createdFolderTextField))
190
                    .addComponent(createdFolderTextField))
197
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
191
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
198
                .addComponent(browseButton))
192
                .addComponent(browseButton))
199
            .addGroup(layout.createSequentialGroup()
200
                .addComponent(setAsMainCheckBox)
201
                .addContainerGap(343, Short.MAX_VALUE))
202
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
193
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
203
            .addComponent(sharableProject, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
194
            .addComponent(sharableProject, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
204
        );
195
        );
Lines 228-236 Link Here
228
                    .addComponent(librariesLocation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
219
                    .addComponent(librariesLocation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
229
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
220
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
230
                .addComponent(lblHint, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
221
                .addComponent(lblHint, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
231
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
222
                .addGap(27, 27, 27)
232
                .addComponent(setAsMainCheckBox)
233
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
234
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
223
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
235
        );
224
        );
236
225
Lines 251-257 Link Here
251
        librariesLocation.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectLocationPanel.class, "ACSD_ProjectLocationPanel_NA")); // NOI18N
240
        librariesLocation.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectLocationPanel.class, "ACSD_ProjectLocationPanel_NA")); // NOI18N
252
        browseLibraries.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectLocationPanel.class, "ACSD_ProjectLocationPanel_NA")); // NOI18N
241
        browseLibraries.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectLocationPanel.class, "ACSD_ProjectLocationPanel_NA")); // NOI18N
253
        sharableProject.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectLocationPanel.class, "ACSD_ProjectLocationPanel_NA")); // NOI18N
242
        sharableProject.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectLocationPanel.class, "ACSD_ProjectLocationPanel_NA")); // NOI18N
254
        setAsMainCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectLocationPanel.class, "ACSD_ProjectLocationPanel_NA")); // NOI18N
255
        jPanel1.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ProjectLocationPanel.class, "ACSD_ProjectLocationPanel_NA")); // NOI18N
243
        jPanel1.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ProjectLocationPanel.class, "ACSD_ProjectLocationPanel_NA")); // NOI18N
256
        jPanel1.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectLocationPanel.class, "ACSD_ProjectLocationPanel_NA")); // NOI18N
244
        jPanel1.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectLocationPanel.class, "ACSD_ProjectLocationPanel_NA")); // NOI18N
257
        lblHint.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectLocationPanel.class, "ACSD_ProjectLocationPanel_NA")); // NOI18N
245
        lblHint.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectLocationPanel.class, "ACSD_ProjectLocationPanel_NA")); // NOI18N
Lines 386-394 Link Here
386
        d.putProperty( ProjectLocationWizardPanel.PROJECT_DIR, new File( folder ));
374
        d.putProperty( ProjectLocationWizardPanel.PROJECT_DIR, new File( folder ));
387
        d.putProperty( ProjectLocationWizardPanel.NAME, name );
375
        d.putProperty( ProjectLocationWizardPanel.NAME, name );
388
        
376
        
389
        d.putProperty(ProjectLocationWizardPanel.SET_AS_MAIN, setAsMainCheckBox.isSelected() ? Boolean.TRUE : Boolean.FALSE );
390
        d.putProperty(ProjectLocationWizardPanel.SHARED_LIBRARIES, sharableProject.isSelected() ? librariesLocation.getText() : null);
377
        d.putProperty(ProjectLocationWizardPanel.SHARED_LIBRARIES, sharableProject.isSelected() ? librariesLocation.getText() : null);
391
        UserProjectSettings.getDefault().setSetAsMainProject(setAsMainCheckBox.isSelected(), j2eeModuleType);
392
    }
378
    }
393
    
379
    
394
    void read (WizardDescriptor settings) {
380
    void read (WizardDescriptor settings) {
Lines 442-448 Link Here
442
    private javax.swing.JTextField projectLocationTextField;
428
    private javax.swing.JTextField projectLocationTextField;
443
    private javax.swing.JLabel projectNameLabel;
429
    private javax.swing.JLabel projectNameLabel;
444
    protected javax.swing.JTextField projectNameTextField;
430
    protected javax.swing.JTextField projectNameTextField;
445
    private javax.swing.JCheckBox setAsMainCheckBox;
446
    private javax.swing.JCheckBox sharableProject;
431
    private javax.swing.JCheckBox sharableProject;
447
    // End of variables declaration//GEN-END:variables
432
    // End of variables declaration//GEN-END:variables
448
    
433
    
(-)a/j2ee.common/src/org/netbeans/modules/j2ee/common/project/ui/ProjectLocationWizardPanel.java (-1 lines)
Lines 60-66 Link Here
60
    
60
    
61
    public static final String PROJECT_DIR = "projdir"; //NOI18N
61
    public static final String PROJECT_DIR = "projdir"; //NOI18N
62
    public static final String NAME = "name"; //NOI18N
62
    public static final String NAME = "name"; //NOI18N
63
    public static final String SET_AS_MAIN = "setAsMain"; //NOI18N
64
    public static final String SHARED_LIBRARIES = "sharedLibraries"; // NOI18N
63
    public static final String SHARED_LIBRARIES = "sharedLibraries"; // NOI18N
65
    
64
    
66
    private WizardDescriptor wizardDescriptor;
65
    private WizardDescriptor wizardDescriptor;
(-)a/j2ee.common/src/org/netbeans/modules/j2ee/common/project/ui/UserProjectSettings.java (-12 lines)
Lines 47-53 Link Here
47
import java.io.File;
47
import java.io.File;
48
import java.util.prefs.Preferences;
48
import java.util.prefs.Preferences;
49
49
50
import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
51
import org.openide.filesystems.FileUtil;
50
import org.openide.filesystems.FileUtil;
52
import org.openide.util.NbBundle;
51
import org.openide.util.NbBundle;
53
import org.openide.util.NbPreferences;
52
import org.openide.util.NbPreferences;
Lines 83-90 Link Here
83
    
82
    
84
    private static final String LAST_USED_IMPORT_LOCATION = "lastUsedImportLocation"; // NOI18N
83
    private static final String LAST_USED_IMPORT_LOCATION = "lastUsedImportLocation"; // NOI18N
85
84
86
    private static final String SET_AS_MAIN_PROJECT = "setAsMainProject"; // NOI18N
87
    
88
    public static UserProjectSettings getDefault () {
85
    public static UserProjectSettings getDefault () {
89
        return INSTANCE;
86
        return INSTANCE;
90
    }
87
    }
Lines 210-222 Link Here
210
            return new File(path);
207
            return new File(path);
211
    }
208
    }
212
    
209
    
213
    public void setSetAsMainProject(boolean setAsMain, Object j2eeModuleType) {
214
        getPreferences().putBoolean(SET_AS_MAIN_PROJECT+"-"+j2eeModuleType.toString(), setAsMain); // NOI18N
215
    }
216
217
    public boolean getSetAsMainProject(Object j2eeModuleType) {
218
        return  getPreferences().getBoolean(SET_AS_MAIN_PROJECT+"-"+j2eeModuleType.toString(), 
219
                j2eeModuleType == J2eeModule.EJB ? false : true);
220
    }
221
    
222
}
210
}
(-)a/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/ui/resources/layer.xml (-4 lines)
Lines 182-191 Link Here
182
                    <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
182
                    <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
183
                    <attr name="position" intvalue="1300"/>
183
                    <attr name="position" intvalue="1300"/>
184
                </file>
184
                </file>
185
                <file name="org-netbeans-modules-project-ui-SetMainProject.shadow">
186
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-SetMainProject.instance"/>
187
                    <attr name="position" intvalue="1400"/>
188
                </file>
189
                <file name="org-netbeans-modules-project-ui-actions-OpenSubprojects.shadow">
185
                <file name="org-netbeans-modules-project-ui-actions-OpenSubprojects.shadow">
190
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-actions-OpenSubprojects.instance"/>
186
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-actions-OpenSubprojects.instance"/>
191
                    <attr name="position" intvalue="1500"/>
187
                    <attr name="position" intvalue="1500"/>
(-)a/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ui/resources/layer.xml (-4 lines)
Lines 180-189 Link Here
180
                    <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
180
                    <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
181
                    <attr name="position" intvalue="1300"/>
181
                    <attr name="position" intvalue="1300"/>
182
                </file>
182
                </file>
183
                <file name="org-netbeans-modules-project-ui-SetMainProject.shadow">
184
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-SetMainProject.instance"/>
185
                    <attr name="position" intvalue="1400"/>
186
                </file>
187
                <file name="org-netbeans-modules-project-ui-actions-OpenSubprojects.shadow">
183
                <file name="org-netbeans-modules-project-ui-actions-OpenSubprojects.shadow">
188
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-actions-OpenSubprojects.instance"/>
184
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-actions-OpenSubprojects.instance"/>
189
                    <attr name="position" intvalue="1500"/>
185
                    <attr name="position" intvalue="1500"/>
(-)a/j2ee.jboss4/test/qa-functional/src/org/netbeans/test/j2ee/lib/Util.java (-2 lines)
Lines 111-118 Link Here
111
                public void run() {
111
                public void run() {
112
                    OpenProjectList.getDefault().addPropertyChangeListener(listener);
112
                    OpenProjectList.getDefault().addPropertyChangeListener(listener);
113
                    OpenProjectList.getDefault().open(project);
113
                    OpenProjectList.getDefault().open(project);
114
                    // Set main? Probably user should do this if he wants.
115
                    // OpenProjectList.getDefault().setMainProject(project);
116
                }
114
                }
117
            });
115
            });
118
            // WAIT PROJECT OPEN - start
116
            // WAIT PROJECT OPEN - start
(-)a/j2ee.kit/test/qa-functional/src/org/netbeans/test/j2ee/lib/J2eeProjectSupport.java (-2 lines)
Lines 108-115 Link Here
108
                public void run() {
108
                public void run() {
109
                    OpenProjectList.getDefault().addPropertyChangeListener(listener);
109
                    OpenProjectList.getDefault().addPropertyChangeListener(listener);
110
                    OpenProjectList.getDefault().open(project);
110
                    OpenProjectList.getDefault().open(project);
111
                    // Set main? Probably user should do this if he wants.
112
                    // OpenProjectList.getDefault().setMainProject(project);
113
                }
111
                }
114
            });
112
            });
115
            // WAIT PROJECT OPEN - start
113
            // WAIT PROJECT OPEN - start
(-)a/j2me.cdc.project/src/org/netbeans/modules/j2me/cdc/project/ui/wizards/Bundle.properties (-7 lines)
Lines 65-71 Link Here
65
LBL_NWP1_CreatedProjectFolder_Lablel=Project Fol&der\:
65
LBL_NWP1_CreatedProjectFolder_Lablel=Project Fol&der\:
66
LBL_NWP1_CreatedProjectFolder_LablelMnemonic=d
66
LBL_NWP1_CreatedProjectFolder_LablelMnemonic=d
67
LBL_NWP1_CreateMainClass_CheckBoxMnemonic=C
67
LBL_NWP1_CreateMainClass_CheckBoxMnemonic=C
68
LBL_NWP1_SetAsMain_CheckBoxMnemonic=S
69
LBL_NPW1_DefaultProjectName=newProject
68
LBL_NPW1_DefaultProjectName=newProject
70
69
71
LBL_NWP1_SelectProjectLocation=Select Project Location
70
LBL_NWP1_SelectProjectLocation=Select Project Location
Lines 156-165 Link Here
156
ACSD_PlatformInstall=Install Platform Wizard
155
ACSD_PlatformInstall=Install Platform Wizard
157
156
158
157
159
ACSN_setAsMainCheckBox=Set as Main Project
160
161
ACSD_setAsMainCheckBox=N/A
162
163
ACSN_createMainCheckBox=Create Main Class
158
ACSN_createMainCheckBox=Create Main Class
164
159
165
ACSD_createMainCheckBox=Select checkbox to create main class in project.
160
ACSD_createMainCheckBox=Select checkbox to create main class in project.
Lines 168-175 Link Here
168
163
169
ASCD_mainClassTextFiled=N/A
164
ASCD_mainClassTextFiled=N/A
170
165
171
LBL_setAsMainCheckBox=Set as &Main Project
172
173
ACSN_jPanel1=N/A
166
ACSN_jPanel1=N/A
174
167
175
ASCD_jPanel1=N/A
168
ASCD_jPanel1=N/A
(-)a/j2me.cdc.project/src/org/netbeans/modules/j2me/cdc/project/ui/wizards/PanelOptionsVisual.form (-28 / +1 lines)
Lines 1-4 Link Here
1
<?xml version="1.1" encoding="UTF-8" ?>
1
<?xml version="1.0" encoding="UTF-8" ?>
2
2
3
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
3
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <AccessibilityProperties>
4
  <AccessibilityProperties>
Lines 23-55 Link Here
23
23
24
  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
24
  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
25
  <SubComponents>
25
  <SubComponents>
26
    <Component class="javax.swing.JCheckBox" name="setAsMainCheckBox">
27
      <Properties>
28
        <Property name="selected" type="boolean" value="true"/>
29
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
30
          <ResourceString bundle="org/netbeans/modules/j2me/cdc/project/ui/wizards/Bundle.properties" key="LBL_setAsMainCheckBox" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
31
        </Property>
32
        <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
33
          <Insets value="[0, 0, 0, 0]"/>
34
        </Property>
35
      </Properties>
36
      <AccessibilityProperties>
37
        <Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
38
          <ResourceString bundle="org/netbeans/modules/j2me/cdc/project/ui/wizards/Bundle.properties" key="ACSN_setAsMainCheckBox" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
39
        </Property>
40
        <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
41
          <ResourceString bundle="org/netbeans/modules/j2me/cdc/project/ui/wizards/Bundle.properties" key="ACSD_setAsMainCheckBox" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
42
        </Property>
43
      </AccessibilityProperties>
44
      <AuxValues>
45
        <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
46
      </AuxValues>
47
      <Constraints>
48
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
49
          <GridBagConstraints gridX="-1" gridY="-1" gridWidth="0" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="3" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
50
        </Constraint>
51
      </Constraints>
52
    </Component>
53
    <Component class="javax.swing.JCheckBox" name="createMainCheckBox">
26
    <Component class="javax.swing.JCheckBox" name="createMainCheckBox">
54
      <Properties>
27
      <Properties>
55
        <Property name="selected" type="boolean" value="true"/>
28
        <Property name="selected" type="boolean" value="true"/>
(-)a/j2me.cdc.project/src/org/netbeans/modules/j2me/cdc/project/ui/wizards/PanelOptionsVisual.java (-19 / +1 lines)
Lines 68-74 Link Here
68
    
68
    
69
    private static boolean lastMainClassCheck = true; // XXX Store somewhere
69
    private static boolean lastMainClassCheck = true; // XXX Store somewhere
70
70
71
    private static final String SET_AS_MAIN = "setAsMain"; //NOI18N
72
    private static final String MAIN_CLASS = "mainClass"; //NOI18N
71
    private static final String MAIN_CLASS = "mainClass"; //NOI18N
73
    
72
    
74
    
73
    
Lines 84-90 Link Here
84
83
85
        switch (type) {
84
        switch (type) {
86
            case NewCDCProjectWizardIterator.TYPE_LIB:
85
            case NewCDCProjectWizardIterator.TYPE_LIB:
87
                setAsMainCheckBox.setVisible(false);
88
                createMainCheckBox.setVisible(false);
86
                createMainCheckBox.setVisible(false);
89
                mainClassTextField.setVisible(false);
87
                mainClassTextField.setVisible(false);
90
                separator.setVisible(false);
88
                separator.setVisible(false);
Lines 96-102 Link Here
96
                separator.setVisible(true);
94
                separator.setVisible(true);
97
                break;
95
                break;
98
            case NewCDCProjectWizardIterator.TYPE_EXT:
96
            case NewCDCProjectWizardIterator.TYPE_EXT:
99
                setAsMainCheckBox.setVisible(true);
100
                createMainCheckBox.setVisible(false);
97
                createMainCheckBox.setVisible(false);
101
                mainClassTextField.setVisible(false);
98
                mainClassTextField.setVisible(false);
102
                break;
99
                break;
Lines 150-160 Link Here
150
     * WARNING: Do NOT modify this code. The content of this method is
147
     * WARNING: Do NOT modify this code. The content of this method is
151
     * always regenerated by the Form Editor.
148
     * always regenerated by the Form Editor.
152
     */
149
     */
153
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
150
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
154
    private void initComponents() {
151
    private void initComponents() {
155
        java.awt.GridBagConstraints gridBagConstraints;
152
        java.awt.GridBagConstraints gridBagConstraints;
156
153
157
        setAsMainCheckBox = new javax.swing.JCheckBox();
158
        createMainCheckBox = new javax.swing.JCheckBox();
154
        createMainCheckBox = new javax.swing.JCheckBox();
159
        mainClassTextField = new javax.swing.JTextField();
155
        mainClassTextField = new javax.swing.JTextField();
160
        separator = new javax.swing.JSeparator();
156
        separator = new javax.swing.JSeparator();
Lines 162-179 Link Here
162
158
163
        setLayout(new java.awt.GridBagLayout());
159
        setLayout(new java.awt.GridBagLayout());
164
160
165
        setAsMainCheckBox.setSelected(true);
166
        org.openide.awt.Mnemonics.setLocalizedText(setAsMainCheckBox, org.openide.util.NbBundle.getBundle(PanelOptionsVisual.class).getString("LBL_setAsMainCheckBox")); // NOI18N
167
        setAsMainCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
168
        gridBagConstraints = new java.awt.GridBagConstraints();
169
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
170
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
171
        gridBagConstraints.weightx = 1.0;
172
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 3, 0);
173
        add(setAsMainCheckBox, gridBagConstraints);
174
        setAsMainCheckBox.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getBundle(PanelOptionsVisual.class).getString("ACSN_setAsMainCheckBox")); // NOI18N
175
        setAsMainCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(PanelOptionsVisual.class).getString("ACSD_setAsMainCheckBox")); // NOI18N
176
177
        createMainCheckBox.setSelected(true);
161
        createMainCheckBox.setSelected(true);
178
        org.openide.awt.Mnemonics.setLocalizedText(createMainCheckBox, org.openide.util.NbBundle.getBundle(PanelOptionsVisual.class).getString("LBL_createMainCheckBox")); // NOI18N
162
        org.openide.awt.Mnemonics.setLocalizedText(createMainCheckBox, org.openide.util.NbBundle.getBundle(PanelOptionsVisual.class).getString("LBL_createMainCheckBox")); // NOI18N
179
        createMainCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
163
        createMainCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
Lines 245-251 Link Here
245
229
246
    @Override
230
    @Override
247
    void store( WizardDescriptor d ) {
231
    void store( WizardDescriptor d ) {
248
        d.putProperty(SET_AS_MAIN, setAsMainCheckBox.isSelected() && setAsMainCheckBox.isVisible() ? Boolean.TRUE : Boolean.FALSE );
249
        d.putProperty(MAIN_CLASS, createMainCheckBox.isSelected() && createMainCheckBox.isVisible() ? mainClassTextField.getText() : null );
232
        d.putProperty(MAIN_CLASS, createMainCheckBox.isSelected() && createMainCheckBox.isVisible() ? mainClassTextField.getText() : null );
250
   }
233
   }
251
    
234
    
Lines 254-260 Link Here
254
    private javax.swing.JCheckBox createMainCheckBox;
237
    private javax.swing.JCheckBox createMainCheckBox;
255
    private javax.swing.JTextField mainClassTextField;
238
    private javax.swing.JTextField mainClassTextField;
256
    private javax.swing.JSeparator separator;
239
    private javax.swing.JSeparator separator;
257
    private javax.swing.JCheckBox setAsMainCheckBox;
258
    // End of variables declaration//GEN-END:variables
240
    // End of variables declaration//GEN-END:variables
259
    
241
    
260
    protected void mainClassChanged () {
242
    protected void mainClassChanged () {
(-)a/java.examples/src/org/netbeans/modules/java/examples/Bundle.properties (-3 lines)
Lines 78-83 Link Here
78
LBL_NWP1_SelectProjectLocation=Select Project Location
78
LBL_NWP1_SelectProjectLocation=Select Project Location
79
MSG_IllegalProjectName=Project Name is not valid folder name.
79
MSG_IllegalProjectName=Project Name is not valid folder name.
80
MSG_ProjectFolderExists=Project Folder already exists and is not empty.
80
MSG_ProjectFolderExists=Project Folder already exists and is not empty.
81
LBL_NWP1_SetAsMain_CheckBox=Set as Main Project
82
LBL_NWP1_SetAsMain_CheckBoxMnemonic=M
83
ACS_LBL_NWP1_SetAsMain_A11YDesc=Set as Main Project
(-)a/java.examples/src/org/netbeans/modules/java/examples/PanelConfigureProjectVisual.form (-17 / +3 lines)
Lines 1-6 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
  <Properties>
4
  <Properties>
5
    <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
5
    <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
6
      <Dimension value="[500, 340]"/>
6
      <Dimension value="[500, 340]"/>
Lines 9-14 Link Here
9
  </Properties>
9
  </Properties>
10
  <AuxValues>
10
  <AuxValues>
11
    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
11
    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
12
    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
13
    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
12
    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
14
    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
13
    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
15
    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
14
    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
16
    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
Lines 28-48 Link Here
28
30
29
      <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
31
      <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
30
    </Container>
32
    </Container>
31
    <Component class="javax.swing.JSeparator" name="jSeparator1">
32
      <Constraints>
33
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
34
          <GridBagConstraints gridX="-1" gridY="-1" gridWidth="0" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="12" insetsLeft="0" insetsBottom="12" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
35
        </Constraint>
36
      </Constraints>
37
    </Component>
38
    <Container class="javax.swing.JPanel" name="optionsContainer">
39
      <Constraints>
40
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
41
          <GridBagConstraints gridX="-1" gridY="-1" gridWidth="0" gridHeight="0" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="1.0"/>
42
        </Constraint>
43
      </Constraints>
44
45
      <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
46
    </Container>
47
  </SubComponents>
33
  </SubComponents>
48
</Form>
34
</Form>
(-)a/java.examples/src/org/netbeans/modules/java/examples/PanelConfigureProjectVisual.java (-34 / +6 lines)
Lines 55-61 Link Here
55
    private PanelConfigureProject panel;
55
    private PanelConfigureProject panel;
56
56
57
    private PanelProjectLocationVisual projectLocationPanel;
57
    private PanelProjectLocationVisual projectLocationPanel;
58
    private PanelOptionsVisual optionsPanel;
59
58
60
    /** Creates new form PanelInitProject */
59
    /** Creates new form PanelInitProject */
61
    public PanelConfigureProjectVisual(PanelConfigureProject panel, String title) {
60
    public PanelConfigureProjectVisual(PanelConfigureProject panel, String title) {
Lines 66-91 Link Here
66
        projectLocationPanel = new PanelProjectLocationVisual(panel);
65
        projectLocationPanel = new PanelProjectLocationVisual(panel);
67
        locationContainer.add(projectLocationPanel, java.awt.BorderLayout.NORTH);
66
        locationContainer.add(projectLocationPanel, java.awt.BorderLayout.NORTH);
68
67
69
        optionsPanel = new PanelOptionsVisual(panel);
70
        optionsContainer.add(optionsPanel, java.awt.BorderLayout.NORTH);
71
72
        // Provide a name in the title bar.
68
        // Provide a name in the title bar.
73
        setName(NbBundle.getMessage(PanelConfigureProjectVisual.class, "LBL_NWP1_ProjectTitleName")); //NOI18N
69
        setName(NbBundle.getMessage(PanelConfigureProjectVisual.class, "LBL_NWP1_ProjectTitleName")); //NOI18N
74
        putClientProperty ("NewProjectWizard_Title", title); //NOI18N
70
        putClientProperty ("NewProjectWizard_Title", title); //NOI18N
75
    }
71
    }
76
72
77
    boolean valid(WizardDescriptor wizardDescriptor) {
73
    boolean valid(WizardDescriptor wizardDescriptor) {
78
        return projectLocationPanel.valid(wizardDescriptor) && optionsPanel.valid(wizardDescriptor);
74
        return projectLocationPanel.valid(wizardDescriptor);
79
    }
75
    }
80
76
81
    void read (WizardDescriptor d) {
77
    void read (WizardDescriptor d) {
82
        projectLocationPanel.read(d);
78
        projectLocationPanel.read(d);
83
        optionsPanel.read(d);
84
    }
79
    }
85
80
86
    void store(WizardDescriptor d) {
81
    void store(WizardDescriptor d) {
87
        projectLocationPanel.store(d);
82
        projectLocationPanel.store(d);
88
        optionsPanel.store(d);
89
    }
83
    }
90
84
91
    /** This method is called from within the constructor to
85
    /** This method is called from within the constructor to
Lines 93-140 Link Here
93
     * WARNING: Do NOT modify this code. The content of this method is
87
     * WARNING: Do NOT modify this code. The content of this method is
94
     * always regenerated by the Form Editor.
88
     * always regenerated by the Form Editor.
95
     */
89
     */
96
    private void initComponents() {//GEN-BEGIN:initComponents
90
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
91
    private void initComponents() {
97
        java.awt.GridBagConstraints gridBagConstraints;
92
        java.awt.GridBagConstraints gridBagConstraints;
98
93
99
        locationContainer = new javax.swing.JPanel();
94
        locationContainer = new javax.swing.JPanel();
100
        jSeparator1 = new javax.swing.JSeparator();
101
        optionsContainer = new javax.swing.JPanel();
102
103
        setLayout(new java.awt.GridBagLayout());
104
95
105
        setPreferredSize(new java.awt.Dimension(500, 340));
96
        setPreferredSize(new java.awt.Dimension(500, 340));
106
        setRequestFocusEnabled(false);
97
        setRequestFocusEnabled(false);
98
        setLayout(new java.awt.GridBagLayout());
99
107
        locationContainer.setLayout(new java.awt.BorderLayout());
100
        locationContainer.setLayout(new java.awt.BorderLayout());
108
109
        gridBagConstraints = new java.awt.GridBagConstraints();
101
        gridBagConstraints = new java.awt.GridBagConstraints();
110
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
102
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
111
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
103
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
112
        gridBagConstraints.weightx = 1.0;
104
        gridBagConstraints.weightx = 1.0;
113
        add(locationContainer, gridBagConstraints);
105
        add(locationContainer, gridBagConstraints);
114
106
    }// </editor-fold>//GEN-END:initComponents
115
        gridBagConstraints = new java.awt.GridBagConstraints();
116
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
117
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
118
        gridBagConstraints.weightx = 1.0;
119
        gridBagConstraints.insets = new java.awt.Insets(12, 0, 12, 0);
120
        add(jSeparator1, gridBagConstraints);
121
122
        optionsContainer.setLayout(new java.awt.BorderLayout());
123
124
        gridBagConstraints = new java.awt.GridBagConstraints();
125
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
126
        gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
127
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
128
        gridBagConstraints.weightx = 1.0;
129
        gridBagConstraints.weighty = 1.0;
130
        add(optionsContainer, gridBagConstraints);
131
132
    }//GEN-END:initComponents
133
107
134
    // Variables declaration - do not modify//GEN-BEGIN:variables
108
    // Variables declaration - do not modify//GEN-BEGIN:variables
135
    private javax.swing.JSeparator jSeparator1;
136
    private javax.swing.JPanel locationContainer;
109
    private javax.swing.JPanel locationContainer;
137
    private javax.swing.JPanel optionsContainer;
138
    // End of variables declaration//GEN-END:variables
110
    // End of variables declaration//GEN-END:variables
139
111
140
    /** Help context where to find more about the paste type action.
112
    /** Help context where to find more about the paste type action.
(-)a/java.examples/src/org/netbeans/modules/java/examples/PanelOptionsVisual.form (-50 lines)
Lines 1-50 Link Here
1
<?xml version="1.0" encoding="UTF-8" ?>
2
3
<Form version="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <AuxValues>
5
    <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,2,18,0,0,2,-33"/>
6
  </AuxValues>
7
8
  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
9
  <SubComponents>
10
    <Component class="javax.swing.JCheckBox" name="setAsMainCheckBox">
11
      <Properties>
12
        <Property name="mnemonic" type="int" editor="org.netbeans.modules.i18n.form.FormI18nMnemonicEditor">
13
          <ResourceString bundle="org/netbeans/modules/web/examples/Bundle.properties" key="LBL_NWP1_SetAsMain_CheckBoxMnemonic" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
14
        </Property>
15
        <Property name="selected" type="boolean" value="true"/>
16
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
17
          <ResourceString bundle="org/netbeans/modules/web/examples/Bundle.properties" key="LBL_NWP1_SetAsMain_CheckBox" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
18
        </Property>
19
        <Property name="actionCommand" type="java.lang.String" value="Set as Main Project"/>
20
        <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
21
          <Insets value="[0, 0, 0, 0]"/>
22
        </Property>
23
      </Properties>
24
      <AccessibilityProperties>
25
        <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
26
          <ResourceString bundle="org/netbeans/modules/web/examples/Bundle.properties" key="ACS_LBL_NWP1_SetAsMain_A11YDesc" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
27
        </Property>
28
      </AccessibilityProperties>
29
      <Constraints>
30
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
31
          <GridBagConstraints gridX="0" gridY="0" gridWidth="0" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="11" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
32
        </Constraint>
33
      </Constraints>
34
    </Component>
35
    <Container class="javax.swing.JScrollPane" name="jScrollPane1">
36
      <Properties>
37
        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
38
          <Border info="null"/>
39
        </Property>
40
      </Properties>
41
      <Constraints>
42
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
43
          <GridBagConstraints gridX="-1" gridY="-1" gridWidth="0" gridHeight="0" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="12" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="1.0"/>
44
        </Constraint>
45
      </Constraints>
46
47
      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
48
    </Container>
49
  </SubComponents>
50
</Form>
(-)a/java.examples/src/org/netbeans/modules/java/examples/PanelOptionsVisual.java (-115 lines)
Lines 1-115 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * Contributor(s):
28
 *
29
 * The Original Software is NetBeans. The Initial Developer of the Original
30
 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
31
 * Microsystems, Inc. All Rights Reserved.
32
 *
33
 * If you wish your version of this file to be governed by only the CDDL
34
 * or only the GPL Version 2, indicate your decision by adding
35
 * "[Contributor] elects to include this software in this distribution
36
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
37
 * single choice of license, a recipient has the option to distribute
38
 * your version of this file under either the CDDL, the GPL Version 2 or
39
 * to extend the choice of license to its licensees as provided above.
40
 * However, if you add GPL Version 2 code and therefore, elected the GPL
41
 * Version 2 license, then the option applies only if the new code is
42
 * made subject to such option by the copyright holder.
43
 */
44
45
package org.netbeans.modules.java.examples;
46
47
import org.openide.WizardDescriptor;
48
49
public class PanelOptionsVisual extends javax.swing.JPanel {
50
51
    private PanelConfigureProject panel;
52
53
    /** Creates new form PanelOptionsVisual */
54
    public PanelOptionsVisual(PanelConfigureProject panel) {
55
        initComponents();
56
        this.panel = panel;
57
    }
58
59
    /** This method is called from within the constructor to
60
     * initialize the form.
61
     * WARNING: Do NOT modify this code. The content of this method is
62
     * always regenerated by the Form Editor.
63
     */
64
    private void initComponents() {//GEN-BEGIN:initComponents
65
        java.awt.GridBagConstraints gridBagConstraints;
66
67
        setAsMainCheckBox = new javax.swing.JCheckBox();
68
        jScrollPane1 = new javax.swing.JScrollPane();
69
70
        setLayout(new java.awt.GridBagLayout());
71
72
        setAsMainCheckBox.setMnemonic(org.openide.util.NbBundle.getMessage(PanelOptionsVisual.class, "LBL_NWP1_SetAsMain_CheckBoxMnemonic").charAt(0));
73
        setAsMainCheckBox.setSelected(true);
74
        setAsMainCheckBox.setText(org.openide.util.NbBundle.getMessage(PanelOptionsVisual.class, "LBL_NWP1_SetAsMain_CheckBox"));
75
        setAsMainCheckBox.setActionCommand("Set as Main Project");
76
        setAsMainCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
77
        gridBagConstraints = new java.awt.GridBagConstraints();
78
        gridBagConstraints.gridx = 0;
79
        gridBagConstraints.gridy = 0;
80
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
81
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
82
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 11, 0);
83
        add(setAsMainCheckBox, gridBagConstraints);
84
        setAsMainCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(PanelOptionsVisual.class, "ACS_LBL_NWP1_SetAsMain_A11YDesc"));
85
86
        jScrollPane1.setBorder(null);
87
        gridBagConstraints = new java.awt.GridBagConstraints();
88
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
89
        gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
90
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
91
        gridBagConstraints.weightx = 1.0;
92
        gridBagConstraints.weighty = 1.0;
93
        gridBagConstraints.insets = new java.awt.Insets(0, 12, 0, 0);
94
        add(jScrollPane1, gridBagConstraints);
95
96
    }//GEN-END:initComponents
97
    
98
    boolean valid(WizardDescriptor wizardDescriptor) {
99
        return true;
100
    }
101
102
    void store(WizardDescriptor d) {
103
        d.putProperty(WizardProperties.SET_AS_MAIN, setAsMainCheckBox.isSelected() ? Boolean.TRUE : Boolean.FALSE );
104
    }
105
    
106
    void read(WizardDescriptor d) {
107
    }
108
    
109
    // Variables declaration - do not modify//GEN-BEGIN:variables
110
    private javax.swing.JScrollPane jScrollPane1;
111
    private javax.swing.JCheckBox setAsMainCheckBox;
112
    // End of variables declaration//GEN-END:variables
113
114
}
115
(-)a/java.examples/src/org/netbeans/modules/java/examples/WizardProperties.java (-1 lines)
Lines 49-55 Link Here
49
    public static final String NAME = "name"; //NOI18N
49
    public static final String NAME = "name"; //NOI18N
50
    public static final String SOURCE_ROOT = "sourceRoot"; //NOI18N
50
    public static final String SOURCE_ROOT = "sourceRoot"; //NOI18N
51
51
52
    public static final String SET_AS_MAIN = "setAsMain"; //NOI18N
53
    public static final String J2EE_LEVEL = "j2eeLevel"; //NOI18N
52
    public static final String J2EE_LEVEL = "j2eeLevel"; //NOI18N
54
    public static final String CONTEXT_PATH = "contextPath"; //NOI18N
53
    public static final String CONTEXT_PATH = "contextPath"; //NOI18N
55
54
(-)a/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/resources/layer.xml (-4 lines)
Lines 124-133 Link Here
124
                    <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
124
                    <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
125
                    <attr name="position" intvalue="1300"/>
125
                    <attr name="position" intvalue="1300"/>
126
                </file>
126
                </file>
127
                <file name="org-netbeans-modules-project-ui-SetMainProject.shadow">
128
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-SetMainProject.instance"/>
129
                    <attr name="position" intvalue="1400"/>
130
                </file>
131
                <file name="org-netbeans-modules-project-ui-actions-OpenSubprojects.shadow">
127
                <file name="org-netbeans-modules-project-ui-actions-OpenSubprojects.shadow">
132
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-actions-OpenSubprojects.instance"/>
128
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-actions-OpenSubprojects.instance"/>
133
                    <attr name="position" intvalue="1500"/>
129
                    <attr name="position" intvalue="1500"/>
(-)a/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/wizards/Bundle.properties (-7 lines)
Lines 54-60 Link Here
54
LBL_NWP1_CreatedProjectFolder_Lablel=Project Fol&der\:
54
LBL_NWP1_CreatedProjectFolder_Lablel=Project Fol&der\:
55
LBL_NWP1_CreatedProjectFolder_LablelMnemonic=d
55
LBL_NWP1_CreatedProjectFolder_LablelMnemonic=d
56
LBL_NWP1_CreateMainClass_CheckBoxMnemonic=C
56
LBL_NWP1_CreateMainClass_CheckBoxMnemonic=C
57
LBL_NWP1_SetAsMain_CheckBoxMnemonic=S
58
#NOI18N
57
#NOI18N
59
LBL_NPW1_DefaultProjectName=newProject
58
LBL_NPW1_DefaultProjectName=newProject
60
59
Lines 124-133 Link Here
124
TXT_RootOwnedByProject={0} (owned by {1})
123
TXT_RootOwnedByProject={0} (owned by {1})
125
124
126
125
127
ACSN_setAsMainCheckBox=Set as Main Project
128
129
ACSD_setAsMainCheckBox=N/A
130
131
ACSN_createMainCheckBox=Create Main Class
126
ACSN_createMainCheckBox=Create Main Class
132
127
133
ACSD_createMainCheckBox=Select checkbox to create main class in project.
128
ACSD_createMainCheckBox=Select checkbox to create main class in project.
Lines 136-143 Link Here
136
131
137
ASCD_mainClassTextFiled=N/A
132
ASCD_mainClassTextFiled=N/A
138
133
139
LBL_setAsMainCheckBox=Set as &Main Project
140
141
ACSN_jPanel1=N/A
134
ACSN_jPanel1=N/A
142
135
143
ASCD_jPanel1=N/A
136
ASCD_jPanel1=N/A
(-)a/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/wizards/PanelOptionsVisual.form (-25 / +1 lines)
Lines 1-4 Link Here
1
<?xml version="1.1" encoding="UTF-8" ?>
1
<?xml version="1.0" encoding="UTF-8" ?>
2
2
3
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
3
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <AccessibilityProperties>
4
  <AccessibilityProperties>
Lines 41-50 Link Here
41
              <Component id="btnLibFolder" min="-2" max="-2" attributes="0"/>
41
              <Component id="btnLibFolder" min="-2" max="-2" attributes="0"/>
42
          </Group>
42
          </Group>
43
          <Group type="102" alignment="0" attributes="0">
43
          <Group type="102" alignment="0" attributes="0">
44
              <Component id="setAsMainCheckBox" min="-2" max="-2" attributes="0"/>
45
              <EmptySpace max="-2" attributes="0"/>
46
          </Group>
47
          <Group type="102" alignment="0" attributes="0">
48
              <Component id="createMainCheckBox" min="-2" max="-2" attributes="0"/>
44
              <Component id="createMainCheckBox" min="-2" max="-2" attributes="0"/>
49
              <EmptySpace max="-2" attributes="0"/>
45
              <EmptySpace max="-2" attributes="0"/>
50
              <Component id="mainClassTextField" pref="357" max="32767" attributes="0"/>
46
              <Component id="mainClassTextField" pref="357" max="32767" attributes="0"/>
Lines 68-75 Link Here
68
                  <Component id="createMainCheckBox" alignment="3" min="-2" max="-2" attributes="0"/>
64
                  <Component id="createMainCheckBox" alignment="3" min="-2" max="-2" attributes="0"/>
69
                  <Component id="mainClassTextField" alignment="3" min="-2" max="-2" attributes="0"/>
65
                  <Component id="mainClassTextField" alignment="3" min="-2" max="-2" attributes="0"/>
70
              </Group>
66
              </Group>
71
              <EmptySpace max="-2" attributes="0"/>
72
              <Component id="setAsMainCheckBox" min="-2" max="-2" attributes="0"/>
73
              <EmptySpace max="32767" attributes="0"/>
67
              <EmptySpace max="32767" attributes="0"/>
74
          </Group>
68
          </Group>
75
      </Group>
69
      </Group>
Lines 165-187 Link Here
165
        </Property>
159
        </Property>
166
      </AccessibilityProperties>
160
      </AccessibilityProperties>
167
    </Component>
161
    </Component>
168
    <Component class="javax.swing.JCheckBox" name="setAsMainCheckBox">
169
      <Properties>
170
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
171
          <ResourceString bundle="org/netbeans/modules/java/j2seproject/ui/wizards/Bundle.properties" key="LBL_setAsMainCheckBox" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
172
        </Property>
173
      </Properties>
174
      <AccessibilityProperties>
175
        <Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
176
          <ResourceString bundle="org/netbeans/modules/java/j2seproject/ui/wizards/Bundle.properties" key="ACSN_setAsMainCheckBox" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
177
        </Property>
178
        <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
179
          <ResourceString bundle="org/netbeans/modules/java/j2seproject/ui/wizards/Bundle.properties" key="ACSD_setAsMainCheckBox" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
180
        </Property>
181
      </AccessibilityProperties>
182
      <AuxValues>
183
        <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
184
      </AuxValues>
185
    </Component>
186
  </SubComponents>
162
  </SubComponents>
187
</Form>
163
</Form>
(-)a/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/wizards/PanelOptionsVisual.java (-16 lines)
Lines 56-62 Link Here
56
import org.netbeans.api.queries.CollocationQuery;
56
import org.netbeans.api.queries.CollocationQuery;
57
import org.netbeans.spi.java.project.support.ui.SharableLibrariesUtils;
57
import org.netbeans.spi.java.project.support.ui.SharableLibrariesUtils;
58
import org.netbeans.spi.project.support.ant.PropertyUtils;
58
import org.netbeans.spi.project.support.ant.PropertyUtils;
59
import org.netbeans.spi.project.ui.templates.support.Templates;
60
import org.openide.WizardDescriptor;
59
import org.openide.WizardDescriptor;
61
import org.openide.WizardValidationException;
60
import org.openide.WizardValidationException;
62
import org.openide.filesystems.FileUtil;
61
import org.openide.filesystems.FileUtil;
Lines 90-96 Link Here
90
89
91
        switch (type) {
90
        switch (type) {
92
            case LIB:
91
            case LIB:
93
                setAsMainCheckBox.setVisible( false );
94
                createMainCheckBox.setVisible( false );
92
                createMainCheckBox.setVisible( false );
95
                mainClassTextField.setVisible( false );
93
                mainClassTextField.setVisible( false );
96
                break;
94
                break;
Lines 105-111 Link Here
105
                break;
103
                break;
106
        }
104
        }
107
        
105
        
108
        setAsMainCheckBox.setSelected(WizardSettings.getSetAsMain(type));
109
        this.mainClassTextField.getDocument().addDocumentListener( new DocumentListener () {
106
        this.mainClassTextField.getDocument().addDocumentListener( new DocumentListener () {
110
            
107
            
111
            @Override
108
            @Override
Lines 241-247 Link Here
241
        lblHint = new javax.swing.JLabel();
238
        lblHint = new javax.swing.JLabel();
242
        createMainCheckBox = new javax.swing.JCheckBox();
239
        createMainCheckBox = new javax.swing.JCheckBox();
243
        mainClassTextField = new javax.swing.JTextField();
240
        mainClassTextField = new javax.swing.JTextField();
244
        setAsMainCheckBox = new javax.swing.JCheckBox();
245
241
246
        cbSharable.setSelected(SharableLibrariesUtils.isLastProjectSharable());
242
        cbSharable.setSelected(SharableLibrariesUtils.isLastProjectSharable());
247
        org.openide.awt.Mnemonics.setLocalizedText(cbSharable, org.openide.util.NbBundle.getMessage(PanelOptionsVisual.class, "LBL_PanelOptions_SharableProject_Checkbox")); // NOI18N
243
        org.openide.awt.Mnemonics.setLocalizedText(cbSharable, org.openide.util.NbBundle.getMessage(PanelOptionsVisual.class, "LBL_PanelOptions_SharableProject_Checkbox")); // NOI18N
Lines 268-275 Link Here
268
264
269
        mainClassTextField.setText("com.myapp.Main");
265
        mainClassTextField.setText("com.myapp.Main");
270
266
271
        org.openide.awt.Mnemonics.setLocalizedText(setAsMainCheckBox, org.openide.util.NbBundle.getBundle(PanelOptionsVisual.class).getString("LBL_setAsMainCheckBox")); // NOI18N
272
273
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
267
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
274
        this.setLayout(layout);
268
        this.setLayout(layout);
275
        layout.setHorizontalGroup(
269
        layout.setHorizontalGroup(
Lines 287-295 Link Here
287
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
281
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
288
                .addComponent(btnLibFolder))
282
                .addComponent(btnLibFolder))
289
            .addGroup(layout.createSequentialGroup()
283
            .addGroup(layout.createSequentialGroup()
290
                .addComponent(setAsMainCheckBox)
291
                .addContainerGap())
292
            .addGroup(layout.createSequentialGroup()
293
                .addComponent(createMainCheckBox)
284
                .addComponent(createMainCheckBox)
294
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
285
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
295
                .addComponent(mainClassTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 357, Short.MAX_VALUE))
286
                .addComponent(mainClassTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 357, Short.MAX_VALUE))
Lines 309-316 Link Here
309
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
300
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
310
                    .addComponent(createMainCheckBox)
301
                    .addComponent(createMainCheckBox)
311
                    .addComponent(mainClassTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
302
                    .addComponent(mainClassTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
312
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
313
                .addComponent(setAsMainCheckBox)
314
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
303
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
315
        );
304
        );
316
305
Lines 321-328 Link Here
321
        createMainCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(PanelOptionsVisual.class).getString("ACSD_createMainCheckBox")); // NOI18N
310
        createMainCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(PanelOptionsVisual.class).getString("ACSD_createMainCheckBox")); // NOI18N
322
        mainClassTextField.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getBundle(PanelOptionsVisual.class).getString("ASCN_mainClassTextFiled")); // NOI18N
311
        mainClassTextField.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getBundle(PanelOptionsVisual.class).getString("ASCN_mainClassTextFiled")); // NOI18N
323
        mainClassTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(PanelOptionsVisual.class).getString("ASCD_mainClassTextFiled")); // NOI18N
312
        mainClassTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(PanelOptionsVisual.class).getString("ASCD_mainClassTextFiled")); // NOI18N
324
        setAsMainCheckBox.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getBundle(PanelOptionsVisual.class).getString("ACSN_setAsMainCheckBox")); // NOI18N
325
        setAsMainCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(PanelOptionsVisual.class).getString("ACSD_setAsMainCheckBox")); // NOI18N
326
313
327
        getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(PanelOptionsVisual.class, "ACSN_PanelOptionsVisual")); // NOI18N
314
        getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(PanelOptionsVisual.class, "ACSN_PanelOptionsVisual")); // NOI18N
328
        getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(PanelOptionsVisual.class, "ACSD_PanelOptionsVisual")); // NOI18N
315
        getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(PanelOptionsVisual.class, "ACSD_PanelOptionsVisual")); // NOI18N
Lines 408-415 Link Here
408
395
409
    @Override
396
    @Override
410
    void store( WizardDescriptor d ) {
397
    void store( WizardDescriptor d ) {
411
        Templates.setDefinesMainProject(d, setAsMainCheckBox.isSelected());
412
        WizardSettings.setSetAsMain(type, setAsMainCheckBox.isSelected());
413
        d.putProperty( /*XXX Define somewhere */ MAIN_CLASS, createMainCheckBox.isSelected() && createMainCheckBox.isVisible() ? mainClassTextField.getText() : null ); // NOI18N
398
        d.putProperty( /*XXX Define somewhere */ MAIN_CLASS, createMainCheckBox.isSelected() && createMainCheckBox.isVisible() ? mainClassTextField.getText() : null ); // NOI18N
414
        d.putProperty( SHARED_LIBRARIES, cbSharable.isSelected() ? txtLibFolder.getText() : null ); // NOI18N
399
        d.putProperty( SHARED_LIBRARIES, cbSharable.isSelected() ? txtLibFolder.getText() : null ); // NOI18N
415
    }
400
    }
Lines 421-427 Link Here
421
    private javax.swing.JLabel lblHint;
406
    private javax.swing.JLabel lblHint;
422
    private javax.swing.JLabel lblLibFolder;
407
    private javax.swing.JLabel lblLibFolder;
423
    private javax.swing.JTextField mainClassTextField;
408
    private javax.swing.JTextField mainClassTextField;
424
    private javax.swing.JCheckBox setAsMainCheckBox;
425
    private javax.swing.JTextField txtLibFolder;
409
    private javax.swing.JTextField txtLibFolder;
426
    // End of variables declaration//GEN-END:variables
410
    // End of variables declaration//GEN-END:variables
427
    
411
    
(-)a/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/wizards/WizardSettings.java (-11 lines)
Lines 45-51 Link Here
45
package org.netbeans.modules.java.j2seproject.ui.wizards;
45
package org.netbeans.modules.java.j2seproject.ui.wizards;
46
46
47
import java.util.prefs.Preferences;
47
import java.util.prefs.Preferences;
48
import org.netbeans.modules.java.j2seproject.ui.wizards.NewJ2SEProjectWizardIterator.WizardType;
49
import org.openide.util.NbPreferences;
48
import org.openide.util.NbPreferences;
50
49
51
/**
50
/**
Lines 61-68 Link Here
61
60
62
    private static final String NEW_LIB_COUNT = "newLibraryCount"; //NOI18N
61
    private static final String NEW_LIB_COUNT = "newLibraryCount"; //NOI18N
63
62
64
    private static final String SET_AS_MAIN = "setAsMain."; // NOI18N
65
    
66
    private static Preferences getPreferences() {
63
    private static Preferences getPreferences() {
67
        return NbPreferences.forModule(WizardSettings.class);
64
        return NbPreferences.forModule(WizardSettings.class);
68
    }
65
    }
Lines 91-102 Link Here
91
        getPreferences().putInt(NEW_LIB_COUNT, count);
88
        getPreferences().putInt(NEW_LIB_COUNT, count);
92
    }
89
    }
93
90
94
    public static boolean getSetAsMain(WizardType wizardType) {
95
        return getPreferences().getBoolean(SET_AS_MAIN + wizardType, wizardType != WizardType.LIB);
96
    }
97
98
    public static void setSetAsMain(WizardType wizardType, boolean setAsMain) {
99
        getPreferences().putBoolean(SET_AS_MAIN + wizardType, setAsMain);
100
    }
101
102
}
91
}
(-)a/java.project/test/qa-functional/src/projects/apitest/Utilities.java (-2 lines)
Lines 80-87 Link Here
80
                public void run() {
80
                public void run() {
81
                    OpenProjects.getDefault().addPropertyChangeListener(listener);
81
                    OpenProjects.getDefault().addPropertyChangeListener(listener);
82
                    OpenProjects.getDefault().open(new Project[]{project},false);
82
                    OpenProjects.getDefault().open(new Project[]{project},false);
83
                    // Set main? Probably user should do this if he wants.
84
                    // OpenProjectList.getDefault().setMainProject(project);
85
                }
83
                }
86
            });
84
            });
87
            // WAIT PROJECT OPEN - start
85
            // WAIT PROJECT OPEN - start
(-)a/javacard.project/src/org/netbeans/modules/javacard/project/JCLogicalViewProvider.java (-1 lines)
Lines 238-244 Link Here
238
            }
238
            }
239
//            actions.add(CommonProjectActions.setProjectConfigurationAction());
239
//            actions.add(CommonProjectActions.setProjectConfigurationAction());
240
            actions.add(null);
240
            actions.add(null);
241
            actions.add(CommonProjectActions.setAsMainProjectAction());
242
            actions.add(CommonProjectActions.closeProjectAction());
241
            actions.add(CommonProjectActions.closeProjectAction());
243
            actions.add(null);
242
            actions.add(null);
244
            actions.add(CommonProjectActions.renameProjectAction());
243
            actions.add(CommonProjectActions.renameProjectAction());
(-)a/javacard.project/src/org/netbeans/modules/javacard/wizard/Bundle.properties (-1 lines)
Lines 51-57 Link Here
51
PROJECT_LOCATION=Project &Location
51
PROJECT_LOCATION=Project &Location
52
BROWSE=Br&owse...
52
BROWSE=Br&owse...
53
PROJECT_FOLDER=Project &Folder
53
PROJECT_FOLDER=Project &Folder
54
SET_AS_MAIN_PROJECT=Set as Main Project
55
yourpackagename=com.foo.yourproject
54
yourpackagename=com.foo.yourproject
56
WEB_CONTEXT_PATH=Web Context Path
55
WEB_CONTEXT_PATH=Web Context Path
57
APPLET_AID=Applet AID
56
APPLET_AID=Applet AID
(-)a/javacard.project/src/org/netbeans/modules/javacard/wizard/ProjectDefinitionPanel.form (-12 lines)
Lines 114-131 Link Here
114
        </Constraint>
114
        </Constraint>
115
      </Constraints>
115
      </Constraints>
116
    </Component>
116
    </Component>
117
    <Component class="javax.swing.JCheckBox" name="setAsMainProjectCheckBox">
118
      <Properties>
119
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
120
          <ResourceString bundle="org/netbeans/modules/javacard/project/ui/Bundle.properties" key="SET_AS_MAIN_PROJECT" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
121
        </Property>
122
      </Properties>
123
      <Constraints>
124
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
125
          <GridBagConstraints gridX="3" gridY="7" gridWidth="0" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="5" anchor="22" weightX="0.0" weightY="0.0"/>
126
        </Constraint>
127
      </Constraints>
128
    </Component>
129
    <Component class="javax.swing.JTextField" name="packageNameTextField">
117
    <Component class="javax.swing.JTextField" name="packageNameTextField">
130
      <Properties>
118
      <Properties>
131
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
119
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
(-)a/javacard.project/src/org/netbeans/modules/javacard/wizard/ProjectDefinitionPanel.java (-11 lines)
Lines 146-152 Link Here
146
        createdFolderLabel = new javax.swing.JLabel();
146
        createdFolderLabel = new javax.swing.JLabel();
147
        createdFolderTextField = new javax.swing.JTextField();
147
        createdFolderTextField = new javax.swing.JTextField();
148
        jSeparator1 = new javax.swing.JSeparator();
148
        jSeparator1 = new javax.swing.JSeparator();
149
        setAsMainProjectCheckBox = new javax.swing.JCheckBox();
150
        packageNameTextField = new javax.swing.JTextField();
149
        packageNameTextField = new javax.swing.JTextField();
151
        webContextPathLabel = new javax.swing.JLabel();
150
        webContextPathLabel = new javax.swing.JLabel();
152
        webContextPathField = new javax.swing.JTextField();
151
        webContextPathField = new javax.swing.JTextField();
Lines 233-247 Link Here
233
        gridBagConstraints.insets = new java.awt.Insets(12, 0, 5, 0);
232
        gridBagConstraints.insets = new java.awt.Insets(12, 0, 5, 0);
234
        add(jSeparator1, gridBagConstraints);
233
        add(jSeparator1, gridBagConstraints);
235
234
236
        org.openide.awt.Mnemonics.setLocalizedText(setAsMainProjectCheckBox, org.openide.util.NbBundle.getMessage(ProjectDefinitionPanel.class, "SET_AS_MAIN_PROJECT")); // NOI18N
237
        gridBagConstraints = new java.awt.GridBagConstraints();
238
        gridBagConstraints.gridx = 3;
239
        gridBagConstraints.gridy = 7;
240
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
241
        gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
242
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
243
        add(setAsMainProjectCheckBox, gridBagConstraints);
244
245
        packageNameTextField.setText(org.openide.util.NbBundle.getMessage(ProjectDefinitionPanel.class, "yourpackagename")); // NOI18N
235
        packageNameTextField.setText(org.openide.util.NbBundle.getMessage(ProjectDefinitionPanel.class, "yourpackagename")); // NOI18N
246
        gridBagConstraints = new java.awt.GridBagConstraints();
236
        gridBagConstraints = new java.awt.GridBagConstraints();
247
        gridBagConstraints.gridx = 1;
237
        gridBagConstraints.gridx = 1;
Lines 361-367 Link Here
361
    private javax.swing.JTextField projectNameTextField;
351
    private javax.swing.JTextField projectNameTextField;
362
    private javax.swing.JTextField servletMappingField;
352
    private javax.swing.JTextField servletMappingField;
363
    private javax.swing.JLabel servletMappingLabel;
353
    private javax.swing.JLabel servletMappingLabel;
364
    private javax.swing.JCheckBox setAsMainProjectCheckBox;
365
    private javax.swing.JTextField webContextPathField;
354
    private javax.swing.JTextField webContextPathField;
366
    private javax.swing.JLabel webContextPathLabel;
355
    private javax.swing.JLabel webContextPathLabel;
367
    // End of variables declaration//GEN-END:variables
356
    // End of variables declaration//GEN-END:variables
(-)a/javafx2.project/src/org/netbeans/modules/javafx2/project/Bundle.properties (-7 lines)
Lines 26-32 Link Here
26
LBL_NWP1_CreatedProjectFolder_Lablel=Project Fol&der\:
26
LBL_NWP1_CreatedProjectFolder_Lablel=Project Fol&der\:
27
LBL_NWP1_CreatedProjectFolder_LablelMnemonic=d
27
LBL_NWP1_CreatedProjectFolder_LablelMnemonic=d
28
LBL_NWP1_CreateMainClass_CheckBoxMnemonic=C
28
LBL_NWP1_CreateMainClass_CheckBoxMnemonic=C
29
LBL_NWP1_SetAsMain_CheckBoxMnemonic=S
30
#NOI18N
29
#NOI18N
31
LBL_NPW1_DefaultProjectName=newProject
30
LBL_NPW1_DefaultProjectName=newProject
32
31
Lines 106-115 Link Here
106
TXT_RootOwnedByProject={0} (owned by {1})
105
TXT_RootOwnedByProject={0} (owned by {1})
107
106
108
107
109
ACSN_setAsMainCheckBox=Set as Main Project
110
111
ACSD_setAsMainCheckBox=N/A
112
113
ACSN_createMainCheckBox=Create Application Class
108
ACSN_createMainCheckBox=Create Application Class
114
109
115
ACSD_createMainCheckBox=Select checkbox to create application class in project.
110
ACSD_createMainCheckBox=Select checkbox to create application class in project.
Lines 120-127 Link Here
120
115
121
ASCD_mainClassTextFiled=N/A
116
ASCD_mainClassTextFiled=N/A
122
117
123
LBL_setAsMainCheckBox=&Set as Main Project
124
125
ACSN_jPanel1=N/A
118
ACSN_jPanel1=N/A
126
119
127
ASCD_jPanel1=N/A
120
ASCD_jPanel1=N/A
(-)a/javafx2.project/src/org/netbeans/modules/javafx2/project/JavaFXProjectWizardIterator.java (-4 / +1 lines)
Lines 277-283 Link Here
277
        }
277
        }
278
        handle.progress(3);
278
        handle.progress(3);
279
279
280
        // add main project dir before preloader one to keep it selected as main
281
        resultSet.add(dir);
280
        resultSet.add(dir);
282
        
281
        
283
        // create preloader project
282
        // create preloader project
Lines 305-311 Link Here
305
        }
304
        }
306
        
305
        
307
        // Returning FileObject of project directory. 
306
        // Returning FileObject of project directory. 
308
        // Project will be open and set as main
307
        // Project will be opened
309
        int ind = (Integer) wiz.getProperty(PROP_NAME_INDEX);
308
        int ind = (Integer) wiz.getProperty(PROP_NAME_INDEX);
310
        switch (type) {
309
        switch (type) {
311
            case APPLICATION:
310
            case APPLICATION:
Lines 321-328 Link Here
321
                WizardSettings.setNewProjectCount(ind);
320
                WizardSettings.setNewProjectCount(ind);
322
                break;
321
                break;
323
        }
322
        }
324
//        Project project = ProjectManager.getDefault().findProject(dir);
325
//        OpenProjects.getDefault().setMainProject(project);
326
        
323
        
327
        handle.progress(NbBundle.getMessage(JavaFXProjectWizardIterator.class,
324
        handle.progress(NbBundle.getMessage(JavaFXProjectWizardIterator.class,
328
                "LBL_NewJ2SEProjectWizardIterator_WizardProgress_PreparingToOpen"), 5); // NOI18N
325
                "LBL_NewJ2SEProjectWizardIterator_WizardProgress_PreparingToOpen"), 5); // NOI18N
(-)a/javafx2.project/src/org/netbeans/modules/javafx2/project/PanelOptionsVisual.form (-32 / +4 lines)
Lines 73-89 Link Here
73
                  </Group>
73
                  </Group>
74
                  <Group type="102" alignment="0" attributes="0">
74
                  <Group type="102" alignment="0" attributes="0">
75
                      <EmptySpace max="-2" attributes="0"/>
75
                      <EmptySpace max="-2" attributes="0"/>
76
                      <Group type="103" groupAlignment="0" attributes="0">
76
                      <Component id="createMainCheckBox" min="-2" max="-2" attributes="0"/>
77
                          <Group type="102" alignment="0" attributes="0">
77
                      <EmptySpace max="-2" attributes="0"/>
78
                              <Component id="createMainCheckBox" min="-2" max="-2" attributes="0"/>
78
                      <Component id="mainClassTextField" pref="412" max="32767" attributes="0"/>
79
                              <EmptySpace max="-2" attributes="0"/>
80
                              <Component id="mainClassTextField" pref="412" max="32767" attributes="0"/>
81
                          </Group>
82
                          <Group type="102" alignment="0" attributes="0">
83
                              <Component id="setAsMainCheckBox" min="-2" max="-2" attributes="0"/>
84
                              <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
85
                          </Group>
86
                      </Group>
87
                  </Group>
79
                  </Group>
88
              </Group>
80
              </Group>
89
              <EmptySpace max="-2" attributes="0"/>
81
              <EmptySpace max="-2" attributes="0"/>
Lines 129-137 Link Here
129
                  <Component id="createMainCheckBox" alignment="3" min="-2" max="-2" attributes="0"/>
121
                  <Component id="createMainCheckBox" alignment="3" min="-2" max="-2" attributes="0"/>
130
                  <Component id="mainClassTextField" alignment="3" min="-2" max="-2" attributes="0"/>
122
                  <Component id="mainClassTextField" alignment="3" min="-2" max="-2" attributes="0"/>
131
              </Group>
123
              </Group>
132
              <EmptySpace type="unrelated" max="-2" attributes="0"/>
124
              <EmptySpace pref="25" max="32767" attributes="0"/>
133
              <Component id="setAsMainCheckBox" min="-2" max="-2" attributes="0"/>
134
              <EmptySpace pref="11" max="32767" attributes="0"/>
135
          </Group>
125
          </Group>
136
      </Group>
126
      </Group>
137
    </DimensionLayout>
127
    </DimensionLayout>
Lines 229-252 Link Here
229
        </Property>
219
        </Property>
230
      </AccessibilityProperties>
220
      </AccessibilityProperties>
231
    </Component>
221
    </Component>
232
    <Component class="javax.swing.JCheckBox" name="setAsMainCheckBox">
233
      <Properties>
234
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
235
          <ResourceString bundle="org/netbeans/modules/javafx2/project/Bundle.properties" key="LBL_setAsMainCheckBox" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
236
        </Property>
237
      </Properties>
238
      <AccessibilityProperties>
239
        <Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
240
          <ResourceString bundle="org/netbeans/modules/javafx2/project/Bundle.properties" key="ACSN_setAsMainCheckBox" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
241
        </Property>
242
        <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
243
          <ResourceString bundle="org/netbeans/modules/javafx2/project/Bundle.properties" key="ACSD_setAsMainCheckBox" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
244
        </Property>
245
      </AccessibilityProperties>
246
      <AuxValues>
247
        <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
248
      </AuxValues>
249
    </Component>
250
    <Component class="javax.swing.JLabel" name="lblPlatform">
222
    <Component class="javax.swing.JLabel" name="lblPlatform">
251
      <Properties>
223
      <Properties>
252
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
224
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
(-)a/javafx2.project/src/org/netbeans/modules/javafx2/project/PanelOptionsVisual.java (-21 / +3 lines)
Lines 65-71 Link Here
65
import org.netbeans.modules.javafx2.project.api.JavaFXProjectUtils;
65
import org.netbeans.modules.javafx2.project.api.JavaFXProjectUtils;
66
import org.netbeans.spi.java.project.support.ui.SharableLibrariesUtils;
66
import org.netbeans.spi.java.project.support.ui.SharableLibrariesUtils;
67
import org.netbeans.spi.project.support.ant.PropertyUtils;
67
import org.netbeans.spi.project.support.ant.PropertyUtils;
68
import org.netbeans.spi.project.ui.templates.support.Templates;
69
import org.openide.WizardDescriptor;
68
import org.openide.WizardDescriptor;
70
import org.openide.WizardValidationException;
69
import org.openide.WizardValidationException;
71
import org.openide.awt.Mnemonics;
70
import org.openide.awt.Mnemonics;
Lines 132-138 Link Here
132
131
133
        switch (type) {
132
        switch (type) {
134
            case LIBRARY:
133
            case LIBRARY:
135
                setAsMainCheckBox.setVisible(false);
136
                createMainCheckBox.setVisible(false);
134
                createMainCheckBox.setVisible(false);
137
                mainClassTextField.setVisible(false);
135
                mainClassTextField.setVisible(false);
138
                preloaderCheckBox.setVisible(false);
136
                preloaderCheckBox.setVisible(false);
Lines 185-191 Link Here
185
                break;
183
                break;
186
        }
184
        }
187
185
188
        setAsMainCheckBox.setSelected(WizardSettings.getSetAsMain(type));
189
        mainClassTextField.getDocument().addDocumentListener(this);
186
        mainClassTextField.getDocument().addDocumentListener(this);
190
        txtLibFolder.getDocument().addDocumentListener(this);
187
        txtLibFolder.getDocument().addDocumentListener(this);
191
        txtPreloaderProject.getDocument().addDocumentListener(this);
188
        txtPreloaderProject.getDocument().addDocumentListener(this);
Lines 328-334 Link Here
328
        lblHint = new javax.swing.JLabel();
325
        lblHint = new javax.swing.JLabel();
329
        createMainCheckBox = new javax.swing.JCheckBox();
326
        createMainCheckBox = new javax.swing.JCheckBox();
330
        mainClassTextField = new javax.swing.JTextField();
327
        mainClassTextField = new javax.swing.JTextField();
331
        setAsMainCheckBox = new javax.swing.JCheckBox();
332
        lblPlatform = new javax.swing.JLabel();
328
        lblPlatform = new javax.swing.JLabel();
333
        platformComboBox = new javax.swing.JComboBox();
329
        platformComboBox = new javax.swing.JComboBox();
334
        btnManagePlatforms = new javax.swing.JButton();
330
        btnManagePlatforms = new javax.swing.JButton();
Lines 369-376 Link Here
369
365
370
        mainClassTextField.setText("com.myapp.Main");
366
        mainClassTextField.setText("com.myapp.Main");
371
367
372
        org.openide.awt.Mnemonics.setLocalizedText(setAsMainCheckBox, org.openide.util.NbBundle.getBundle(PanelOptionsVisual.class).getString("LBL_setAsMainCheckBox")); // NOI18N
373
374
        lblPlatform.setLabelFor(platformComboBox);
368
        lblPlatform.setLabelFor(platformComboBox);
375
        org.openide.awt.Mnemonics.setLocalizedText(lblPlatform, org.openide.util.NbBundle.getMessage(PanelOptionsVisual.class, "LBL_PanelOptions_Platform_ComboBox")); // NOI18N
369
        org.openide.awt.Mnemonics.setLocalizedText(lblPlatform, org.openide.util.NbBundle.getMessage(PanelOptionsVisual.class, "LBL_PanelOptions_Platform_ComboBox")); // NOI18N
376
370
Lines 452-465 Link Here
452
                        .addGap(0, 0, Short.MAX_VALUE))
446
                        .addGap(0, 0, Short.MAX_VALUE))
453
                    .addGroup(layout.createSequentialGroup()
447
                    .addGroup(layout.createSequentialGroup()
454
                        .addContainerGap()
448
                        .addContainerGap()
455
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
449
                        .addComponent(createMainCheckBox)
456
                            .addGroup(layout.createSequentialGroup()
450
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
457
                                .addComponent(createMainCheckBox)
451
                        .addComponent(mainClassTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 412, Short.MAX_VALUE)))
458
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
459
                                .addComponent(mainClassTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 412, Short.MAX_VALUE))
460
                            .addGroup(layout.createSequentialGroup()
461
                                .addComponent(setAsMainCheckBox)
462
                                .addGap(0, 0, Short.MAX_VALUE)))))
463
                .addContainerGap())
452
                .addContainerGap())
464
        );
453
        );
465
        layout.setVerticalGroup(
454
        layout.setVerticalGroup(
Lines 495-502 Link Here
495
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
484
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
496
                    .addComponent(createMainCheckBox)
485
                    .addComponent(createMainCheckBox)
497
                    .addComponent(mainClassTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
486
                    .addComponent(mainClassTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
498
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
499
                .addComponent(setAsMainCheckBox)
500
                .addContainerGap(25, Short.MAX_VALUE))
487
                .addContainerGap(25, Short.MAX_VALUE))
501
        );
488
        );
502
489
Lines 507-514 Link Here
507
        createMainCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(PanelOptionsVisual.class).getString("ACSD_createMainCheckBox")); // NOI18N
494
        createMainCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(PanelOptionsVisual.class).getString("ACSD_createMainCheckBox")); // NOI18N
508
        mainClassTextField.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getBundle(PanelOptionsVisual.class).getString("ASCN_mainClassTextFiled")); // NOI18N
495
        mainClassTextField.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getBundle(PanelOptionsVisual.class).getString("ASCN_mainClassTextFiled")); // NOI18N
509
        mainClassTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(PanelOptionsVisual.class).getString("ASCD_mainClassTextFiled")); // NOI18N
496
        mainClassTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(PanelOptionsVisual.class).getString("ASCD_mainClassTextFiled")); // NOI18N
510
        setAsMainCheckBox.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getBundle(PanelOptionsVisual.class).getString("ACSN_setAsMainCheckBox")); // NOI18N
511
        setAsMainCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(PanelOptionsVisual.class).getString("ACSD_setAsMainCheckBox")); // NOI18N
512
497
513
        getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(PanelOptionsVisual.class, "ACSN_PanelOptionsVisual")); // NOI18N
498
        getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(PanelOptionsVisual.class, "ACSN_PanelOptionsVisual")); // NOI18N
514
        getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(PanelOptionsVisual.class, "ACSD_PanelOptionsVisual")); // NOI18N
499
        getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(PanelOptionsVisual.class, "ACSD_PanelOptionsVisual")); // NOI18N
Lines 619-626 Link Here
619
604
620
    @Override
605
    @Override
621
    void store(WizardDescriptor d) {
606
    void store(WizardDescriptor d) {
622
        Templates.setDefinesMainProject(d, setAsMainCheckBox.isSelected());
623
        WizardSettings.setSetAsMain(type, setAsMainCheckBox.isSelected());
624
        d.putProperty(JavaFXProjectWizardIterator.MAIN_CLASS, createMainCheckBox.isSelected() && createMainCheckBox.isVisible() ? mainClassTextField.getText() : null);
607
        d.putProperty(JavaFXProjectWizardIterator.MAIN_CLASS, createMainCheckBox.isSelected() && createMainCheckBox.isVisible() ? mainClassTextField.getText() : null);
625
        d.putProperty(JavaFXProjectWizardIterator.SHARED_LIBRARIES, cbSharable.isSelected() ? txtLibFolder.getText() : null);
608
        d.putProperty(JavaFXProjectWizardIterator.SHARED_LIBRARIES, cbSharable.isSelected() ? txtLibFolder.getText() : null);
626
        
609
        
Lines 651-657 Link Here
651
    private javax.swing.JTextField mainClassTextField;
634
    private javax.swing.JTextField mainClassTextField;
652
    private javax.swing.JComboBox platformComboBox;
635
    private javax.swing.JComboBox platformComboBox;
653
    private javax.swing.JCheckBox preloaderCheckBox;
636
    private javax.swing.JCheckBox preloaderCheckBox;
654
    private javax.swing.JCheckBox setAsMainCheckBox;
655
    private javax.swing.JTextField txtLibFolder;
637
    private javax.swing.JTextField txtLibFolder;
656
    private javax.swing.JTextField txtPreloaderProject;
638
    private javax.swing.JTextField txtPreloaderProject;
657
    // End of variables declaration//GEN-END:variables
639
    // End of variables declaration//GEN-END:variables
(-)a/javafx2.project/src/org/netbeans/modules/javafx2/project/WizardSettings.java (-9 lines)
Lines 44-50 Link Here
44
package org.netbeans.modules.javafx2.project;
44
package org.netbeans.modules.javafx2.project;
45
45
46
import java.util.prefs.Preferences;
46
import java.util.prefs.Preferences;
47
import org.netbeans.modules.javafx2.project.JavaFXProjectWizardIterator.WizardType;
48
import org.openide.util.NbPreferences;
47
import org.openide.util.NbPreferences;
49
48
50
/**
49
/**
Lines 55-61 Link Here
55
    private static final String NEW_PROJECT_COUNT = "newProjectCount"; // NOI18N
54
    private static final String NEW_PROJECT_COUNT = "newProjectCount"; // NOI18N
56
    private static final String NEW_APP_COUNT = "newApplicationCount";  // NOI18N
55
    private static final String NEW_APP_COUNT = "newApplicationCount";  // NOI18N
57
    private static final String NEW_LIB_COUNT = "newLibraryCount"; // NOI18N
56
    private static final String NEW_LIB_COUNT = "newLibraryCount"; // NOI18N
58
    private static final String SET_AS_MAIN = "setAsMain."; // NOI18N
59
57
60
    private WizardSettings() {
58
    private WizardSettings() {
61
    }
59
    }
Lines 88-98 Link Here
88
        getPreferences().putInt(NEW_LIB_COUNT, count);
86
        getPreferences().putInt(NEW_LIB_COUNT, count);
89
    }
87
    }
90
88
91
    static boolean getSetAsMain(WizardType wizardType) {
92
        return getPreferences().getBoolean(SET_AS_MAIN + wizardType, wizardType != WizardType.LIBRARY);
93
    }
94
95
    static void setSetAsMain(WizardType wizardType, boolean setAsMain) {
96
        getPreferences().putBoolean(SET_AS_MAIN + wizardType, setAsMain);
97
    }
98
}
89
}
(-)a/javafx2.samples/src/org/netbeans/modules/javafx2/samples/Bundle.properties (-3 lines)
Lines 105-113 Link Here
105
LBL_NWP1_SelectProjectLocation=Select Project Location
105
LBL_NWP1_SelectProjectLocation=Select Project Location
106
MSG_IllegalProjectName=Project Name is not valid folder name.
106
MSG_IllegalProjectName=Project Name is not valid folder name.
107
MSG_ProjectFolderExists=Project Folder already exists and is not empty.
107
MSG_ProjectFolderExists=Project Folder already exists and is not empty.
108
LBL_NWP1_SetAsMain_CheckBox=Set as Main Project
109
LBL_NWP1_SetAsMain_CheckBoxMnemonic=M
110
ACS_LBL_NWP1_SetAsMain_A11YDesc=Set as Main Project
111
LBL_Platform_ComboBox=JavaFX Platform:
108
LBL_Platform_ComboBox=JavaFX Platform:
112
WARN_PanelOptionsVisual.notFXPlatform=<html><b>Selected Java platform does not have JavaFX support.</b><br>Please create new Java Platform and point it to JavaFX SDK.<br>JavaFX SDK can be downloaded from <a href='http://www.oracle.com/technetwork/java/javafx/downloads'>JavaFX website</a>.<html>
109
WARN_PanelOptionsVisual.notFXPlatform=<html><b>Selected Java platform does not have JavaFX support.</b><br>Please create new Java Platform and point it to JavaFX SDK.<br>JavaFX SDK can be downloaded from <a href='http://www.oracle.com/technetwork/java/javafx/downloads'>JavaFX website</a>.<html>
113
LBL_PanelOptions_Manage_Button=Manage Platforms...
110
LBL_PanelOptions_Manage_Button=Manage Platforms...
(-)a/javafx2.samples/src/org/netbeans/modules/javafx2/samples/PanelOptionsVisual.form (-28 / +5 lines)
Lines 1-4 Link Here
1
<?xml version="1.1" encoding="UTF-8" ?>
1
<?xml version="1.0" encoding="UTF-8" ?>
2
2
3
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
3
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <AuxValues>
4
  <AuxValues>
Lines 18-31 Link Here
18
      <Group type="103" groupAlignment="0" attributes="0">
18
      <Group type="103" groupAlignment="0" attributes="0">
19
          <Group type="102" alignment="0" attributes="0">
19
          <Group type="102" alignment="0" attributes="0">
20
              <EmptySpace max="-2" attributes="0"/>
20
              <EmptySpace max="-2" attributes="0"/>
21
              <Group type="103" groupAlignment="0" attributes="0">
21
              <Component id="lblPlatform" min="-2" max="-2" attributes="0"/>
22
                  <Component id="setAsMainCheckBox" alignment="0" min="-2" pref="293" max="-2" attributes="0"/>
22
              <EmptySpace max="-2" attributes="0"/>
23
                  <Group type="102" alignment="0" attributes="0">
23
              <Component id="platformComboBox" pref="315" max="32767" attributes="0"/>
24
                      <Component id="lblPlatform" min="-2" max="-2" attributes="0"/>
25
                      <EmptySpace max="-2" attributes="0"/>
26
                      <Component id="platformComboBox" pref="315" max="32767" attributes="0"/>
27
                  </Group>
28
              </Group>
29
              <EmptySpace max="-2" attributes="0"/>
24
              <EmptySpace max="-2" attributes="0"/>
30
              <Component id="btnManagePlatforms" min="-2" max="-2" attributes="1"/>
25
              <Component id="btnManagePlatforms" min="-2" max="-2" attributes="1"/>
31
          </Group>
26
          </Group>
Lines 40-69 Link Here
40
                  <Component id="platformComboBox" alignment="3" min="-2" pref="23" max="-2" attributes="0"/>
35
                  <Component id="platformComboBox" alignment="3" min="-2" pref="23" max="-2" attributes="0"/>
41
                  <Component id="btnManagePlatforms" alignment="3" min="-2" max="-2" attributes="0"/>
36
                  <Component id="btnManagePlatforms" alignment="3" min="-2" max="-2" attributes="0"/>
42
              </Group>
37
              </Group>
43
              <EmptySpace type="separate" max="-2" attributes="0"/>
38
              <EmptySpace pref="239" max="32767" attributes="0"/>
44
              <Component id="setAsMainCheckBox" min="-2" max="-2" attributes="0"/>
45
              <EmptySpace pref="198" max="32767" attributes="0"/>
46
          </Group>
39
          </Group>
47
      </Group>
40
      </Group>
48
    </DimensionLayout>
41
    </DimensionLayout>
49
  </Layout>
42
  </Layout>
50
  <SubComponents>
43
  <SubComponents>
51
    <Component class="javax.swing.JCheckBox" name="setAsMainCheckBox">
52
      <Properties>
53
        <Property name="mnemonic" type="int" editor="org.netbeans.modules.i18n.form.FormI18nMnemonicEditor">
54
          <ResourceString bundle="" key="LBL_NWP1_SetAsMain_CheckBoxMnemonic" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
55
        </Property>
56
        <Property name="selected" type="boolean" value="true"/>
57
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
58
          <ResourceString bundle="org/netbeans/modules/javafx2/samples/Bundle.properties" key="LBL_NWP1_SetAsMain_CheckBox" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
59
        </Property>
60
      </Properties>
61
      <AccessibilityProperties>
62
        <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
63
          <ResourceString bundle="org/netbeans/modules/web/examples/Bundle.properties" key="ACS_LBL_NWP1_SetAsMain_A11YDesc" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
64
        </Property>
65
      </AccessibilityProperties>
66
    </Component>
67
    <Component class="javax.swing.JLabel" name="lblPlatform">
44
    <Component class="javax.swing.JLabel" name="lblPlatform">
68
      <Properties>
45
      <Properties>
69
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
46
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
(-)a/javafx2.samples/src/org/netbeans/modules/javafx2/samples/PanelOptionsVisual.java (-19 / +4 lines)
Lines 116-131 Link Here
116
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
116
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
117
    private void initComponents() {
117
    private void initComponents() {
118
118
119
        setAsMainCheckBox = new javax.swing.JCheckBox();
120
        lblPlatform = new javax.swing.JLabel();
119
        lblPlatform = new javax.swing.JLabel();
121
        platformComboBox = new javax.swing.JComboBox();
120
        platformComboBox = new javax.swing.JComboBox();
122
        btnManagePlatforms = new javax.swing.JButton();
121
        btnManagePlatforms = new javax.swing.JButton();
123
122
124
        setAsMainCheckBox.setMnemonic(org.openide.util.NbBundle.getMessage(PanelOptionsVisual.class, "LBL_NWP1_SetAsMain_CheckBoxMnemonic").charAt(0));
125
        setAsMainCheckBox.setSelected(true);
126
        setAsMainCheckBox.setText(org.openide.util.NbBundle.getMessage(PanelOptionsVisual.class, "LBL_NWP1_SetAsMain_CheckBox")); // NOI18N
127
        setAsMainCheckBox.setActionCommand("Set as Main Project");
128
129
        lblPlatform.setLabelFor(platformComboBox);
123
        lblPlatform.setLabelFor(platformComboBox);
130
        lblPlatform.setText(org.openide.util.NbBundle.getMessage(PanelOptionsVisual.class, "LBL_Platform_ComboBox")); // NOI18N
124
        lblPlatform.setText(org.openide.util.NbBundle.getMessage(PanelOptionsVisual.class, "LBL_Platform_ComboBox")); // NOI18N
131
125
Lines 150-161 Link Here
150
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
144
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
151
            .addGroup(layout.createSequentialGroup()
145
            .addGroup(layout.createSequentialGroup()
152
                .addContainerGap()
146
                .addContainerGap()
153
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
147
                .addComponent(lblPlatform)
154
                    .addComponent(setAsMainCheckBox, javax.swing.GroupLayout.PREFERRED_SIZE, 293, javax.swing.GroupLayout.PREFERRED_SIZE)
148
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
155
                    .addGroup(layout.createSequentialGroup()
149
                .addComponent(platformComboBox, 0, 315, Short.MAX_VALUE)
156
                        .addComponent(lblPlatform)
157
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
158
                        .addComponent(platformComboBox, 0, 315, Short.MAX_VALUE)))
159
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
150
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
160
                .addComponent(btnManagePlatforms))
151
                .addComponent(btnManagePlatforms))
161
        );
152
        );
Lines 167-178 Link Here
167
                    .addComponent(lblPlatform)
158
                    .addComponent(lblPlatform)
168
                    .addComponent(platformComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
159
                    .addComponent(platformComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
169
                    .addComponent(btnManagePlatforms))
160
                    .addComponent(btnManagePlatforms))
170
                .addGap(18, 18, 18)
161
                .addContainerGap(239, Short.MAX_VALUE))
171
                .addComponent(setAsMainCheckBox)
172
                .addContainerGap(198, Short.MAX_VALUE))
173
        );
162
        );
174
175
        setAsMainCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(PanelOptionsVisual.class, "ACS_LBL_NWP1_SetAsMain_A11YDesc")); // NOI18N
176
    }// </editor-fold>//GEN-END:initComponents
163
    }// </editor-fold>//GEN-END:initComponents
177
164
178
    private void btnManagePlatformsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnManagePlatformsActionPerformed
165
    private void btnManagePlatformsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnManagePlatformsActionPerformed
Lines 209-215 Link Here
209
    }
196
    }
210
197
211
    void store(WizardDescriptor d) {
198
    void store(WizardDescriptor d) {
212
        d.putProperty(WizardProperties.SET_AS_MAIN, setAsMainCheckBox.isSelected() ? Boolean.TRUE : Boolean.FALSE);
213
        String platformName = getSelectedPlatform().getProperties().get(JavaFXPlatformUtils.PLATFORM_ANT_NAME);
199
        String platformName = getSelectedPlatform().getProperties().get(JavaFXPlatformUtils.PLATFORM_ANT_NAME);
214
        d.putProperty(JavaFXProjectUtils.PROP_JAVA_PLATFORM_NAME, platformName);
200
        d.putProperty(JavaFXProjectUtils.PROP_JAVA_PLATFORM_NAME, platformName);
215
    }
201
    }
Lines 224-230 Link Here
224
    private javax.swing.JButton btnManagePlatforms;
210
    private javax.swing.JButton btnManagePlatforms;
225
    private javax.swing.JLabel lblPlatform;
211
    private javax.swing.JLabel lblPlatform;
226
    private javax.swing.JComboBox platformComboBox;
212
    private javax.swing.JComboBox platformComboBox;
227
    private javax.swing.JCheckBox setAsMainCheckBox;
228
    // End of variables declaration//GEN-END:variables
213
    // End of variables declaration//GEN-END:variables
229
214
230
    private void checkPlatforms() {
215
    private void checkPlatforms() {
(-)a/javafx2.samples/src/org/netbeans/modules/javafx2/samples/WizardProperties.java (-1 lines)
Lines 49-55 Link Here
49
    public static final String NAME = "name"; //NOI18N
49
    public static final String NAME = "name"; //NOI18N
50
    public static final String SOURCE_ROOT = "sourceRoot"; //NOI18N
50
    public static final String SOURCE_ROOT = "sourceRoot"; //NOI18N
51
51
52
    public static final String SET_AS_MAIN = "setAsMain"; //NOI18N
53
    public static final String J2EE_LEVEL = "j2eeLevel"; //NOI18N
52
    public static final String J2EE_LEVEL = "j2eeLevel"; //NOI18N
54
    public static final String CONTEXT_PATH = "contextPath"; //NOI18N
53
    public static final String CONTEXT_PATH = "contextPath"; //NOI18N
55
54
(-)a/maven.apisupport/src/org/netbeans/modules/maven/apisupport/NbmWizardIterator.java (-2 lines)
Lines 68-74 Link Here
68
import org.netbeans.modules.maven.model.pom.POMModel;
68
import org.netbeans.modules.maven.model.pom.POMModel;
69
import org.netbeans.modules.maven.model.pom.Plugin;
69
import org.netbeans.modules.maven.model.pom.Plugin;
70
import org.netbeans.modules.maven.model.pom.Repository;
70
import org.netbeans.modules.maven.model.pom.Repository;
71
import org.netbeans.spi.project.ui.templates.support.Templates;
72
import org.netbeans.validation.api.ui.ValidationGroup;
71
import org.netbeans.validation.api.ui.ValidationGroup;
73
import org.openide.WizardDescriptor;
72
import org.openide.WizardDescriptor;
74
import org.openide.filesystems.FileObject;
73
import org.openide.filesystems.FileObject;
Lines 186-192 Link Here
186
            if ("SNAPSHOT".equals(version)) { // NOI18N
185
            if ("SNAPSHOT".equals(version)) { // NOI18N
187
                addSnapshotRepo(projFile);
186
                addSnapshotRepo(projFile);
188
            }
187
            }
189
            Templates.setDefinesMainProject(wiz, projects.size() > 1);
190
            return projects;
188
            return projects;
191
    }
189
    }
192
    
190
    
(-)a/maven/src/org/netbeans/modules/maven/layer.xml (-4 lines)
Lines 141-150 Link Here
141
                    <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
141
                    <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
142
                    <attr name="position" intvalue="1600"/>
142
                    <attr name="position" intvalue="1600"/>
143
                </file>
143
                </file>
144
                <file name="org-netbeans-modules-project-ui-SetMainProject.shadow">
145
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-SetMainProject.instance"/>
146
                    <attr name="position" intvalue="1800"/>
147
                </file>
148
                <file name="org-netbeans-modules-project-ui-actions-OpenSubprojects.shadow">
144
                <file name="org-netbeans-modules-project-ui-actions-OpenSubprojects.shadow">
149
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-actions-OpenSubprojects.instance"/>
145
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-actions-OpenSubprojects.instance"/>
150
                    <attr name="position" intvalue="1900"/>
146
                    <attr name="position" intvalue="1900"/>
(-)a/maven/src/org/netbeans/modules/maven/newproject/ArchetypeWizardUtils.java (-2 lines)
Lines 75-81 Link Here
75
import static org.netbeans.modules.maven.newproject.Bundle.*;
75
import static org.netbeans.modules.maven.newproject.Bundle.*;
76
import org.netbeans.modules.maven.options.MavenCommandSettings;
76
import org.netbeans.modules.maven.options.MavenCommandSettings;
77
import org.netbeans.spi.project.ui.support.ProjectChooser;
77
import org.netbeans.spi.project.ui.support.ProjectChooser;
78
import org.netbeans.spi.project.ui.templates.support.Templates;
79
import org.openide.WizardDescriptor;
78
import org.openide.WizardDescriptor;
80
import org.openide.execution.ExecutorTask;
79
import org.openide.execution.ExecutorTask;
81
import org.openide.filesystems.FileObject;
80
import org.openide.filesystems.FileObject;
Lines 202-208 Link Here
202
        File projFile = FileUtil.normalizeFile((File) wiz.getProperty("projdir")); // NOI18N
201
        File projFile = FileUtil.normalizeFile((File) wiz.getProperty("projdir")); // NOI18N
203
        createFromArchetype(projFile, vi, arch, additional, true);
202
        createFromArchetype(projFile, vi, arch, additional, true);
204
        Set<FileObject> projects = openProjects(projFile, null);
203
        Set<FileObject> projects = openProjects(projFile, null);
205
        Templates.setDefinesMainProject(wiz, projects.size() > 1);
206
        return projects;
204
        return projects;
207
    }
205
    }
208
206
(-)a/mercurial/src/org/netbeans/modules/mercurial/HgModuleConfig.java (-11 lines)
Lines 55-61 Link Here
55
import java.io.File;
55
import java.io.File;
56
import java.net.InetAddress;
56
import java.net.InetAddress;
57
import java.util.logging.Level;
57
import java.util.logging.Level;
58
import java.util.logging.Logger;
59
import org.netbeans.modules.mercurial.config.HgConfigFiles;
58
import org.netbeans.modules.mercurial.config.HgConfigFiles;
60
import org.netbeans.modules.mercurial.ui.repository.RepositoryConnection;
59
import org.netbeans.modules.mercurial.ui.repository.RepositoryConnection;
61
import org.netbeans.modules.mercurial.util.HgCommand;
60
import org.netbeans.modules.mercurial.util.HgCommand;
Lines 98-105 Link Here
98
    private static final String RECENT_URL = "repository.recentURL";                                        // NOI18N
97
    private static final String RECENT_URL = "repository.recentURL";                                        // NOI18N
99
    private static final String SHOW_CLONE_COMPLETED = "cloneCompleted.showCloneCompleted";        // NOI18N  
98
    private static final String SHOW_CLONE_COMPLETED = "cloneCompleted.showCloneCompleted";        // NOI18N  
100
99
101
    private static final String SET_MAIN_PROJECT = "cloneCompleted.setMainProject";        // NOI18N  
102
103
    private static final String URL_EXP = "annotator.urlExp";                                               // NOI18N
100
    private static final String URL_EXP = "annotator.urlExp";                                               // NOI18N
104
    private static final String ANNOTATION_EXP = "annotator.annotationExp";                                 // NOI18N
101
    private static final String ANNOTATION_EXP = "annotator.annotationExp";                                 // NOI18N
105
    
102
    
Lines 129-138 Link Here
129
        return getPreferences().getBoolean(SHOW_CLONE_COMPLETED, true);
126
        return getPreferences().getBoolean(SHOW_CLONE_COMPLETED, true);
130
    }
127
    }
131
    
128
    
132
    public boolean getSetMainProject() {
133
        return getPreferences().getBoolean(SET_MAIN_PROJECT, true);
134
    }
135
    
136
    public Pattern [] getIgnoredFilePatterns() {
129
    public Pattern [] getIgnoredFilePatterns() {
137
        return getDefaultFilePatterns();
130
        return getDefaultFilePatterns();
138
    }
131
    }
Lines 463-472 Link Here
463
        getPreferences().putBoolean(SHOW_CLONE_COMPLETED, bl);
456
        getPreferences().putBoolean(SHOW_CLONE_COMPLETED, bl);
464
    }
457
    }
465
    
458
    
466
    public void setSetMainProject(boolean bl) {
467
        getPreferences().putBoolean(SET_MAIN_PROJECT, bl);
468
    }
469
    
470
    public void insertRecentUrl(final RepositoryConnection rc) {
459
    public void insertRecentUrl(final RepositoryConnection rc) {
471
        Preferences prefs = getPreferences();
460
        Preferences prefs = getPreferences();
472
461
(-)a/mercurial/src/org/netbeans/modules/mercurial/ui/clone/Bundle.properties (-2 lines)
Lines 104-114 Link Here
104
ClonePanel.toName.text=Clone &Name:
104
ClonePanel.toName.text=Clone &Name:
105
105
106
destinationLabel.text=Destination:
106
destinationLabel.text=Destination:
107
openCheckbox.text=&Set Cloned Project as Main
108
# Capitalized letters used intentionally to emphasize the words in an output window, should be translated
107
# Capitalized letters used intentionally to emphasize the words in an output window, should be translated
109
MSG_EXTERNAL_CLONE_PRJ_NOT_FOUND_CANT_SETASMAIN = INFO: Unable to open project.\nINFO: This is either not a top level NetBeans Project or all the NetBeans project files have not been committed in the source Project.\n\n
108
MSG_EXTERNAL_CLONE_PRJ_NOT_FOUND_CANT_SETASMAIN = INFO: Unable to open project.\nINFO: This is either not a top level NetBeans Project or all the NetBeans project files have not been committed in the source Project.\n\n
110
ACSD_Browse=Browse for parent of destination repository
109
ACSD_Browse=Browse for parent of destination repository
111
ACSD_setMainCheckBox=The cloned project will be set as Main project
112
ACSD_toCloneField=Specifies name of cloned project
110
ACSD_toCloneField=Specifies name of cloned project
113
ACSD_toTextField=Specifies the parent directory of cloned project
111
ACSD_toTextField=Specifies the parent directory of cloned project
114
ACSD_fromTextField=Specifies the repository to be cloned
112
ACSD_fromTextField=Specifies the repository to be cloned
(-)a/mercurial/src/org/netbeans/modules/mercurial/ui/clone/CloneAction.java (-4 / +1 lines)
Lines 65-71 Link Here
65
import org.netbeans.modules.mercurial.HgProgressSupport;
65
import org.netbeans.modules.mercurial.HgProgressSupport;
66
import org.netbeans.modules.mercurial.Mercurial;
66
import org.netbeans.modules.mercurial.Mercurial;
67
import org.netbeans.modules.mercurial.OutputLogger;
67
import org.netbeans.modules.mercurial.OutputLogger;
68
import org.netbeans.modules.mercurial.HgModuleConfig;
69
import org.netbeans.modules.mercurial.config.HgConfigFiles;
68
import org.netbeans.modules.mercurial.config.HgConfigFiles;
70
import org.netbeans.modules.mercurial.util.HgCommand;
69
import org.netbeans.modules.mercurial.util.HgCommand;
71
import org.netbeans.modules.mercurial.util.HgUtils;
70
import org.netbeans.modules.mercurial.util.HgUtils;
Lines 74-81 Link Here
74
import org.netbeans.modules.mercurial.ui.repository.HgURL;
73
import org.netbeans.modules.mercurial.ui.repository.HgURL;
75
import org.openide.filesystems.FileObject;
74
import org.openide.filesystems.FileObject;
76
import org.openide.filesystems.FileUtil;
75
import org.openide.filesystems.FileUtil;
77
import org.openide.DialogDisplayer;
78
import org.openide.NotifyDescriptor;
79
import org.openide.nodes.Node;
76
import org.openide.nodes.Node;
80
import org.openide.util.Cancellable;
77
import org.openide.util.Cancellable;
81
import org.openide.util.NbBundle;
78
import org.openide.util.NbBundle;
Lines 355-361 Link Here
355
                                prj = projectManager.findProject(cloneProj);
352
                                prj = projectManager.findProject(cloneProj);
356
                            }
353
                            }
357
                            if (prj != null) {
354
                            if (prj != null) {
358
                                HgProjectUtils.openProject(prj, this, HgModuleConfig.getDefault().getSetMainProject());
355
                                HgProjectUtils.openProject(prj, this);
359
                                hg.versionedFilesChanged();
356
                                hg.versionedFilesChanged();
360
                                hg.refreshAllAnnotations();
357
                                hg.refreshAllAnnotations();
361
                            } else {
358
                            } else {
(-)a/mercurial/src/org/netbeans/modules/mercurial/ui/clone/ClonePanel.form (-24 / +6 lines)
Lines 1-4 Link Here
1
<?xml version="1.1" encoding="UTF-8" ?>
1
<?xml version="1.0" encoding="UTF-8" ?>
2
2
3
<Form version="1.5" maxVersion="1.5" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
3
<Form version="1.5" maxVersion="1.5" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <AuxValues>
4
  <AuxValues>
Lines 21-39 Link Here
21
              <Group type="103" groupAlignment="0" attributes="0">
21
              <Group type="103" groupAlignment="0" attributes="0">
22
                  <Component id="destinationLabel" alignment="0" min="-2" max="-2" attributes="0"/>
22
                  <Component id="destinationLabel" alignment="0" min="-2" max="-2" attributes="0"/>
23
                  <Component id="fromLabel" alignment="0" min="-2" max="-2" attributes="0"/>
23
                  <Component id="fromLabel" alignment="0" min="-2" max="-2" attributes="0"/>
24
                  <Group type="102" alignment="0" attributes="0">
24
                  <Group type="102" attributes="0">
25
                      <EmptySpace min="12" pref="12" max="12" attributes="0"/>
25
                      <EmptySpace min="12" pref="12" max="-2" attributes="0"/>
26
                      <Group type="103" groupAlignment="0" attributes="0">
26
                      <Group type="103" groupAlignment="0" attributes="0">
27
                          <Component id="toNameLabel" alignment="0" min="-2" max="-2" attributes="0"/>
27
                          <Component id="toNameLabel" alignment="0" min="-2" max="-2" attributes="0"/>
28
                          <Component id="setMainCheckBox" alignment="0" min="-2" max="-2" attributes="0"/>
28
                          <Component id="toLabel" min="-2" max="-2" attributes="0"/>
29
                      </Group>
29
                      </Group>
30
                  </Group>
30
                  </Group>
31
                  <Group type="102" attributes="0">
32
                      <EmptySpace min="12" pref="12" max="12" attributes="0"/>
33
                      <Component id="toLabel" min="-2" max="-2" attributes="0"/>
34
                  </Group>
35
              </Group>
31
              </Group>
36
              <EmptySpace max="-2" attributes="0"/>
32
              <EmptySpace min="-2" pref="94" max="-2" attributes="0"/>
37
              <Group type="103" groupAlignment="0" attributes="0">
33
              <Group type="103" groupAlignment="0" attributes="0">
38
                  <Component id="fromTextField" alignment="0" pref="272" max="32767" attributes="0"/>
34
                  <Component id="fromTextField" alignment="0" pref="272" max="32767" attributes="0"/>
39
                  <Group type="102" alignment="1" attributes="0">
35
                  <Group type="102" alignment="1" attributes="0">
Lines 70-78 Link Here
70
                  <Component id="toCloneField" alignment="3" min="-2" max="-2" attributes="0"/>
66
                  <Component id="toCloneField" alignment="3" min="-2" max="-2" attributes="0"/>
71
                  <Component id="toNameLabel" alignment="3" min="-2" max="-2" attributes="0"/>
67
                  <Component id="toNameLabel" alignment="3" min="-2" max="-2" attributes="0"/>
72
              </Group>
68
              </Group>
73
              <EmptySpace max="-2" attributes="0"/>
69
              <EmptySpace min="-2" pref="31" max="-2" attributes="0"/>
74
              <Component id="setMainCheckBox" min="-2" pref="21" max="-2" attributes="0"/>
75
              <EmptySpace max="-2" attributes="0"/>
76
          </Group>
70
          </Group>
77
      </Group>
71
      </Group>
78
    </DimensionLayout>
72
    </DimensionLayout>
Lines 154-170 Link Here
154
        </Property>
148
        </Property>
155
      </Properties>
149
      </Properties>
156
    </Component>
150
    </Component>
157
    <Component class="javax.swing.JCheckBox" name="setMainCheckBox">
158
      <Properties>
159
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
160
          <ResourceString bundle="org/netbeans/modules/mercurial/ui/clone/Bundle.properties" key="openCheckbox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
161
        </Property>
162
      </Properties>
163
      <AccessibilityProperties>
164
        <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
165
          <ResourceString bundle="org/netbeans/modules/mercurial/ui/clone/Bundle.properties" key="ACSD_setMainCheckBox" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
166
        </Property>
167
      </AccessibilityProperties>
168
    </Component>
169
  </SubComponents>
151
  </SubComponents>
170
</Form>
152
</Form>
(-)a/mercurial/src/org/netbeans/modules/mercurial/ui/clone/ClonePanel.java (-24 / +3 lines)
Lines 44-55 Link Here
44
package org.netbeans.modules.mercurial.ui.clone;
44
package org.netbeans.modules.mercurial.ui.clone;
45
45
46
import java.io.File;
46
import java.io.File;
47
import java.util.Set;
48
import java.util.Vector;
49
import java.util.LinkedHashSet;
50
import javax.swing.SwingUtilities;
51
import javax.swing.ComboBoxModel;
52
import javax.swing.DefaultComboBoxModel;
53
import java.awt.event.ActionEvent;
47
import java.awt.event.ActionEvent;
54
import java.awt.event.ActionListener;
48
import java.awt.event.ActionListener;
55
import javax.swing.JFileChooser;
49
import javax.swing.JFileChooser;
Lines 57-63 Link Here
57
import org.openide.util.NbBundle;
51
import org.openide.util.NbBundle;
58
import org.netbeans.modules.versioning.util.AccessibleJFileChooser;
52
import org.netbeans.modules.versioning.util.AccessibleJFileChooser;
59
import org.netbeans.spi.project.ui.support.ProjectChooser;
53
import org.netbeans.spi.project.ui.support.ProjectChooser;
60
import org.netbeans.modules.mercurial.HgModuleConfig;
61
54
62
/**
55
/**
63
 *
56
 *
Lines 72-82 Link Here
72
        repository = repo;
65
        repository = repo;
73
        initComponents();
66
        initComponents();
74
        browseButton.addActionListener(this);
67
        browseButton.addActionListener(this);
75
        setMainCheckBox.addActionListener(this);
76
        fromTextField.setText(repo.getAbsolutePath());
68
        fromTextField.setText(repo.getAbsolutePath());
77
        toTextField.setText(to.getParent());
69
        toTextField.setText(to.getParent());
78
        toCloneField.setText(to.getName());
70
        toCloneField.setText(to.getName());
79
        setMainCheckBox.setSelected(HgModuleConfig.getDefault().getSetMainProject());
80
    }
71
    }
81
72
82
    public File getTargetDir() {
73
    public File getTargetDir() {
Lines 98-104 Link Here
98
        toNameLabel = new javax.swing.JLabel();
89
        toNameLabel = new javax.swing.JLabel();
99
        toCloneField = new javax.swing.JTextField();
90
        toCloneField = new javax.swing.JTextField();
100
        destinationLabel = new javax.swing.JLabel();
91
        destinationLabel = new javax.swing.JLabel();
101
        setMainCheckBox = new javax.swing.JCheckBox();
102
92
103
        fromLabel.setLabelFor(fromTextField);
93
        fromLabel.setLabelFor(fromTextField);
104
        org.openide.awt.Mnemonics.setLocalizedText(fromLabel, org.openide.util.NbBundle.getMessage(ClonePanel.class, "ClonePanel.fromLabel.text")); // NOI18N
94
        org.openide.awt.Mnemonics.setLocalizedText(fromLabel, org.openide.util.NbBundle.getMessage(ClonePanel.class, "ClonePanel.fromLabel.text")); // NOI18N
Lines 115-122 Link Here
115
105
116
        org.openide.awt.Mnemonics.setLocalizedText(destinationLabel, org.openide.util.NbBundle.getMessage(ClonePanel.class, "destinationLabel.text")); // NOI18N
106
        org.openide.awt.Mnemonics.setLocalizedText(destinationLabel, org.openide.util.NbBundle.getMessage(ClonePanel.class, "destinationLabel.text")); // NOI18N
117
107
118
        org.openide.awt.Mnemonics.setLocalizedText(setMainCheckBox, org.openide.util.NbBundle.getMessage(ClonePanel.class, "openCheckbox.text")); // NOI18N
119
120
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
108
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
121
        this.setLayout(layout);
109
        this.setLayout(layout);
122
        layout.setHorizontalGroup(
110
        layout.setHorizontalGroup(
Lines 130-140 Link Here
130
                        .addGap(12, 12, 12)
118
                        .addGap(12, 12, 12)
131
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
119
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
132
                            .addComponent(toNameLabel)
120
                            .addComponent(toNameLabel)
133
                            .addComponent(setMainCheckBox)))
121
                            .addComponent(toLabel))))
134
                    .addGroup(layout.createSequentialGroup()
122
                .addGap(94, 94, 94)
135
                        .addGap(12, 12, 12)
136
                        .addComponent(toLabel)))
137
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
138
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
123
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
139
                    .addComponent(fromTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE)
124
                    .addComponent(fromTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE)
140
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
125
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
Lines 163-186 Link Here
163
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
148
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
164
                    .addComponent(toCloneField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
149
                    .addComponent(toCloneField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
165
                    .addComponent(toNameLabel))
150
                    .addComponent(toNameLabel))
166
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
151
                .addGap(31, 31, 31))
167
                .addComponent(setMainCheckBox, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
168
                .addContainerGap())
169
        );
152
        );
170
153
171
        toTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ClonePanel.class, "ACSD_toTextField")); // NOI18N
154
        toTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ClonePanel.class, "ACSD_toTextField")); // NOI18N
172
        browseButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ClonePanel.class, "ACSD_Browse")); // NOI18N
155
        browseButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ClonePanel.class, "ACSD_Browse")); // NOI18N
173
        fromTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ClonePanel.class, "ACSD_fromTextField")); // NOI18N
156
        fromTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ClonePanel.class, "ACSD_fromTextField")); // NOI18N
174
        toCloneField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ClonePanel.class, "ACSD_toCloneField")); // NOI18N
157
        toCloneField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ClonePanel.class, "ACSD_toCloneField")); // NOI18N
175
        setMainCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ClonePanel.class, "ACSD_setMainCheckBox")); // NOI18N
176
    }// </editor-fold>//GEN-END:initComponents
158
    }// </editor-fold>//GEN-END:initComponents
177
    
159
    
178
160
179
    public void actionPerformed(ActionEvent evt) {
161
    public void actionPerformed(ActionEvent evt) {
180
        if (evt.getSource() == browseButton) {
162
        if (evt.getSource() == browseButton) {
181
            onBrowseClick();
163
            onBrowseClick();
182
        } else if (evt.getSource() == setMainCheckBox) {
183
            HgModuleConfig.getDefault().setSetMainProject(setMainCheckBox.isSelected());
184
        }
164
        }
185
    }
165
    }
186
166
Lines 255-261 Link Here
255
    private javax.swing.JLabel destinationLabel;
235
    private javax.swing.JLabel destinationLabel;
256
    private javax.swing.JLabel fromLabel;
236
    private javax.swing.JLabel fromLabel;
257
    private javax.swing.JTextField fromTextField;
237
    private javax.swing.JTextField fromTextField;
258
    private javax.swing.JCheckBox setMainCheckBox;
259
    private javax.swing.JTextField toCloneField;
238
    private javax.swing.JTextField toCloneField;
260
    private javax.swing.JLabel toLabel;
239
    private javax.swing.JLabel toLabel;
261
    private javax.swing.JLabel toNameLabel;
240
    private javax.swing.JLabel toNameLabel;
(-)a/mercurial/src/org/netbeans/modules/mercurial/util/HgProjectUtils.java (-6 / +1 lines)
Lines 79-94 Link Here
79
        ctxAction.actionPerformed(new ActionEvent(caller, 0, "")); // NOI18N
79
        ctxAction.actionPerformed(new ActionEvent(caller, 0, "")); // NOI18N
80
    }
80
    }
81
81
82
    public static void openProject(Project p, Object caller, boolean setMain) {
82
    public static void openProject(Project p, Object caller) {
83
        if( p == null) return;
83
        if( p == null) return;
84
        
84
        
85
        Project[] projects = new Project[] {p};
85
        Project[] projects = new Project[] {p};
86
        OpenProjects.getDefault().open(projects, false);
86
        OpenProjects.getDefault().open(projects, false);
87
        if (setMain) {
88
            OpenProjects.getDefault().setMainProject(p);
89
        }
90
        
91
        // set as main project and expand
92
        selectAndExpandProject(p);
87
        selectAndExpandProject(p);
93
    }
88
    }
94
    
89
    
(-)a/mobility.project/src/org/netbeans/modules/mobility/project/ui/wizard/Bundle.properties (-1 lines)
Lines 79-85 Link Here
79
LBL_Projects_Home=Project &Location:
79
LBL_Projects_Home=Project &Location:
80
LBL_Project_Browse=Br&owse...
80
LBL_Project_Browse=Br&owse...
81
LBL_Project_Created=Project Fol&der:
81
LBL_Project_Created=Project Fol&der:
82
LBL_Project_SetAsMainProject=&Set as Main Project
83
LBL_Project_CreateMIDlet=Create Hello &MIDlet
82
LBL_Project_CreateMIDlet=Create Hello &MIDlet
84
TITLE_Project_Home=Select Project Location
83
TITLE_Project_Home=Select Project Location
85
ERR_Project_ProjectFolderReadOnly=Project Folder is read-only.
84
ERR_Project_ProjectFolderReadOnly=Project Folder is read-only.
(-)a/mobility.project/src/org/netbeans/modules/mobility/project/ui/wizard/NewProjectIterator.java (-1 / +1 lines)
Lines 131-137 Link Here
131
            platformPanel = new PlatformInstallPanel.WizardPanel(J2MEPlatform.SPECIFICATION_NAME);
131
            platformPanel = new PlatformInstallPanel.WizardPanel(J2MEPlatform.SPECIFICATION_NAME);
132
            ((JComponent)platformPanel.getComponent()).putClientProperty("NewProjectWizard_Title", create ? NbBundle.getMessage(NewProjectIterator.class, "TXT_MobileApplication") : NbBundle.getMessage(NewProjectIterator.class, "TXT_MobileLibrary"));
132
            ((JComponent)platformPanel.getComponent()).putClientProperty("NewProjectWizard_Title", create ? NbBundle.getMessage(NewProjectIterator.class, "TXT_MobileApplication") : NbBundle.getMessage(NewProjectIterator.class, "TXT_MobileLibrary"));
133
        }
133
        }
134
        projectPanel = new ProjectPanel.WizardPanel(create, create);
134
        projectPanel = new ProjectPanel.WizardPanel(create);
135
        ((JComponent)projectPanel.getComponent()).putClientProperty("NewProjectWizard_Title", create ? NbBundle.getMessage(NewProjectIterator.class, "TXT_MobileApplication") : NbBundle.getMessage(NewProjectIterator.class, "TXT_MobileLibrary"));
135
        ((JComponent)projectPanel.getComponent()).putClientProperty("NewProjectWizard_Title", create ? NbBundle.getMessage(NewProjectIterator.class, "TXT_MobileApplication") : NbBundle.getMessage(NewProjectIterator.class, "TXT_MobileLibrary"));
136
        
136
        
137
        psPanel = new PlatformSelectionPanel();
137
        psPanel = new PlatformSelectionPanel();
(-)a/mobility.project/src/org/netbeans/modules/mobility/project/ui/wizard/ProjectPanel.form (-13 / +1 lines)
Lines 1-4 Link Here
1
<?xml version="1.1" encoding="UTF-8" ?>
1
<?xml version="1.0" encoding="UTF-8" ?>
2
2
3
<Form version="1.2" maxVersion="1.2" 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>
Lines 116-133 Link Here
116
        </Constraint>
116
        </Constraint>
117
      </Constraints>
117
      </Constraints>
118
    </Component>
118
    </Component>
119
    <Component class="javax.swing.JCheckBox" name="cMainProject">
120
      <Properties>
121
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
122
          <ResourceString bundle="org/netbeans/modules/mobility/project/ui/wizard/Bundle.properties" key="LBL_Project_SetAsMainProject" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
123
        </Property>
124
      </Properties>
125
      <Constraints>
126
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
127
          <GridBagConstraints gridX="0" gridY="4" gridWidth="0" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="5" insetsLeft="0" insetsBottom="6" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
128
        </Constraint>
129
      </Constraints>
130
    </Component>
131
    <Component class="javax.swing.JCheckBox" name="cCreateMIDlet">
119
    <Component class="javax.swing.JCheckBox" name="cCreateMIDlet">
132
      <Properties>
120
      <Properties>
133
        <Property name="selected" type="boolean" value="true"/>
121
        <Property name="selected" type="boolean" value="true"/>
(-)a/mobility.project/src/org/netbeans/modules/mobility/project/ui/wizard/ProjectPanel.java (-28 / +5 lines)
Lines 78-84 Link Here
78
    public static final String PROJECT_NAME = "ProjectName"; // NOI18N
78
    public static final String PROJECT_NAME = "ProjectName"; // NOI18N
79
    public static final String PROJECTS_HOME = "ProjectsHome"; // NOI18N
79
    public static final String PROJECTS_HOME = "ProjectsHome"; // NOI18N
80
    public static final String PROJECT_LOCATION = "ProjectLocation"; // NOI18N
80
    public static final String PROJECT_LOCATION = "ProjectLocation"; // NOI18N
81
    public static final String PROJECT_MAIN = "setAsMain"; // NOI18N
82
    public static final String PROJECT_CREATE_MIDLET = "CreateMidlet"; // NOI18N
81
    public static final String PROJECT_CREATE_MIDLET = "CreateMidlet"; // NOI18N
83
    public static final String PROJECT_COPY_SOURCES = "CopySources"; //NOI18N
82
    public static final String PROJECT_COPY_SOURCES = "CopySources"; //NOI18N
84
83
Lines 86-97 Link Here
86
    private static final int WINDOWS_MAX_PATH_LENGTH = 255;
85
    private static final int WINDOWS_MAX_PATH_LENGTH = 255;
87
    
86
    
88
    /** Creates new form ProjectPanel */
87
    /** Creates new form ProjectPanel */
89
    public ProjectPanel(boolean showCreateMIDlet, boolean showSetAsMain, boolean showCopySources) {
88
    public ProjectPanel(boolean showCreateMIDlet, boolean showCopySources) {
90
        initComponents();
89
        initComponents();
91
        initAccessibility();
90
        initAccessibility();
92
        cCreateMIDlet.setVisible(showCreateMIDlet);
91
        cCreateMIDlet.setVisible(showCreateMIDlet);
93
        cMainProject.setVisible(showSetAsMain);
94
        cMainProject.setSelected(true);
95
        jLabel4.setVisible(showCopySources);
92
        jLabel4.setVisible(showCopySources);
96
        jRadioCopySrc.setVisible(showCopySources);
93
        jRadioCopySrc.setVisible(showCopySources);
97
        jRadioEmptySrc.setVisible(showCopySources);
94
        jRadioEmptySrc.setVisible(showCopySources);
Lines 106-119 Link Here
106
    public void addListeners(final DocumentListener documentListener, final ItemListener itemListener) {
103
    public void addListeners(final DocumentListener documentListener, final ItemListener itemListener) {
107
        tName.getDocument().addDocumentListener(documentListener);
104
        tName.getDocument().addDocumentListener(documentListener);
108
        tHome.getDocument().addDocumentListener(documentListener);
105
        tHome.getDocument().addDocumentListener(documentListener);
109
        cMainProject.addItemListener(itemListener);
110
        cCreateMIDlet.addItemListener(itemListener);
106
        cCreateMIDlet.addItemListener(itemListener);
111
    }
107
    }
112
    
108
    
113
    public void removeListeners(final DocumentListener documentListener, final ItemListener itemListener) {
109
    public void removeListeners(final DocumentListener documentListener, final ItemListener itemListener) {
114
        tName.getDocument().removeDocumentListener(documentListener);
110
        tName.getDocument().removeDocumentListener(documentListener);
115
        tHome.getDocument().removeDocumentListener(documentListener);
111
        tHome.getDocument().removeDocumentListener(documentListener);
116
        cMainProject.removeItemListener(itemListener);
117
        cCreateMIDlet.removeItemListener(itemListener);
112
        cCreateMIDlet.removeItemListener(itemListener);
118
    }
113
    }
119
    
114
    
Lines 165-173 Link Here
165
            tName.selectAll();
160
            tName.selectAll();
166
        }
161
        }
167
162
168
        b = (Boolean) object.getProperty(PROJECT_MAIN);
169
        cMainProject.setSelected(b == null ? true : b.booleanValue());
170
        
171
        b = (Boolean) object.getProperty(PROJECT_CREATE_MIDLET);
163
        b = (Boolean) object.getProperty(PROJECT_CREATE_MIDLET);
172
        cCreateMIDlet.setSelected(b == null ? true : b.booleanValue());
164
        cCreateMIDlet.setSelected(b == null ? true : b.booleanValue());
173
        
165
        
Lines 190-196 Link Here
190
        object.putProperty(PROJECT_NAME, tName.getText().trim());
182
        object.putProperty(PROJECT_NAME, tName.getText().trim());
191
        object.putProperty(PROJECTS_HOME, tHome.getText());
183
        object.putProperty(PROJECTS_HOME, tHome.getText());
192
        object.putProperty(PROJECT_LOCATION, new File(tCreated.getText()).getAbsoluteFile());
184
        object.putProperty(PROJECT_LOCATION, new File(tCreated.getText()).getAbsoluteFile());
193
        object.putProperty(PROJECT_MAIN, cMainProject.isVisible()  &&  cMainProject.isSelected());
194
        object.putProperty(PROJECT_CREATE_MIDLET, cCreateMIDlet.isVisible()  &&  cCreateMIDlet.isSelected());
185
        object.putProperty(PROJECT_CREATE_MIDLET, cCreateMIDlet.isVisible()  &&  cCreateMIDlet.isSelected());
195
        object.putProperty(PROJECT_COPY_SOURCES, jRadioCopySrc.isVisible()  &&  jRadioCopySrc.isSelected());
186
        object.putProperty(PROJECT_COPY_SOURCES, jRadioCopySrc.isVisible()  &&  jRadioCopySrc.isSelected());
196
    }
187
    }
Lines 229-235 Link Here
229
        jLabel3 = new javax.swing.JLabel();
220
        jLabel3 = new javax.swing.JLabel();
230
        tCreated = new javax.swing.JTextField();
221
        tCreated = new javax.swing.JTextField();
231
        jSeparator1 = new javax.swing.JSeparator();
222
        jSeparator1 = new javax.swing.JSeparator();
232
        cMainProject = new javax.swing.JCheckBox();
233
        cCreateMIDlet = new javax.swing.JCheckBox();
223
        cCreateMIDlet = new javax.swing.JCheckBox();
234
        jLabel4 = new javax.swing.JLabel();
224
        jLabel4 = new javax.swing.JLabel();
235
        jRadioEmptySrc = new javax.swing.JRadioButton();
225
        jRadioEmptySrc = new javax.swing.JRadioButton();
Lines 307-322 Link Here
307
        gridBagConstraints.insets = new java.awt.Insets(12, 0, 12, 0);
297
        gridBagConstraints.insets = new java.awt.Insets(12, 0, 12, 0);
308
        add(jSeparator1, gridBagConstraints);
298
        add(jSeparator1, gridBagConstraints);
309
299
310
        org.openide.awt.Mnemonics.setLocalizedText(cMainProject, org.openide.util.NbBundle.getMessage(ProjectPanel.class, "LBL_Project_SetAsMainProject")); // NOI18N
311
        gridBagConstraints = new java.awt.GridBagConstraints();
312
        gridBagConstraints.gridx = 0;
313
        gridBagConstraints.gridy = 4;
314
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
315
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
316
        gridBagConstraints.weightx = 1.0;
317
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 6, 0);
318
        add(cMainProject, gridBagConstraints);
319
320
        cCreateMIDlet.setSelected(true);
300
        cCreateMIDlet.setSelected(true);
321
        org.openide.awt.Mnemonics.setLocalizedText(cCreateMIDlet, org.openide.util.NbBundle.getMessage(ProjectPanel.class, "LBL_Project_CreateMIDlet")); // NOI18N
301
        org.openide.awt.Mnemonics.setLocalizedText(cCreateMIDlet, org.openide.util.NbBundle.getMessage(ProjectPanel.class, "LBL_Project_CreateMIDlet")); // NOI18N
322
        gridBagConstraints = new java.awt.GridBagConstraints();
302
        gridBagConstraints = new java.awt.GridBagConstraints();
Lines 385-391 Link Here
385
    private javax.swing.JButton bBrowse;
365
    private javax.swing.JButton bBrowse;
386
    private javax.swing.ButtonGroup buttonGroup1;
366
    private javax.swing.ButtonGroup buttonGroup1;
387
    private javax.swing.JCheckBox cCreateMIDlet;
367
    private javax.swing.JCheckBox cCreateMIDlet;
388
    private javax.swing.JCheckBox cMainProject;
389
    private javax.swing.JLabel jLabel1;
368
    private javax.swing.JLabel jLabel1;
390
    private javax.swing.JLabel jLabel2;
369
    private javax.swing.JLabel jLabel2;
391
    private javax.swing.JLabel jLabel3;
370
    private javax.swing.JLabel jLabel3;
Lines 406-420 Link Here
406
        Collection<ChangeListener> listeners = new ArrayList<ChangeListener>();
385
        Collection<ChangeListener> listeners = new ArrayList<ChangeListener>();
407
        boolean valid = false;
386
        boolean valid = false;
408
        boolean showCreateMIDlet;
387
        boolean showCreateMIDlet;
409
        boolean showSetAsMain;
410
        boolean showCopySources;
388
        boolean showCopySources;
411
        
389
        
412
        public WizardPanel(boolean showCreateMIDlet, boolean showSetAsMain) {
390
        public WizardPanel(boolean showCreateMIDlet) {
413
            this(showCreateMIDlet, showSetAsMain, false);
391
            this(showCreateMIDlet, false);
414
        }
392
        }
415
        public WizardPanel(boolean showCreateMIDlet, boolean showSetAsMain, boolean showCopySources) {
393
        public WizardPanel(boolean showCreateMIDlet, boolean showCopySources) {
416
            this.showCreateMIDlet = showCreateMIDlet;
394
            this.showCreateMIDlet = showCreateMIDlet;
417
            this.showSetAsMain = showSetAsMain;
418
            this.showCopySources = showCopySources;
395
            this.showCopySources = showCopySources;
419
        }
396
        }
420
        
397
        
Lines 428-434 Link Here
428
        
405
        
429
        public java.awt.Component getComponent() {
406
        public java.awt.Component getComponent() {
430
            if (component == null) {
407
            if (component == null) {
431
                component = new ProjectPanel(showCreateMIDlet, showSetAsMain, showCopySources); // NOI18N
408
                component = new ProjectPanel(showCreateMIDlet, showCopySources); // NOI18N
432
                component.addListeners(this, this);
409
                component.addListeners(this, this);
433
                checkValid();
410
                checkValid();
434
            }
411
            }
(-)a/mobility.project/src/org/netbeans/modules/mobility/project/ui/wizard/SampleProjectIterator.java (-1 / +1 lines)
Lines 121-127 Link Here
121
            platformPanel = new PlatformInstallPanel.WizardPanel(J2MEPlatform.SPECIFICATION_NAME);
121
            platformPanel = new PlatformInstallPanel.WizardPanel(J2MEPlatform.SPECIFICATION_NAME);
122
            ((JComponent)platformPanel.getComponent()).putClientProperty("NewProjectWizard_Title", NbBundle.getMessage(NewProjectIterator.class, "TXT_SampleProject"));
122
            ((JComponent)platformPanel.getComponent()).putClientProperty("NewProjectWizard_Title", NbBundle.getMessage(NewProjectIterator.class, "TXT_SampleProject"));
123
        }
123
        }
124
        projectPanel = new ProjectPanel.WizardPanel(false, true);
124
        projectPanel = new ProjectPanel.WizardPanel(false);
125
        ((JComponent)projectPanel.getComponent()).putClientProperty("NewProjectWizard_Title", NbBundle.getMessage(NewProjectIterator.class, "TXT_SampleProject"));
125
        ((JComponent)projectPanel.getComponent()).putClientProperty("NewProjectWizard_Title", NbBundle.getMessage(NewProjectIterator.class, "TXT_SampleProject"));
126
        psPanel = new PlatformSelectionPanel();
126
        psPanel = new PlatformSelectionPanel();
127
        String configuration = null;
127
        String configuration = null;
(-)a/mobility.project/src/org/netbeans/modules/mobility/project/ui/wizard/imports/SourcesIterator.java (-1 / +1 lines)
Lines 128-134 Link Here
128
        }
128
        }
129
        sourcesPanel = new SourcesPanel.WizardPanel();
129
        sourcesPanel = new SourcesPanel.WizardPanel();
130
        ((JComponent)sourcesPanel.getComponent()).putClientProperty("NewProjectWizard_Title", NbBundle.getMessage(SourcesIterator.class, "TXT_ExistingImport"));
130
        ((JComponent)sourcesPanel.getComponent()).putClientProperty("NewProjectWizard_Title", NbBundle.getMessage(SourcesIterator.class, "TXT_ExistingImport"));
131
        projectPanel = new ProjectPanel.WizardPanel(false, true);
131
        projectPanel = new ProjectPanel.WizardPanel(false);
132
        psPanel = new PlatformSelectionPanel();
132
        psPanel = new PlatformSelectionPanel();
133
        templateWizard.putProperty(PlatformSelectionPanel.REQUIRED_CONFIGURATION, null);
133
        templateWizard.putProperty(PlatformSelectionPanel.REQUIRED_CONFIGURATION, null);
134
        templateWizard.putProperty(PlatformSelectionPanel.REQUIRED_PROFILE, null);
134
        templateWizard.putProperty(PlatformSelectionPanel.REQUIRED_PROFILE, null);
(-)a/mobility.project/src/org/netbeans/modules/mobility/project/ui/wizard/imports/WtkIterator.java (-1 / +1 lines)
Lines 128-134 Link Here
128
        }
128
        }
129
        wtkPanel = new WtkPanel.WizardPanel();
129
        wtkPanel = new WtkPanel.WizardPanel();
130
        ((JComponent)wtkPanel.getComponent()).putClientProperty("NewProjectWizard_Title", NbBundle.getMessage(SourcesIterator.class, "TXT_WTKImport"));
130
        ((JComponent)wtkPanel.getComponent()).putClientProperty("NewProjectWizard_Title", NbBundle.getMessage(SourcesIterator.class, "TXT_WTKImport"));
131
        projectPanel = new ProjectPanel.WizardPanel(false, true);
131
        projectPanel = new ProjectPanel.WizardPanel(false);
132
        psPanel = new PlatformSelectionPanel();
132
        psPanel = new PlatformSelectionPanel();
133
        templateWizard.putProperty(PlatformSelectionPanel.REQUIRED_CONFIGURATION, null);
133
        templateWizard.putProperty(PlatformSelectionPanel.REQUIRED_CONFIGURATION, null);
134
        templateWizard.putProperty(PlatformSelectionPanel.REQUIRED_PROFILE, null);
134
        templateWizard.putProperty(PlatformSelectionPanel.REQUIRED_PROFILE, null);
(-)a/php.project/src/org/netbeans/modules/php/project/ui/logicalview/PhpLogicalViewProvider.java (-1 lines)
Lines 268-274 Link Here
268
            }
268
            }
269
            actions.add(CommonProjectActions.setProjectConfigurationAction());
269
            actions.add(CommonProjectActions.setProjectConfigurationAction());
270
            actions.add(null);
270
            actions.add(null);
271
            actions.add(CommonProjectActions.setAsMainProjectAction());
272
            //actions.add(CommonProjectActions.openSubprojectsAction()); // does not make sense for php now
271
            //actions.add(CommonProjectActions.openSubprojectsAction()); // does not make sense for php now
273
            actions.add(CommonProjectActions.closeProjectAction());
272
            actions.add(CommonProjectActions.closeProjectAction());
274
            actions.add(null);
273
            actions.add(null);
(-)a/php.project/src/org/netbeans/modules/php/project/ui/wizards/ConfigureProjectPanel.java (-4 lines)
Lines 80-86 Link Here
80
    static final String PROJECT_NAME = "projectName"; // NOI18N
80
    static final String PROJECT_NAME = "projectName"; // NOI18N
81
    static final String PROJECT_DIR = "projectDir"; // NOI18N
81
    static final String PROJECT_DIR = "projectDir"; // NOI18N
82
    static final String IS_PROJECT_DIR_USED = "isProjectDirUsed"; // NOI18N
82
    static final String IS_PROJECT_DIR_USED = "isProjectDirUsed"; // NOI18N
83
    static final String SET_AS_MAIN = "setAsMain"; // NOI18N
84
    static final String SOURCES_FOLDER = "sourcesFolder"; // NOI18N
83
    static final String SOURCES_FOLDER = "sourcesFolder"; // NOI18N
85
    static final String LOCAL_SERVERS = "localServers"; // NOI18N
84
    static final String LOCAL_SERVERS = "localServers"; // NOI18N
86
    static final String PHP_VERSION = "phpVersion"; // NOI18N
85
    static final String PHP_VERSION = "phpVersion"; // NOI18N
Lines 208-216 Link Here
208
207
209
        // encoding
208
        // encoding
210
        settings.putProperty(ENCODING, configureProjectPanelVisual.getEncoding());
209
        settings.putProperty(ENCODING, configureProjectPanelVisual.getEncoding());
211
212
        // set as main project - never set as main
213
        settings.putProperty(SET_AS_MAIN, false);
214
    }
210
    }
215
211
216
    /**
212
    /**
(-)a/php.samples/src/org/netbeans/modules/php/samples/PHPSamplesWizardPanel.java (-4 lines)
Lines 61-68 Link Here
61
    private WizardDescriptor wizardDescriptor;
61
    private WizardDescriptor wizardDescriptor;
62
    private PHPSamplesPanelVisual component;
62
    private PHPSamplesPanelVisual component;
63
63
64
    static final String SET_AS_MAIN = "setAsMain"; // NOI18N
65
66
    public PHPSamplesWizardPanel() {
64
    public PHPSamplesWizardPanel() {
67
    }
65
    }
68
66
Lines 125-132 Link Here
125
        WizardDescriptor d = (WizardDescriptor) settings;
123
        WizardDescriptor d = (WizardDescriptor) settings;
126
        component.store(d);
124
        component.store(d);
127
        d.putProperty("NewProjectWizard_Title", null); // NOI18N
125
        d.putProperty("NewProjectWizard_Title", null); // NOI18N
128
        // set as main project - never set as main
129
        d.putProperty(SET_AS_MAIN, false);
130
    }
126
    }
131
127
132
    public boolean isFinishPanel() {
128
    public boolean isFinishPanel() {
(-)a/projectimport.eclipse.core/src/org/netbeans/modules/projectimport/eclipse/core/ImportProjectAction.java (-9 / +2 lines)
Lines 77-90 Link Here
77
            return;
77
            return;
78
        }
78
        }
79
        performImport(eclProjects, destination, wizard.getExtraPanels(), 
79
        performImport(eclProjects, destination, wizard.getExtraPanels(), 
80
                wizard.getNumberOfImportedProject(), false, true, true, null, null);
80
                wizard.getNumberOfImportedProject(), true, true, null, null);
81
    }
81
    }
82
    
82
    
83
    public static void performImport(List<EclipseProject> eclProjects, String destination, 
83
    public static void performImport(List<EclipseProject> eclProjects, String destination, List<WizardDescriptor.Panel<WizardDescriptor>> extraPanels, int numberOfImportedProject, final boolean showReport, final boolean openProjects, final List<String> importProblems, final List<Project> createdProjects) {
84
            List<WizardDescriptor.Panel<WizardDescriptor>> extraPanels, int numberOfImportedProject, 
85
            final boolean setMain, final boolean showReport, 
86
            final boolean openProjects, final List<String> importProblems, 
87
            final List<Project> createdProjects) {
88
        
84
        
89
        final Importer importer = new Importer(eclProjects, destination, extraPanels);
85
        final Importer importer = new Importer(eclProjects, destination, extraPanels);
90
        
86
        
Lines 120-128 Link Here
120
                        }
116
                        }
121
                        if (openProjects) {
117
                        if (openProjects) {
122
                            OpenProjects.getDefault().open(importer.getProjects(), true);
118
                            OpenProjects.getDefault().open(importer.getProjects(), true);
123
                            if (setMain) {
124
                                OpenProjects.getDefault().setMainProject(importer.getProjects()[importer.getProjects().length-1]);
125
                            }
126
                        }
119
                        }
127
                    }
120
                    }
128
                }
121
                }
(-)a/projectimport.eclipse.core/src/org/netbeans/modules/projectimport/eclipse/core/UpdateAllProjects.java (-1 / +1 lines)
Lines 167-173 Link Here
167
        for (Map.Entry<File, ProjectsAndDestination> entry : workspaceProjectsMap.entrySet()) {
167
        for (Map.Entry<File, ProjectsAndDestination> entry : workspaceProjectsMap.entrySet()) {
168
            ImportProjectAction.performImport(ProjectSelectionPanel.getFlattenedProjects(entry.getValue().eps), 
168
            ImportProjectAction.performImport(ProjectSelectionPanel.getFlattenedProjects(entry.getValue().eps), 
169
                    entry.getValue().dest == null ? null : entry.getValue().dest.getPath(), null, 
169
                    entry.getValue().dest == null ? null : entry.getValue().dest.getPath(), null, 
170
                    entry.getValue().eps.size(), false, false, true, importProblems, createdProjects);
170
                    entry.getValue().eps.size(), false, true, importProblems, createdProjects);
171
        }
171
        }
172
        return Boolean.TRUE;
172
        return Boolean.TRUE;
173
    }
173
    }
(-)a/projectui/src/org/netbeans/modules/project/ui/Bundle.properties (-14 lines)
Lines 76-82 Link Here
76
MNM_PrjChooser_ApproveButtonText=O
76
MNM_PrjChooser_ApproveButtonText=O
77
LBL_PrjChooser_ProjectDirectoryFilter_Name=Project Folder
77
LBL_PrjChooser_ProjectDirectoryFilter_Name=Project Folder
78
LBL_PrjChooser_ProjectName_Label=&Project Name\:
78
LBL_PrjChooser_ProjectName_Label=&Project Name\:
79
LBL_PrjChooser_Main_CheckBox=Open as &Main Project
80
LBL_PrjChooser_Subprojects_CheckBox=Open &Required Projects\:
79
LBL_PrjChooser_Subprojects_CheckBox=Open &Required Projects\:
81
MSG_PrjChooser_WaitMessage=Please wait ...
80
MSG_PrjChooser_WaitMessage=Please wait ...
82
# {0} number of projects
81
# {0} number of projects
Lines 108-121 Link Here
108
Templates/Licenses/license-default.txt=Default License
107
Templates/Licenses/license-default.txt=Default License
109
Toolbars/Build=&Run
108
Toolbars/Build=&Run
110
109
111
112
#NoMainProjectWarning
113
LBL_NoMainProjectWarning_jLabel1=The main project has not been set.
114
LBL_NoMainProjectWarning_jLabel2=&Select the main project\:
115
LBL_NoMainClassWarning_ChooseMainProject_OK=OK
116
AD_NoMainClassWarning_ChooseMainProject_OK=N/A
117
CTL_NoMainProjectWarning_Title=Warning
118
119
ACC_InfiniteProgressName=Infinite Progress Bar
110
ACC_InfiniteProgressName=Infinite Progress Bar
120
ACC_InfiniteProgressDesc=Shows some tasks are in progress.
111
ACC_InfiniteProgressDesc=Shows some tasks are in progress.
121
112
Lines 201-207 Link Here
201
192
202
ACSN_BrowseFolders=Browse folders to choose a target folder
193
ACSN_BrowseFolders=Browse folders to choose a target folder
203
194
204
ACSD_ProjectChooserAccessory_jCheckBoxMain=N/A
205
ACSD_ProjectChooserAccessory_jCheckBoxSubprojects=Opens also the projects of which depends the selected project
195
ACSD_ProjectChooserAccessory_jCheckBoxSubprojects=Opens also the projects of which depends the selected project
206
196
207
ACSN_ProjectChooserAccessory_jListSubprojects=List of the subprojects
197
ACSN_ProjectChooserAccessory_jListSubprojects=List of the subprojects
Lines 228-237 Link Here
228
AN_ProjectName=N/A
218
AN_ProjectName=N/A
229
AD_ProjectName=N/A
219
AD_ProjectName=N/A
230
220
231
AD_NoMainProjectWarning_jList1=N/A
232
233
AD_NoMainProjectWarninig=N/A
234
235
#localized folder name to show in toolbar customizer
221
#localized folder name to show in toolbar customizer
236
Actions/Window/SelectDocumentNode=Select Document in
222
Actions/Window/SelectDocumentNode=Select Document in
237
#Open Project when select node failes
223
#Open Project when select node failes
(-)a/projectui/src/org/netbeans/modules/project/ui/NoMainProjectWarning.form (-77 lines)
Lines 1-77 Link Here
1
<?xml version="1.0" encoding="UTF-8" ?>
2
3
<Form version="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <Properties>
5
    <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
6
      <Dimension value="[380, 300]"/>
7
    </Property>
8
  </Properties>
9
  <AccessibilityProperties>
10
    <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
11
      <ResourceString bundle="org/netbeans/modules/project/ui/Bundle.properties" key="AD_NoMainProjectWarninig" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
12
    </Property>
13
  </AccessibilityProperties>
14
  <AuxValues>
15
    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
16
    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
17
    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
18
    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
19
  </AuxValues>
20
21
  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
22
  <SubComponents>
23
    <Component class="javax.swing.JLabel" name="jLabel1">
24
      <Properties>
25
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
26
          <ResourceString bundle="org/netbeans/modules/project/ui/Bundle.properties" key="LBL_NoMainProjectWarning_jLabel1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
27
        </Property>
28
      </Properties>
29
      <Constraints>
30
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
31
          <GridBagConstraints gridX="0" gridY="0" gridWidth="0" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="12" insetsLeft="0" insetsBottom="6" insetsRight="12" anchor="18" weightX="1.0" weightY="0.0"/>
32
        </Constraint>
33
      </Constraints>
34
    </Component>
35
    <Component class="javax.swing.JLabel" name="jLabel2">
36
      <Properties>
37
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
38
          <ComponentRef name="jList1"/>
39
        </Property>
40
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
41
          <ResourceString bundle="org/netbeans/modules/project/ui/Bundle.properties" key="LBL_NoMainProjectWarning_jLabel2" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
42
        </Property>
43
      </Properties>
44
      <Constraints>
45
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
46
          <GridBagConstraints gridX="0" gridY="1" gridWidth="0" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="12" insetsLeft="0" insetsBottom="2" insetsRight="12" anchor="18" weightX="1.0" weightY="0.0"/>
47
        </Constraint>
48
      </Constraints>
49
    </Component>
50
    <Container class="javax.swing.JScrollPane" name="jScrollPane2">
51
      <Properties>
52
        <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
53
          <Dimension value="[100, 200]"/>
54
        </Property>
55
      </Properties>
56
      <Constraints>
57
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
58
          <GridBagConstraints gridX="0" gridY="2" gridWidth="0" gridHeight="0" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="12" insetsRight="12" anchor="18" weightX="1.0" weightY="1.0"/>
59
        </Constraint>
60
      </Constraints>
61
62
      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
63
      <SubComponents>
64
        <Component class="javax.swing.JList" name="jList1">
65
          <Properties>
66
            <Property name="selectionMode" type="int" value="0"/>
67
          </Properties>
68
          <AccessibilityProperties>
69
            <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
70
              <ResourceString bundle="org/netbeans/modules/project/ui/Bundle.properties" key="AD_NoMainProjectWarning_jList1" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
71
            </Property>
72
          </AccessibilityProperties>
73
        </Component>
74
      </SubComponents>
75
    </Container>
76
  </SubComponents>
77
</Form>
(-)a/projectui/src/org/netbeans/modules/project/ui/NoMainProjectWarning.java (-221 lines)
Lines 1-221 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * Contributor(s):
28
 *
29
 * The Original Software is NetBeans. The Initial Developer of the Original
30
 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
31
 * Microsystems, Inc. All Rights Reserved.
32
 *
33
 * If you wish your version of this file to be governed by only the CDDL
34
 * or only the GPL Version 2, indicate your decision by adding
35
 * "[Contributor] elects to include this software in this distribution
36
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
37
 * single choice of license, a recipient has the option to distribute
38
 * your version of this file under either the CDDL, the GPL Version 2 or
39
 * to extend the choice of license to its licensees as provided above.
40
 * However, if you add GPL Version 2 code and therefore, elected the GPL
41
 * Version 2 license, then the option applies only if the new code is
42
 * made subject to such option by the copyright holder.
43
 */
44
45
package org.netbeans.modules.project.ui;
46
47
import java.awt.event.MouseEvent;
48
import java.awt.event.MouseListener;
49
import java.util.Arrays;
50
import javax.swing.*;
51
import javax.swing.event.ChangeEvent;
52
import javax.swing.event.ChangeListener;
53
import javax.swing.event.ListSelectionEvent;
54
import javax.swing.event.ListSelectionListener;
55
import org.netbeans.api.project.Project;
56
import org.openide.awt.MouseUtils;
57
58
/** Show a warning that no main project is set and allows choose it.
59
 *
60
 * @author  Jiri Rechtacek
61
 */
62
public class NoMainProjectWarning extends JPanel {
63
    
64
    private ChangeListener changeListener;
65
    
66
    /** Creates new form NoMainProjectWarning */
67
    public NoMainProjectWarning (Project[] projects) {
68
        initComponents();
69
70
        Arrays.sort(projects, OpenProjectList.projectByDisplayName()); // #88907
71
        ProjectsListModel model = new ProjectsListModel (projects);
72
        jList1.setModel (model);
73
        jList1.setSelectionMode (ListSelectionModel.SINGLE_SELECTION);
74
        if (model.getSize () > 0) {
75
            jList1.setSelectedIndex (0);
76
        }
77
        jList1.setCellRenderer(new ProjectCellRenderer());
78
        jList1.addListSelectionListener (new ListSelectionListener () {
79
            public void valueChanged (ListSelectionEvent evt) {
80
                if (changeListener != null) {
81
                    changeListener.stateChanged (new ChangeEvent (evt));
82
                }
83
            }
84
        });
85
        // support for double click to finish dialog with selected class
86
        jList1.addMouseListener (new MouseListener () {
87
            public void mouseClicked (MouseEvent e) {
88
                if (MouseUtils.isDoubleClick (e)) {
89
                    if (getSelectedProject () != null) {
90
                        if (changeListener != null) {
91
                            changeListener.stateChanged (new ChangeEvent (e));
92
                        }
93
                    }
94
                }
95
            }
96
            public void mousePressed (MouseEvent e) {}
97
            public void mouseReleased (MouseEvent e) {}
98
            public void mouseEntered (MouseEvent e) {}
99
            public void mouseExited (MouseEvent e) {}
100
        });
101
    }
102
    
103
    /** Returns the selected project or null if no project is selected.
104
     *
105
     * @return project or null if no project is selected
106
     */ 
107
    public Project getSelectedProject () {
108
        if (jList1.getSelectedIndex () == -1) {
109
            return null;
110
        } else {
111
            return (Project)jList1.getSelectedValue ();
112
        }
113
    }
114
115
    /** This method is called from within the constructor to
116
     * initialize the form.
117
     * WARNING: Do NOT modify this code. The content of this method is
118
     * always regenerated by the Form Editor.
119
     */
120
    private void initComponents() {//GEN-BEGIN:initComponents
121
        java.awt.GridBagConstraints gridBagConstraints;
122
123
        jLabel1 = new javax.swing.JLabel();
124
        jLabel2 = new javax.swing.JLabel();
125
        jScrollPane2 = new javax.swing.JScrollPane();
126
        jList1 = new javax.swing.JList();
127
128
        setLayout(new java.awt.GridBagLayout());
129
130
        setPreferredSize(new java.awt.Dimension(380, 300));
131
        getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/project/ui/Bundle").getString("AD_NoMainProjectWarninig"));
132
        org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(NoMainProjectWarning.class, "LBL_NoMainProjectWarning_jLabel1"));
133
        gridBagConstraints = new java.awt.GridBagConstraints();
134
        gridBagConstraints.gridx = 0;
135
        gridBagConstraints.gridy = 0;
136
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
137
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
138
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
139
        gridBagConstraints.weightx = 1.0;
140
        gridBagConstraints.insets = new java.awt.Insets(12, 0, 6, 12);
141
        add(jLabel1, gridBagConstraints);
142
143
        jLabel2.setLabelFor(jList1);
144
        org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(NoMainProjectWarning.class, "LBL_NoMainProjectWarning_jLabel2"));
145
        gridBagConstraints = new java.awt.GridBagConstraints();
146
        gridBagConstraints.gridx = 0;
147
        gridBagConstraints.gridy = 1;
148
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
149
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
150
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
151
        gridBagConstraints.weightx = 1.0;
152
        gridBagConstraints.insets = new java.awt.Insets(12, 0, 2, 12);
153
        add(jLabel2, gridBagConstraints);
154
155
        jScrollPane2.setMinimumSize(new java.awt.Dimension(100, 200));
156
        jList1.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
157
        jScrollPane2.setViewportView(jList1);
158
        jList1.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/project/ui/Bundle").getString("AD_NoMainProjectWarning_jList1"));
159
160
        gridBagConstraints = new java.awt.GridBagConstraints();
161
        gridBagConstraints.gridx = 0;
162
        gridBagConstraints.gridy = 2;
163
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
164
        gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
165
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
166
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
167
        gridBagConstraints.weightx = 1.0;
168
        gridBagConstraints.weighty = 1.0;
169
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 12, 12);
170
        add(jScrollPane2, gridBagConstraints);
171
172
    }//GEN-END:initComponents
173
174
175
    // Variables declaration - do not modify//GEN-BEGIN:variables
176
    private javax.swing.JLabel jLabel1;
177
    private javax.swing.JLabel jLabel2;
178
    private javax.swing.JList jList1;
179
    private javax.swing.JScrollPane jScrollPane2;
180
    // End of variables declaration//GEN-END:variables
181
182
183
    public void addChangeListener (ChangeListener l) {
184
        changeListener = l;
185
    }
186
    
187
    public void removeChangeListener (ChangeListener l) {
188
        changeListener = null;
189
    }
190
    
191
    private static final class ProjectsListModel extends AbstractListModel {
192
        
193
        private Project[] openProjects;
194
195
        public ProjectsListModel (Project[] projects) {
196
            openProjects = projects;
197
        }
198
199
        public synchronized int getSize() {
200
            return getProjects ().length;
201
        }
202
203
        public synchronized Object getElementAt (int index) {            
204
            if (index >= 0 && index < getProjects ().length) {
205
                return getProjects ()[index];
206
            }
207
            else {
208
                return null;
209
            }
210
        }
211
212
        private Project[] getProjects () {
213
            if (openProjects == null) {
214
                return new Project[0];
215
            } else {
216
                return openProjects;
217
            }
218
        }
219
    }
220
221
}
(-)a/projectui/src/org/netbeans/modules/project/ui/OpenProjectListSettings.java (-9 lines)
Lines 70-76 Link Here
70
    private static final String PROP_PROJECT_CATEGORY = "lastSelectedProjectCategory"; //NOI18N - String
70
    private static final String PROP_PROJECT_CATEGORY = "lastSelectedProjectCategory"; //NOI18N - String
71
    private static final String PROP_PROJECT_TYPE = "lastSelectedProjectType"; //NOI18N - String
71
    private static final String PROP_PROJECT_TYPE = "lastSelectedProjectType"; //NOI18N - String
72
    private static final String MAIN_PROJECT_URL = "mainProjectURL"; //NOI18N -URL
72
    private static final String MAIN_PROJECT_URL = "mainProjectURL"; //NOI18N -URL
73
    private static final String OPEN_AS_MAIN = "openAsMain"; //NOI18N - boolean
74
    private static final String OPEN_PROJECTS_URLS = "openProjectsURLs"; //NOI18N - List of URLs
73
    private static final String OPEN_PROJECTS_URLS = "openProjectsURLs"; //NOI18N - List of URLs
75
    private static final String OPEN_PROJECTS_DISPLAY_NAMES = "openProjectsDisplayNames"; //NOI18N - List of names
74
    private static final String OPEN_PROJECTS_DISPLAY_NAMES = "openProjectsDisplayNames"; //NOI18N - List of names
76
    private static final String OPEN_PROJECTS_ICONS = "openProjectsIcons"; //NOI18N - List of icons
75
    private static final String OPEN_PROJECTS_ICONS = "openProjectsIcons"; //NOI18N - List of icons
Lines 235-248 Link Here
235
        getPreferences().putBoolean(OPEN_SUBPROJECTS, openSubprojects);
234
        getPreferences().putBoolean(OPEN_SUBPROJECTS, openSubprojects);
236
    }
235
    }
237
    
236
    
238
    public boolean isOpenAsMain() {        
239
        return getPreferences().getBoolean(OPEN_AS_MAIN, false);
240
    }
241
    
242
    public void setOpenAsMain( boolean openAsMain ) {
243
        getPreferences().putBoolean(OPEN_AS_MAIN, openAsMain);
244
    }
245
    
246
    public URL getMainProjectURL() {
237
    public URL getMainProjectURL() {
247
        String str = getProperty(MAIN_PROJECT_URL);
238
        String str = getProperty(MAIN_PROJECT_URL);
248
        if (str != null) {
239
        if (str != null) {
(-)a/projectui/src/org/netbeans/modules/project/ui/ProjectChooserAccessory.form (-23 lines)
Lines 58-86 Link Here
58
        </Constraint>
58
        </Constraint>
59
      </Constraints>
59
      </Constraints>
60
    </Component>
60
    </Component>
61
    <Component class="javax.swing.JCheckBox" name="jCheckBoxMain">
62
      <Properties>
63
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
64
          <ResourceString bundle="org/netbeans/modules/project/ui/Bundle.properties" key="LBL_PrjChooser_Main_CheckBox" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
65
        </Property>
66
        <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
67
          <Insets value="[2, 0, 2, 2]"/>
68
        </Property>
69
      </Properties>
70
      <AccessibilityProperties>
71
        <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
72
          <ResourceString bundle="org/netbeans/modules/project/ui/Bundle.properties" key="ACSD_ProjectChooserAccessory_jCheckBoxMain" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
73
        </Property>
74
      </AccessibilityProperties>
75
      <AuxValues>
76
        <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
77
      </AuxValues>
78
      <Constraints>
79
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
80
          <GridBagConstraints gridX="-1" gridY="-1" gridWidth="0" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="12" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/>
81
        </Constraint>
82
      </Constraints>
83
    </Component>
84
    <Component class="javax.swing.JCheckBox" name="jCheckBoxSubprojects">
61
    <Component class="javax.swing.JCheckBox" name="jCheckBoxSubprojects">
85
      <Properties>
62
      <Properties>
86
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
63
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
(-)a/projectui/src/org/netbeans/modules/project/ui/ProjectChooserAccessory.java (-46 / +13 lines)
Lines 93-103 Link Here
93
    private RequestProcessor RP2;
93
    private RequestProcessor RP2;
94
    
94
    
95
    ModelUpdater modelUpdater;  //#101227 -> non-private
95
    ModelUpdater modelUpdater;  //#101227 -> non-private
96
    private Boolean tempSetAsMain;
97
96
98
    private Map<Project,Set<? extends Project>> subprojectsCache = new HashMap<Project,Set<? extends Project>>(); // #59098
97
    private Map<Project,Set<? extends Project>> subprojectsCache = new HashMap<Project,Set<? extends Project>>(); // #59098
99
    /** Creates new form ProjectChooserAccessory */
98
    /** Creates new form ProjectChooserAccessory */
100
    public ProjectChooserAccessory( JFileChooser chooser, boolean isOpenSubprojects, boolean isOpenAsMain ) {
99
    public ProjectChooserAccessory(JFileChooser chooser, boolean isOpenSubprojects) {
101
        initComponents();
100
        initComponents();
102
101
103
        modelUpdater = new ModelUpdater();
102
        modelUpdater = new ModelUpdater();
Lines 111-120 Link Here
111
        jCheckBoxSubprojects.setSelected( isOpenSubprojects );
110
        jCheckBoxSubprojects.setSelected( isOpenSubprojects );
112
        jCheckBoxSubprojects.addActionListener( this );
111
        jCheckBoxSubprojects.addActionListener( this );
113
112
114
        // Listen on the main checkbox to change the option accordingly
115
        jCheckBoxMain.setSelected( isOpenAsMain );
116
        jCheckBoxMain.addActionListener( this );
117
118
        // Listen on the chooser to update the Accessory
113
        // Listen on the chooser to update the Accessory
119
        chooser.addPropertyChangeListener( this );
114
        chooser.addPropertyChangeListener( this );
120
115
Lines 131-158 Link Here
131
     * WARNING: Do NOT modify this code. The content of this method is
126
     * WARNING: Do NOT modify this code. The content of this method is
132
     * always regenerated by the Form Editor.
127
     * always regenerated by the Form Editor.
133
     */
128
     */
134
    private void initComponents() {//GEN-BEGIN:initComponents
129
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
130
    private void initComponents() {
135
        java.awt.GridBagConstraints gridBagConstraints;
131
        java.awt.GridBagConstraints gridBagConstraints;
136
132
137
        jLabelProjectName = new javax.swing.JLabel();
133
        jLabelProjectName = new javax.swing.JLabel();
138
        jTextFieldProjectName = new javax.swing.JTextField();
134
        jTextFieldProjectName = new javax.swing.JTextField();
139
        jCheckBoxMain = new javax.swing.JCheckBox();
140
        jCheckBoxSubprojects = new javax.swing.JCheckBox();
135
        jCheckBoxSubprojects = new javax.swing.JCheckBox();
141
        jScrollPaneSubprojects = new javax.swing.JScrollPane();
136
        jScrollPaneSubprojects = new javax.swing.JScrollPane();
142
        jListSubprojects = new javax.swing.JList();
137
        jListSubprojects = new javax.swing.JList();
143
138
139
        setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 12, 0, 0));
144
        setLayout(new java.awt.GridBagLayout());
140
        setLayout(new java.awt.GridBagLayout());
145
141
146
        setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(0, 12, 0, 0)));
147
        jLabelProjectName.setLabelFor(jTextFieldProjectName);
142
        jLabelProjectName.setLabelFor(jTextFieldProjectName);
148
        org.openide.awt.Mnemonics.setLocalizedText(jLabelProjectName, org.openide.util.NbBundle.getMessage(ProjectChooserAccessory.class, "LBL_PrjChooser_ProjectName_Label"));
143
        org.openide.awt.Mnemonics.setLocalizedText(jLabelProjectName, org.openide.util.NbBundle.getMessage(ProjectChooserAccessory.class, "LBL_PrjChooser_ProjectName_Label")); // NOI18N
149
        gridBagConstraints = new java.awt.GridBagConstraints();
144
        gridBagConstraints = new java.awt.GridBagConstraints();
150
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
145
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
151
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
146
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
152
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 2, 0);
147
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 2, 0);
153
        add(jLabelProjectName, gridBagConstraints);
148
        add(jLabelProjectName, gridBagConstraints);
154
        jLabelProjectName.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ProjectChooserAccessory.class, "AN_ProjectName"));
149
        jLabelProjectName.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ProjectChooserAccessory.class, "AN_ProjectName")); // NOI18N
155
        jLabelProjectName.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectChooserAccessory.class, "AD_ProjectName"));
150
        jLabelProjectName.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectChooserAccessory.class, "AD_ProjectName")); // NOI18N
156
151
157
        jTextFieldProjectName.setEditable(false);
152
        jTextFieldProjectName.setEditable(false);
158
        gridBagConstraints = new java.awt.GridBagConstraints();
153
        gridBagConstraints = new java.awt.GridBagConstraints();
Lines 162-190 Link Here
162
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 0);
157
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 0);
163
        add(jTextFieldProjectName, gridBagConstraints);
158
        add(jTextFieldProjectName, gridBagConstraints);
164
159
165
        org.openide.awt.Mnemonics.setLocalizedText(jCheckBoxMain, org.openide.util.NbBundle.getMessage(ProjectChooserAccessory.class, "LBL_PrjChooser_Main_CheckBox"));
160
        org.openide.awt.Mnemonics.setLocalizedText(jCheckBoxSubprojects, org.openide.util.NbBundle.getMessage(ProjectChooserAccessory.class, "LBL_PrjChooser_Subprojects_CheckBox")); // NOI18N
166
        jCheckBoxMain.setMargin(new java.awt.Insets(2, 0, 2, 2));
167
        gridBagConstraints = new java.awt.GridBagConstraints();
168
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
169
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
170
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 12, 0);
171
        add(jCheckBoxMain, gridBagConstraints);
172
        jCheckBoxMain.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectChooserAccessory.class, "ACSD_ProjectChooserAccessory_jCheckBoxMain"));
173
174
        org.openide.awt.Mnemonics.setLocalizedText(jCheckBoxSubprojects, org.openide.util.NbBundle.getMessage(ProjectChooserAccessory.class, "LBL_PrjChooser_Subprojects_CheckBox"));
175
        jCheckBoxSubprojects.setMargin(new java.awt.Insets(2, 0, 2, 2));
161
        jCheckBoxSubprojects.setMargin(new java.awt.Insets(2, 0, 2, 2));
176
        gridBagConstraints = new java.awt.GridBagConstraints();
162
        gridBagConstraints = new java.awt.GridBagConstraints();
177
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
163
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
178
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
164
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
179
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 2, 0);
165
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 2, 0);
180
        add(jCheckBoxSubprojects, gridBagConstraints);
166
        add(jCheckBoxSubprojects, gridBagConstraints);
181
        jCheckBoxSubprojects.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectChooserAccessory.class, "ACSD_ProjectChooserAccessory_jCheckBoxSubprojects"));
167
        jCheckBoxSubprojects.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectChooserAccessory.class, "ACSD_ProjectChooserAccessory_jCheckBoxSubprojects")); // NOI18N
182
168
183
        jListSubprojects.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
169
        jListSubprojects.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
184
        jListSubprojects.setEnabled(false);
170
        jListSubprojects.setEnabled(false);
185
        jScrollPaneSubprojects.setViewportView(jListSubprojects);
171
        jScrollPaneSubprojects.setViewportView(jListSubprojects);
186
        jListSubprojects.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ProjectChooserAccessory.class, "ACSN_ProjectChooserAccessory_jListSubprojects"));
172
        jListSubprojects.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ProjectChooserAccessory.class, "ACSN_ProjectChooserAccessory_jListSubprojects")); // NOI18N
187
        jListSubprojects.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectChooserAccessory.class, "ACSD_ProjectChooserAccessory_jListSubprojects"));
173
        jListSubprojects.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProjectChooserAccessory.class, "ACSD_ProjectChooserAccessory_jListSubprojects")); // NOI18N
188
174
189
        gridBagConstraints = new java.awt.GridBagConstraints();
175
        gridBagConstraints = new java.awt.GridBagConstraints();
190
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
176
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
Lines 193-204 Link Here
193
        gridBagConstraints.weightx = 1.0;
179
        gridBagConstraints.weightx = 1.0;
194
        gridBagConstraints.weighty = 1.0;
180
        gridBagConstraints.weighty = 1.0;
195
        add(jScrollPaneSubprojects, gridBagConstraints);
181
        add(jScrollPaneSubprojects, gridBagConstraints);
196
182
    }// </editor-fold>//GEN-END:initComponents
197
    }//GEN-END:initComponents
198
183
199
184
200
    // Variables declaration - do not modify//GEN-BEGIN:variables
185
    // Variables declaration - do not modify//GEN-BEGIN:variables
201
    private javax.swing.JCheckBox jCheckBoxMain;
202
    private javax.swing.JCheckBox jCheckBoxSubprojects;
186
    private javax.swing.JCheckBox jCheckBoxSubprojects;
203
    private javax.swing.JLabel jLabelProjectName;
187
    private javax.swing.JLabel jLabelProjectName;
204
    private javax.swing.JList jListSubprojects;
188
    private javax.swing.JList jListSubprojects;
Lines 212-220 Link Here
212
        if ( e.getSource() == jCheckBoxSubprojects ) {
196
        if ( e.getSource() == jCheckBoxSubprojects ) {
213
            OpenProjectListSettings.getInstance().setOpenSubprojects( jCheckBoxSubprojects.isSelected() );
197
            OpenProjectListSettings.getInstance().setOpenSubprojects( jCheckBoxSubprojects.isSelected() );
214
        }
198
        }
215
        else if ( e.getSource() == jCheckBoxMain ) {
216
            OpenProjectListSettings.getInstance().setOpenAsMain( jCheckBoxMain.isSelected() );
217
        }
218
    }
199
    }
219
200
220
    public void propertyChange( PropertyChangeEvent e ) {
201
    public void propertyChange( PropertyChangeEvent e ) {
Lines 381-400 Link Here
381
        jTextFieldProjectName.setForeground(/* i.e. L&F default */null);
362
        jTextFieldProjectName.setForeground(/* i.e. L&F default */null);
382
        jCheckBoxSubprojects.setEnabled( enable );
363
        jCheckBoxSubprojects.setEnabled( enable );
383
        jScrollPaneSubprojects.setEnabled( enable );
364
        jScrollPaneSubprojects.setEnabled( enable );
384
385
        if ( numberOfProjects <= 1 ) {
386
            if ( tempSetAsMain != null ) {
387
                jCheckBoxMain.setSelected(tempSetAsMain);
388
                tempSetAsMain = null;
389
            }
390
            jCheckBoxMain.setEnabled( enable );
391
        }
392
        else if ( tempSetAsMain == null ) {
393
            tempSetAsMain = jCheckBoxMain.isSelected();
394
            jCheckBoxMain.setSelected( false );
395
            jCheckBoxMain.setEnabled( false );
396
        }
397
398
    }
365
    }
399
366
400
367
Lines 478-484 Link Here
478
445
479
446
480
        if ( defaultAccessory ) {
447
        if ( defaultAccessory ) {
481
            chooser.setAccessory( new ProjectChooserAccessory( chooser, opls.isOpenSubprojects(), opls.isOpenAsMain() ) );
448
            chooser.setAccessory(new ProjectChooserAccessory(chooser, opls.isOpenSubprojects()));
482
        }
449
        }
483
450
484
        File currDir = null;
451
        File currDir = null;
(-)a/projectui/src/org/netbeans/modules/project/ui/actions/MainProjectAction.java (-66 / +7 lines)
Lines 44-75 Link Here
44
44
45
package org.netbeans.modules.project.ui.actions;
45
package org.netbeans.modules.project.ui.actions;
46
46
47
import java.awt.Dialog;
48
import java.awt.Toolkit;
47
import java.awt.Toolkit;
49
import java.awt.event.MouseEvent;
50
import java.beans.PropertyChangeEvent;
48
import java.beans.PropertyChangeEvent;
51
import java.beans.PropertyChangeListener;
49
import java.beans.PropertyChangeListener;
52
import java.text.MessageFormat;
50
import java.text.MessageFormat;
53
import java.util.Arrays;
51
import java.util.Arrays;
54
import javax.swing.Icon;
52
import javax.swing.Icon;
55
import javax.swing.JButton;
56
import javax.swing.event.ChangeEvent;
57
import javax.swing.event.ChangeListener;
58
import org.netbeans.api.project.Project;
53
import org.netbeans.api.project.Project;
59
import org.netbeans.api.project.ProjectUtils;
54
import org.netbeans.api.project.ProjectUtils;
60
import org.netbeans.api.project.ui.OpenProjects;
55
import org.netbeans.api.project.ui.OpenProjects;
61
import org.netbeans.modules.project.ui.NoMainProjectWarning;
62
import org.netbeans.modules.project.ui.OpenProjectList;
56
import org.netbeans.modules.project.ui.OpenProjectList;
57
import static org.netbeans.modules.project.ui.actions.Bundle.*;
63
import org.netbeans.spi.project.ActionProvider;
58
import org.netbeans.spi.project.ActionProvider;
64
import org.netbeans.spi.project.ui.support.ProjectActionPerformer;
59
import org.netbeans.spi.project.ui.support.ProjectActionPerformer;
65
import org.openide.DialogDescriptor;
66
import org.openide.DialogDisplayer;
60
import org.openide.DialogDisplayer;
61
import org.openide.NotifyDescriptor;
67
import org.openide.awt.Actions;
62
import org.openide.awt.Actions;
68
import org.openide.awt.MouseUtils;
69
import org.openide.loaders.DataObject;
63
import org.openide.loaders.DataObject;
70
import org.openide.util.Lookup;
64
import org.openide.util.Lookup;
71
import org.openide.util.Mutex;
65
import org.openide.util.Mutex;
72
import org.openide.util.NbBundle;
66
import org.openide.util.NbBundle.Messages;
73
import org.openide.util.WeakListeners;
67
import org.openide.util.WeakListeners;
74
68
75
/** Invokes command on the main project.
69
/** Invokes command on the main project.
Lines 121-128 Link Here
121
        return needsInit;
115
        return needsInit;
122
    }
116
    }
123
117
124
118
    @Messages("MainProjectAction.no_main=Set a main project, or select one project or project file, or keep just one project open.")
125
126
    public @Override void actionPerformed(Lookup context) {
119
    public @Override void actionPerformed(Lookup context) {
127
        // first try to find main project
120
        // first try to find main project
128
        Project p = OpenProjectList.getDefault().getMainProject();
121
        Project p = OpenProjectList.getDefault().getMainProject();
Lines 144-157 Link Here
144
        }
137
        }
145
138
146
        // if no main project or no selected or more than one project opened,
139
        // if no main project or no selected or more than one project opened,
147
        // then show warning and allow choose a main project
140
        // then show warning
148
        if (p == null) {
141
        if (p == null) {
149
            // show warning, if cancel then return
142
            DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(MainProjectAction_no_main(), NotifyDescriptor.WARNING_MESSAGE));
150
            if (showNoMainProjectWarning (OpenProjectList.getDefault().getOpenProjects (), 
143
            return;
151
                    getPresenterName(name, OpenProjectList.getDefault().getMainProject(), p))) {
152
                return ;
153
            }
154
            p = OpenProjectList.getDefault().getMainProject();
155
        }
144
        }
156
145
157
        if ( command != null ) {
146
        if ( command != null ) {
Lines 263-316 Link Here
263
        return toReturn;
252
        return toReturn;
264
    }
253
    }
265
254
266
    private boolean showNoMainProjectWarning(Project[] projects, String action) {
267
        boolean canceled;
268
        final JButton okButton = new JButton (NbBundle.getMessage (NoMainProjectWarning.class, "LBL_NoMainClassWarning_ChooseMainProject_OK")); // NOI18N
269
        okButton.getAccessibleContext().setAccessibleDescription (NbBundle.getMessage (NoMainProjectWarning.class, "AD_NoMainClassWarning_ChooseMainProject_OK"));
270
271
        // no main project set => warning
272
        final NoMainProjectWarning panel = new NoMainProjectWarning (projects);
273
274
        Object[] options = new Object[] {
275
            okButton,
276
            DialogDescriptor.CANCEL_OPTION
277
        };
278
279
        panel.addChangeListener (new ChangeListener () {
280
           public @Override void stateChanged (ChangeEvent e) {
281
               if (e.getSource () instanceof MouseEvent && MouseUtils.isDoubleClick (((MouseEvent)e.getSource ()))) {
282
                   // click button and the finish dialog with selected class
283
                   if (panel.getSelectedProject () != null) {
284
                       okButton.doClick ();
285
                   }
286
               } else {
287
                   okButton.setEnabled (panel.getSelectedProject () != null);
288
               }
289
           }
290
        });
291
292
        okButton.setEnabled (panel.getSelectedProject () != null);
293
294
        DialogDescriptor desc = new DialogDescriptor (panel,
295
                action == null ?
296
                    NbBundle.getMessage(NoMainProjectWarning.class, "CTL_NoMainProjectWarning_Title") :
297
                    Actions.cutAmpersand(action),
298
            true, options, options[0], DialogDescriptor.DEFAULT_ALIGN, null, null);
299
        desc.setMessageType (DialogDescriptor.INFORMATION_MESSAGE);
300
        Dialog dlg = DialogDisplayer.getDefault ().createDialog (desc);
301
        dlg.setVisible (true);
302
        if (desc.getValue() != options[0]) {
303
            canceled = true;
304
        } else {
305
            Project mainProject = panel.getSelectedProject ();
306
            OpenProjectList.getDefault ().setMainProject (mainProject);
307
            canceled = false;
308
        }
309
        dlg.dispose();
310
311
        return canceled;
312
    }
313
314
    @Override
255
    @Override
315
    protected void refresh(Lookup context, boolean immediate) {
256
    protected void refresh(Lookup context, boolean immediate) {
316
        refreshView(context, immediate);
257
        refreshView(context, immediate);
(-)a/projectui/src/org/netbeans/modules/project/ui/actions/OpenProject.java (-7 / +1 lines)
Lines 129-140 Link Here
129
                    Project projectsArray[] = new Project[ projects.size() ];
129
                    Project projectsArray[] = new Project[ projects.size() ];
130
                    projects.toArray( projectsArray );
130
                    projects.toArray( projectsArray );
131
                    
131
                    
132
                    Project mainProject = null;
133
                    if ( opls.isOpenAsMain() && projectsArray.length == 1 ) {
134
                        // Set main project if selected
135
                        mainProject = projectsArray[0];
136
                    }
137
138
                    if (projectsArray.length == 1) {
132
                    if (projectsArray.length == 1) {
139
                        projectToExpand = projectsArray[0];
133
                        projectToExpand = projectsArray[0];
140
                    }
134
                    }
Lines 143-149 Link Here
143
                        projectsArray,                    // Put the project into OpenProjectList
137
                        projectsArray,                    // Put the project into OpenProjectList
144
                        opls.isOpenSubprojects(),         // And optionaly open subprojects
138
                        opls.isOpenSubprojects(),         // And optionaly open subprojects
145
                        true,                             // open asynchronously
139
                        true,                             // open asynchronously
146
                        mainProject);
140
                        null);
147
                    
141
                    
148
                    ProjectUtilities.makeProjectTabVisible();
142
                    ProjectUtilities.makeProjectTabVisible();
149
                    break; // and exit the loop
143
                    break; // and exit the loop
(-)a/projectui/src/org/netbeans/modules/project/ui/groups/SubprojectsGroup.java (-4 / +1 lines)
Lines 58-64 Link Here
58
import org.openide.filesystems.URLMapper;
58
import org.openide.filesystems.URLMapper;
59
59
60
/**
60
/**
61
 * A main project and all (recursive) subprojects, with an optional main project.
61
 * One project and all (recursive) subprojects.
62
 * @author Jesse Glick
62
 * @author Jesse Glick
63
 */
63
 */
64
public class SubprojectsGroup extends Group {
64
public class SubprojectsGroup extends Group {
Lines 69-76 Link Here
69
69
70
    /**
70
    /**
71
     * Create a new group based on a superproject.
71
     * Create a new group based on a superproject.
72
     * The main project is always initialized to be the superproject itself,
73
     * but this could be changed later.
74
     * The display name is by default that of the superproject.
72
     * The display name is by default that of the superproject.
75
     */
73
     */
76
    public static SubprojectsGroup create(String name, Project project) {
74
    public static SubprojectsGroup create(String name, Project project) {
Lines 81-87 Link Here
81
        p.put(KEY_NAME, name);
79
        p.put(KEY_NAME, name);
82
        p.put(KEY_KIND, KIND);
80
        p.put(KEY_KIND, KIND);
83
        p.put(KEY_PATH, path);
81
        p.put(KEY_PATH, path);
84
        p.put(KEY_MAIN, path);
85
        return new SubprojectsGroup(id);
82
        return new SubprojectsGroup(id);
86
    }
83
    }
87
84
(-)a/projectui/test/unit/src/org/netbeans/modules/project/ui/ProjectChooserAccessoryTest.java (-1 / +1 lines)
Lines 91-97 Link Here
91
        
91
        
92
        List<Project> result = new ArrayList<Project>();
92
        List<Project> result = new ArrayList<Project>();
93
        //#101227
93
        //#101227
94
        ProjectChooserAccessory acc = new ProjectChooserAccessory(new JFileChooser(), false, false);
94
        ProjectChooserAccessory acc = new ProjectChooserAccessory(new JFileChooser(), false);
95
        acc.modelUpdater.addSubprojects(p1, result, new HashMap<Project,Set<? extends Project>>());
95
        acc.modelUpdater.addSubprojects(p1, result, new HashMap<Project,Set<? extends Project>>());
96
        
96
        
97
        assertTrue(new HashSet<Project>(Arrays.asList(p1, p2)).equals(new HashSet<Project>(result)));
97
        assertTrue(new HashSet<Project>(Arrays.asList(p1, p2)).equals(new HashSet<Project>(result)));
(-)a/projectui/test/unit/src/org/netbeans/modules/project/ui/test/ProjectSupport.java (-2 lines)
Lines 80-87 Link Here
80
                public void run() {
80
                public void run() {
81
                    OpenProjectList.getDefault().addPropertyChangeListener(listener);
81
                    OpenProjectList.getDefault().addPropertyChangeListener(listener);
82
                    OpenProjectList.getDefault().open(project);
82
                    OpenProjectList.getDefault().open(project);
83
                    // Set main? Probably user should do this if he wants.
84
                    // OpenProjectList.getDefault().setMainProject(project);
85
                }
83
                }
86
            });
84
            });
87
            // WAIT PROJECT OPEN - start
85
            // WAIT PROJECT OPEN - start
(-)a/projectuiapi/apichanges.xml (+18 lines)
Lines 107-112 Link Here
107
    <!-- ACTUAL CHANGES BEGIN HERE: -->
107
    <!-- ACTUAL CHANGES BEGIN HERE: -->
108
108
109
    <changes>
109
    <changes>
110
        <change id="setAsMain">
111
            <api name="general"/>
112
            <summary>Programmatically setting main project deprecated</summary>
113
            <version major="1" minor="56"/>
114
            <date day="19" month="3" year="2012"/>
115
            <author login="jglick"/>
116
            <compatibility deprecation="yes"/>
117
            <description>
118
                <p>
119
                    Setting a main project programmatically is now deprecated.
120
                    Checking for a main project set explicitly by the user is still common.
121
                </p>
122
            </description>
123
            <class package="org.netbeans.api.project.ui" name="OpenProjects"/>
124
            <class package="org.netbeans.spi.project.ui.support" name="CommonProjectActions"/>
125
            <class package="org.netbeans.spi.project.ui.templates.support" name="Templates"/>
126
            <issue number="166780"/>
127
        </change>
110
        <change id="FileSensitiveAction.performer">
128
        <change id="FileSensitiveAction.performer">
111
            <api name="general"/>
129
            <api name="general"/>
112
            <summary>Adding ability to create a file sensitive action with custom performer</summary>
130
            <summary>Adding ability to create a file sensitive action with custom performer</summary>
(-)a/projectuiapi/src/org/netbeans/api/project/ui/OpenProjects.java (-1 / +1 lines)
Lines 260-266 Link Here
260
    }
260
    }
261
    
261
    
262
    /**Sets the main project.
262
    /**Sets the main project.
263
     *
263
     * Should not generally be called programmatically; an exception would be when renaming a main project.
264
     * <div class="nonnormative">
264
     * <div class="nonnormative">
265
     * <p><strong>Warning:</strong> the set of usecases that require invoking this method is
265
     * <p><strong>Warning:</strong> the set of usecases that require invoking this method is
266
     * very limited and should be generally avoided if possible. In particular, this method
266
     * very limited and should be generally avoided if possible. In particular, this method
(-)a/projectuiapi/src/org/netbeans/spi/project/ui/support/CommonProjectActions.java (+2 lines)
Lines 73-79 Link Here
73
     * You might include this in the context menu of a logical view.
73
     * You might include this in the context menu of a logical view.
74
     * </p>
74
     * </p>
75
     * @return an action
75
     * @return an action
76
     * @deprecated No longer recommended for use in logical views.
76
     */
77
     */
78
    @Deprecated
77
    public static Action setAsMainProjectAction() {
79
    public static Action setAsMainProjectAction() {
78
        return Utilities.getActionsFactory().setAsMainProjectAction();
80
        return Utilities.getActionsFactory().setAsMainProjectAction();
79
    }
81
    }
(-)a/projectuiapi/src/org/netbeans/spi/project/ui/templates/support/Templates.java (-2 / +4 lines)
Lines 216-228 Link Here
216
216
217
    /**
217
    /**
218
     * Checks whether a project wizard will set the main project.
218
     * Checks whether a project wizard will set the main project.
219
     * (The default is true.)
219
     * (The default is false.)
220
     * @param wizardDescriptor a project wizard
220
     * @param wizardDescriptor a project wizard
221
     * @return true if it will set a main project
221
     * @return true if it will set a main project
222
     * @since org.netbeans.modules.projectuiapi/1 1.47
222
     * @since org.netbeans.modules.projectuiapi/1 1.47
223
     */
223
     */
224
    public static boolean getDefinesMainProject(WizardDescriptor wizardDescriptor) {
224
    public static boolean getDefinesMainProject(WizardDescriptor wizardDescriptor) {
225
        return !Boolean.FALSE.equals(wizardDescriptor.getProperty(SET_AS_MAIN));
225
        return Boolean.TRUE.equals(wizardDescriptor.getProperty(SET_AS_MAIN));
226
    }
226
    }
227
227
228
    /**
228
    /**
Lines 234-240 Link Here
234
     * @param wizardDescriptor a project wizard
234
     * @param wizardDescriptor a project wizard
235
     * @param definesMainProject true if it will set a main project
235
     * @param definesMainProject true if it will set a main project
236
     * @since org.netbeans.modules.projectuiapi/1 1.47
236
     * @since org.netbeans.modules.projectuiapi/1 1.47
237
     * @deprecated Projects should not be set as main by default.
237
     */
238
     */
239
    @Deprecated
238
    public static void setDefinesMainProject(WizardDescriptor wizardDescriptor, boolean definesMainProject) {
240
    public static void setDefinesMainProject(WizardDescriptor wizardDescriptor, boolean definesMainProject) {
239
        wizardDescriptor.putProperty(SET_AS_MAIN, definesMainProject);
241
        wizardDescriptor.putProperty(SET_AS_MAIN, definesMainProject);
240
    }
242
    }
(-)a/projectuiapi/src/org/netbeans/spi/project/ui/templates/support/package.html (-1 / +1 lines)
Lines 50-56 Link Here
50
file templates described below. The wizard for a project can return {@link org.openide.loaders.DataObject}s or
50
file templates described below. The wizard for a project can return {@link org.openide.loaders.DataObject}s or
51
{@link org.openide.loaders.FileObject}s corresponding to the project directories of created files and/or files
51
{@link org.openide.loaders.FileObject}s corresponding to the project directories of created files and/or files
52
to be selected in newly created projects.
52
to be selected in newly created projects.
53
{@link org.netbeans.spi.project.ui.templates.support.Templates#setDefinesMainProject} may be used.</p>
53
</p>
54
54
55
<p>Each project can also declare own file templates to be exposed it in <b>New File...</b> wizard. This 
55
<p>Each project can also declare own file templates to be exposed it in <b>New File...</b> wizard. This 
56
permits users to create new files, which are of types supported by given project type. The project may also
56
permits users to create new files, which are of types supported by given project type. The project may also
(-)a/tasklist.projectint/src/org/netbeans/modules/tasklist/projectint/Bundle.properties (-4 / +3 lines)
Lines 1-10 Link Here
1
OpenIDE-Module-Display-Category=Task List
1
OpenIDE-Module-Display-Category=Task List
2
OpenIDE-Module-Long-Description=\
2
OpenIDE-Module-Long-Description=\
3
    Enables the Task List window to scan for tasks in the main project or all opened projects.
3
    Enables the Task List window to scan for tasks in the selected project or all opened projects.
4
OpenIDE-Module-Name=Task List - Project Integration
4
OpenIDE-Module-Name=Task List - Project Integration
5
5
6
LBL_MainProjectScope=Main Project
6
LBL_MainProjectScope=Selected Project
7
HINT_MainProjectScope=Show tasks for the main project and for the opened projects which depend on it
7
HINT_MainProjectScope=Show tasks for the selected project
8
8
9
LBL_OpenedProjectsScope=Opened Projects
9
LBL_OpenedProjectsScope=Opened Projects
10
HINT_OpenedProjectsScope=Show tasks for all opened projects
10
HINT_OpenedProjectsScope=Show tasks for all opened projects
Lines 13-18 Link Here
13
13
14
LBL_OpenedProjectsStatusBar=in all opened projects
14
LBL_OpenedProjectsStatusBar=in all opened projects
15
LBL_NoProjectStatusBar=<no current project>
15
LBL_NoProjectStatusBar=<no current project>
16
LBL_MainProjectStatusBar=in the main project and in the opened projects which depends on it
17
LBL_CurrentProjectStatusBar=in {0}
16
LBL_CurrentProjectStatusBar=in {0}
18
HINT_CurrentProjectScope=Show tasks in {0}
17
HINT_CurrentProjectScope=Show tasks in {0}
(-)a/tasklist.projectint/src/org/netbeans/modules/tasklist/projectint/MainProjectIterator.java (-26 / +1 lines)
Lines 45-60 Link Here
45
package org.netbeans.modules.tasklist.projectint;
45
package org.netbeans.modules.tasklist.projectint;
46
46
47
import java.util.ArrayList;
47
import java.util.ArrayList;
48
import java.util.Collection;
49
import java.util.Iterator;
48
import java.util.Iterator;
50
import org.netbeans.api.project.Project;
49
import org.netbeans.api.project.Project;
51
import org.netbeans.api.project.ProjectUtils;
50
import org.netbeans.api.project.ProjectUtils;
52
import org.netbeans.api.project.SourceGroup;
51
import org.netbeans.api.project.SourceGroup;
53
import org.netbeans.api.project.Sources;
52
import org.netbeans.api.project.Sources;
54
import org.netbeans.api.project.ui.OpenProjects;
55
import org.netbeans.spi.project.SubprojectProvider;
56
import org.openide.filesystems.FileObject;
53
import org.openide.filesystems.FileObject;
57
import org.openide.util.Utilities;
58
54
59
/**
55
/**
60
 * Iterate all resources (files and folders) that are under the current main project
56
 * Iterate all resources (files and folders) that are under the current main project
Lines 92-129 Link Here
92
    }
88
    }
93
    
89
    
94
    protected Iterator<FileObject> createIterator() {
90
    protected Iterator<FileObject> createIterator() {
95
        boolean isMainProject = true;
91
        Project currentProject = MainProjectScanningScope.findCurrentProject();
96
        Project currentProject = OpenProjects.getDefault().getMainProject();
97
        if( null == currentProject ) {
98
            isMainProject = false;
99
            currentProject = MainProjectScanningScope.findCurrentProject();
100
            if( null == currentProject )
92
            if( null == currentProject )
101
                return new EmptyIterator();
93
                return new EmptyIterator();
102
        }
103
        
94
        
104
        ArrayList<FileObject> roots = new ArrayList<FileObject>(10);
95
        ArrayList<FileObject> roots = new ArrayList<FileObject>(10);
105
        
96
        
106
        addProject( currentProject, roots );
97
        addProject( currentProject, roots );
107
        
98
        
108
        if( isMainProject )
109
            addDependantProjects( currentProject, roots );
110
        
111
        return new FileObjectIterator( roots );
99
        return new FileObjectIterator( roots );
112
    }
100
    }
113
    
101
    
114
    private void addDependantProjects( Project mainProject, ArrayList<FileObject> roots ) {
115
        Project[] projects = OpenProjects.getDefault().getOpenProjects();
116
        for( int i=0; i<projects.length; i++ ) {
117
            if( projects[i].equals( mainProject ) )
118
                continue;
119
            
120
            SubprojectProvider subProjectProvider = projects[i].getLookup().lookup( SubprojectProvider.class );
121
            if( null != subProjectProvider && subProjectProvider.getSubprojects().contains( mainProject ) ) {
122
                addProject( projects[i], roots );
123
            }
124
        }
125
    }
126
    
127
    private void addProject( Project p, ArrayList<FileObject> roots ) {
102
    private void addProject( Project p, ArrayList<FileObject> roots ) {
128
        Sources sources = ProjectUtils.getSources( p );
103
        Sources sources = ProjectUtils.getSources( p );
129
        SourceGroup[] groups = sources.getSourceGroups( Sources.TYPE_GENERIC );
104
        SourceGroup[] groups = sources.getSourceGroups( Sources.TYPE_GENERIC );
(-)a/tasklist.projectint/src/org/netbeans/modules/tasklist/projectint/MainProjectScanningScope.java (-43 / +4 lines)
Lines 62-68 Link Here
62
import org.netbeans.api.project.ProjectInformation;
62
import org.netbeans.api.project.ProjectInformation;
63
import org.netbeans.api.project.ProjectUtils;
63
import org.netbeans.api.project.ProjectUtils;
64
import org.netbeans.api.project.ui.OpenProjects;
64
import org.netbeans.api.project.ui.OpenProjects;
65
import org.netbeans.spi.project.SubprojectProvider;
66
import org.netbeans.spi.tasklist.TaskScanningScope;
65
import org.netbeans.spi.tasklist.TaskScanningScope;
67
import org.openide.filesystems.FileObject;
66
import org.openide.filesystems.FileObject;
68
import org.openide.loaders.DataObject;
67
import org.openide.loaders.DataObject;
Lines 75-81 Link Here
75
import org.openide.windows.TopComponent;
74
import org.openide.windows.TopComponent;
76
75
77
/**
76
/**
78
 * Task scanning scope for the main project and all opened projects that depend on it.
77
 * Task scanning scope for the selected project.
79
 * 
78
 * 
80
 * @author S. Aubrecht
79
 * @author S. Aubrecht
81
 */
80
 */
Lines 127-147 Link Here
127
        if( owner.equals( p ) )
126
        if( owner.equals( p ) )
128
            return true;
127
            return true;
129
        
128
        
130
        if( p.equals( OpenProjects.getDefault().getMainProject() ) ) {
131
            Project[] projects = OpenProjects.getDefault().getOpenProjects();
132
            for( int i=0; i<projects.length; i++ ) {
133
                if( projects[i].equals( p ) )
134
                    continue;
135
136
                SubprojectProvider subProjectProvider = projects[i].getLookup().lookup( SubprojectProvider.class );
137
                if( null != subProjectProvider 
138
                        && subProjectProvider.getSubprojects().contains( p )
139
                        && projects[i].equals( owner ) ) {
140
                    return true;
141
                }
142
            }
143
        }
144
        
145
        return false;
129
        return false;
146
    }
130
    }
147
131
Lines 160-169 Link Here
160
                OpenProjects.getDefault().addPropertyChangeListener( this );
144
                OpenProjects.getDefault().addPropertyChangeListener( this );
161
                TopComponent.getRegistry().addPropertyChangeListener( this );
145
                TopComponent.getRegistry().addPropertyChangeListener( this );
162
146
163
                Project p = OpenProjects.getDefault().getMainProject();
147
                Project p = findCurrentProject();
164
                if( null == p ) {
165
                    p = findCurrentProject();
166
                }
167
                setCurrentProject(p, false);
148
                setCurrentProject(p, false);
168
            } else if( null == newCallback && null != callback ) {
149
            } else if( null == newCallback && null != callback ) {
169
                OpenProjects.getDefault().removePropertyChangeListener( this );
150
                OpenProjects.getDefault().removePropertyChangeListener( this );
Lines 175-193 Link Here
175
    }
156
    }
176
    
157
    
177
    public void propertyChange( PropertyChangeEvent e ) {
158
    public void propertyChange( PropertyChangeEvent e ) {
178
        if( OpenProjects.PROPERTY_MAIN_PROJECT.equals( e.getPropertyName() ) ) {
159
        if( TopComponent.Registry.PROP_ACTIVATED_NODES.equals( e.getPropertyName() ) ) {
179
            synchronized( this ) {
180
                if( null != callback ) {
181
                    Project p = OpenProjects.getDefault().getMainProject();
182
                    if( null == p ) {
183
                        p = findCurrentProject();
184
                    } else {
185
                        setCurrentProject(null, false);
186
                    }
187
                    setCurrentProject( p, true );
188
                }
189
            }
190
        } else if( TopComponent.Registry.PROP_ACTIVATED_NODES.equals( e.getPropertyName() ) ) {
191
            //start timer to switch current project
160
            //start timer to switch current project
192
            if( null != refreshTimer )
161
            if( null != refreshTimer )
193
                refreshTimer.cancel();
162
                refreshTimer.cancel();
Lines 196-206 Link Here
196
165
197
                @Override
166
                @Override
198
                public void run() {
167
                public void run() {
199
                    Project p = OpenProjects.getDefault().getMainProject();
168
                    Project p = findCurrentProject();
200
                    if( null == p ) {
201
                        p = findCurrentProject();
202
                        setCurrentProject( p, true );
169
                        setCurrentProject( p, true );
203
                    }
204
                }
170
                }
205
            }, 500);
171
            }, 500);
206
        }
172
        }
Lines 233-248 Link Here
233
                    NbBundle.getMessage(MainProjectScanningScope.class, "LBL_NoProjectStatusBar") ); //NOI18N
199
                    NbBundle.getMessage(MainProjectScanningScope.class, "LBL_NoProjectStatusBar") ); //NOI18N
234
        } else {
200
        } else {
235
            ProjectInformation pi = ProjectUtils.getInformation(p);
201
            ProjectInformation pi = ProjectUtils.getInformation(p);
236
            if( p.equals(OpenProjects.getDefault().getMainProject()) ) {
237
                labels.put( Utils.KEY_STATUS_BAR_LABEL, 
238
                        NbBundle.getMessage(MainProjectScanningScope.class, "LBL_MainProjectStatusBar") ); //NOI18N
239
            } else {
240
                labels.put(AbstractAction.SHORT_DESCRIPTION, NbBundle.getMessage(MainProjectScanningScope.class, 
202
                labels.put(AbstractAction.SHORT_DESCRIPTION, NbBundle.getMessage(MainProjectScanningScope.class, 
241
                        "HINT_CurrentProjectScope", pi.getDisplayName()) ); //NOI18N
203
                        "HINT_CurrentProjectScope", pi.getDisplayName()) ); //NOI18N
242
                labels.put(AbstractAction.NAME, pi.getDisplayName());
204
                labels.put(AbstractAction.NAME, pi.getDisplayName());
243
                labels.put( Utils.KEY_STATUS_BAR_LABEL, 
205
                labels.put( Utils.KEY_STATUS_BAR_LABEL, 
244
                        NbBundle.getMessage(MainProjectScanningScope.class, "LBL_CurrentProjectStatusBar", pi.getDisplayName()) ); //NOI18N
206
                        NbBundle.getMessage(MainProjectScanningScope.class, "LBL_CurrentProjectStatusBar", pi.getDisplayName()) ); //NOI18N
245
            }
246
        }
207
        }
247
    }
208
    }
248
    
209
    
(-)a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties (-3 lines)
Lines 61-69 Link Here
61
LBL_ProjectFolder=Project &Folder
61
LBL_ProjectFolder=Project &Folder
62
LBL_Browse_Button=Br&owse...
62
LBL_Browse_Button=Br&owse...
63
LBL_SelectProjectLocation=Select Project Location
63
LBL_SelectProjectLocation=Select Project Location
64
LBL_SetAsMainProject=Set as &Main Project
65
ACSN_SetAsMainProject=Set as Main Project
66
ACSD_SetAsMainProject=Set as Main Project
67
ACSN_ProjectName=Project Name
64
ACSN_ProjectName=Project Name
68
ACSD_ProjectName=Project Name
65
ACSD_ProjectName=Project Name
69
ACSN_ProjectLocation=Project Location
66
ACSN_ProjectLocation=Project Location
(-)a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/CustomComponentVisualPanel.form (-22 / +1 lines)
Lines 1-4 Link Here
1
<?xml version="1.1" encoding="UTF-8" ?>
1
<?xml version="1.0" encoding="UTF-8" ?>
2
2
3
<Form version="1.3" maxVersion="1.3" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
3
<Form version="1.3" maxVersion="1.3" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <AuxValues>
4
  <AuxValues>
Lines 16-42 Link Here
16
16
17
  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
17
  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
18
  <SubComponents>
18
  <SubComponents>
19
    <Component class="javax.swing.JCheckBox" name="mainProject">
20
      <Properties>
21
        <Property name="selected" type="boolean" value="true"/>
22
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
23
          <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="LBL_SetAsMainProject" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
24
        </Property>
25
      </Properties>
26
      <AccessibilityProperties>
27
        <Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
28
          <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="ACSN_SetAsMainProject" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
29
        </Property>
30
        <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
31
          <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="ACSD_SetAsMainProject" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
32
        </Property>
33
      </AccessibilityProperties>
34
      <Constraints>
35
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
36
          <GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="12" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/>
37
        </Constraint>
38
      </Constraints>
39
    </Component>
40
    <Container class="javax.swing.JPanel" name="infoPanel">
19
    <Container class="javax.swing.JPanel" name="infoPanel">
41
      <Constraints>
20
      <Constraints>
42
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
21
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
(-)a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/CustomComponentVisualPanel.java (-38 lines)
Lines 46-53 Link Here
46
package org.netbeans.modules.vmd.componentssupport.ui.wizard;
46
package org.netbeans.modules.vmd.componentssupport.ui.wizard;
47
47
48
import java.awt.BorderLayout;
48
import java.awt.BorderLayout;
49
import java.awt.event.ActionEvent;
50
import java.awt.event.ActionListener;
51
import java.beans.PropertyChangeEvent;
49
import java.beans.PropertyChangeEvent;
52
import java.beans.PropertyChangeListener;
50
import java.beans.PropertyChangeListener;
53
import java.io.File;
51
import java.io.File;
Lines 113-123 Link Here
113
    void store(WizardDescriptor d) {
111
    void store(WizardDescriptor d) {
114
        String name = projectNameTextField.getText().trim();
112
        String name = projectNameTextField.getText().trim();
115
        String folder = createdFolderTextField.getText().trim();
113
        String folder = createdFolderTextField.getText().trim();
116
        Boolean setAsMain = mainProject.isSelected();
117
114
118
        d.putProperty(CustomComponentWizardIterator.PROJECT_DIR, new File(folder));
115
        d.putProperty(CustomComponentWizardIterator.PROJECT_DIR, new File(folder));
119
        d.putProperty(CustomComponentWizardIterator.PROJECT_NAME, name);
116
        d.putProperty(CustomComponentWizardIterator.PROJECT_NAME, name);
120
        d.putProperty(CustomComponentWizardIterator.SET_AS_MAIN, setAsMain);
121
    }
117
    }
122
118
123
    void read(WizardDescriptor settings) {
119
    void read(WizardDescriptor settings) {
Lines 138-146 Link Here
138
        // invoke store to have changes in mySettings
134
        // invoke store to have changes in mySettings
139
        //typeChooserPanel.store(mySettings);
135
        //typeChooserPanel.store(mySettings);
140
136
141
        if (getIsMainProject() != null){
142
            this.mainProject.setSelected(getIsMainProject());
143
        }
144
        setLocation(getProjectLocation().getAbsolutePath());
137
        setLocation(getProjectLocation().getAbsolutePath());
145
138
146
        this.projectNameTextField.setText(getProjectName());
139
        this.projectNameTextField.setText(getProjectName());
Lines 165-182 Link Here
165
                checkValidity();
158
                checkValidity();
166
            }
159
            }
167
        };
160
        };
168
        isMainAL = new ActionListener() {
169
            public void actionPerformed(ActionEvent e) {
170
                mainProjectTouched = true;
171
            }
172
        };
173
    }
161
    }
174
    
162
    
175
    private void attachDocumentListeners() {
163
    private void attachDocumentListeners() {
176
        if (!listenersAttached) {
164
        if (!listenersAttached) {
177
            projectNameTextField.getDocument().addDocumentListener(nameDL);
165
            projectNameTextField.getDocument().addDocumentListener(nameDL);
178
            projectLocationTextField.getDocument().addDocumentListener(locationDL);
166
            projectLocationTextField.getDocument().addDocumentListener(locationDL);
179
            mainProject.addActionListener(isMainAL);
180
            listenersAttached = true;
167
            listenersAttached = true;
181
        }
168
        }
182
    }
169
    }
Lines 185-191 Link Here
185
        if (listenersAttached) {
172
        if (listenersAttached) {
186
            projectNameTextField.getDocument().removeDocumentListener(nameDL);
173
            projectNameTextField.getDocument().removeDocumentListener(nameDL);
187
            projectLocationTextField.getDocument().removeDocumentListener(locationDL);
174
            projectLocationTextField.getDocument().removeDocumentListener(locationDL);
188
            mainProject.removeActionListener(isMainAL);
189
            listenersAttached = false;
175
            listenersAttached = false;
190
        }
176
        }
191
    }
177
    }
Lines 209-217 Link Here
209
            return;
195
            return;
210
        }
196
        }
211
        
197
        
212
        if (!mainProjectTouched) {
213
            mainProject.setSelected(isStandAlone);
214
        }
215
        if (!locationUpdated) {
198
        if (!locationUpdated) {
216
            setLocation(computeInitialLocationValue());
199
            setLocation(computeInitialLocationValue());
217
        }
200
        }
Lines 405-416 Link Here
405
        return projectName;
388
        return projectName;
406
    }
389
    }
407
390
408
    Boolean getIsMainProject(){
409
        Boolean isMain = (Boolean) getSettings()
410
                .getProperty(CustomComponentWizardIterator.SET_AS_MAIN);
411
        return isMain;
412
    }
413
414
    /*
391
    /*
415
     * is invoked from myPanel.validate()
392
     * is invoked from myPanel.validate()
416
     * which implements WizardDescriptor.ValidatingPanel
393
     * which implements WizardDescriptor.ValidatingPanel
Lines 428-434 Link Here
428
    private void initComponents() {
405
    private void initComponents() {
429
        java.awt.GridBagConstraints gridBagConstraints;
406
        java.awt.GridBagConstraints gridBagConstraints;
430
407
431
        mainProject = new javax.swing.JCheckBox();
432
        infoPanel = new javax.swing.JPanel();
408
        infoPanel = new javax.swing.JPanel();
433
        projectNameLabel = new javax.swing.JLabel();
409
        projectNameLabel = new javax.swing.JLabel();
434
        projectNameTextField = new javax.swing.JTextField();
410
        projectNameTextField = new javax.swing.JTextField();
Lines 442-458 Link Here
442
418
443
        setLayout(new java.awt.GridBagLayout());
419
        setLayout(new java.awt.GridBagLayout());
444
420
445
        mainProject.setSelected(true);
446
        org.openide.awt.Mnemonics.setLocalizedText(mainProject, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_SetAsMainProject")); // NOI18N
447
        gridBagConstraints = new java.awt.GridBagConstraints();
448
        gridBagConstraints.gridx = 0;
449
        gridBagConstraints.gridy = 2;
450
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
451
        gridBagConstraints.insets = new java.awt.Insets(12, 0, 0, 0);
452
        add(mainProject, gridBagConstraints);
453
        mainProject.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_SetAsMainProject")); // NOI18N
454
        mainProject.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSD_SetAsMainProject")); // NOI18N
455
456
        infoPanel.setLayout(new java.awt.GridBagLayout());
421
        infoPanel.setLayout(new java.awt.GridBagLayout());
457
422
458
        projectNameLabel.setLabelFor(projectNameTextField);
423
        projectNameLabel.setLabelFor(projectNameTextField);
Lines 588-594 Link Here
588
    private javax.swing.JTextField createdFolderTextField;
553
    private javax.swing.JTextField createdFolderTextField;
589
    private javax.swing.JPanel fillerPanel;
554
    private javax.swing.JPanel fillerPanel;
590
    private javax.swing.JPanel infoPanel;
555
    private javax.swing.JPanel infoPanel;
591
    private javax.swing.JCheckBox mainProject;
592
    private javax.swing.JLabel projectLocationLabel;
556
    private javax.swing.JLabel projectLocationLabel;
593
    private javax.swing.JTextField projectLocationTextField;
557
    private javax.swing.JTextField projectLocationTextField;
594
    private javax.swing.JLabel projectNameLabel;
558
    private javax.swing.JLabel projectNameLabel;
Lines 648-659 Link Here
648
    private CustomComponentWizardPanel myPanel;
612
    private CustomComponentWizardPanel myPanel;
649
    private JComponent typeChooserPanel;
613
    private JComponent typeChooserPanel;
650
    private boolean locationUpdated;
614
    private boolean locationUpdated;
651
    private boolean mainProjectTouched;
652
615
653
    private boolean listenersAttached;
616
    private boolean listenersAttached;
654
    private DocumentListener nameDL;
617
    private DocumentListener nameDL;
655
    private DocumentListener locationDL;
618
    private DocumentListener locationDL;
656
    private ActionListener isMainAL;
657
619
658
    static boolean isIllegalName(final String name) {
620
    static boolean isIllegalName(final String name) {
659
        return name.length() == 0      || 
621
        return name.length() == 0      || 
(-)a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/CustomComponentWizardIterator.java (-1 lines)
Lines 100-106 Link Here
100
    // properties
100
    // properties
101
    public static final String PROJECT_DIR  = "projDir";                         // NOI18N
101
    public static final String PROJECT_DIR  = "projDir";                         // NOI18N
102
    public static final String PROJECT_NAME = "projName";                        // NOI18N
102
    public static final String PROJECT_NAME = "projName";                        // NOI18N
103
    public static final String SET_AS_MAIN  = "setAsMain";                       // NOI18N
104
    public static final String LAYER_PATH   = "layer";                           // NOI18N
103
    public static final String LAYER_PATH   = "layer";                           // NOI18N
105
    public static final String BUNDLE_PATH  = "bundle";                          // NOI18N
104
    public static final String BUNDLE_PATH  = "bundle";                          // NOI18N
106
    public static final String CODE_BASE_NAME
105
    public static final String CODE_BASE_NAME
(-)a/web.debug/src/org/netbeans/modules/web/debug/actions/JspRunToCursorActionProvider.java (+1 lines)
Lines 120-125 Link Here
120
        
120
        
121
        // check if current project supports this action
121
        // check if current project supports this action
122
        Project p = MainProjectManager.getDefault ().getMainProject ();
122
        Project p = MainProjectManager.getDefault ().getMainProject ();
123
        // XXX revisit - should perhaps check selection?
123
        if (p == null) return false;
124
        if (p == null) return false;
124
        ActionProvider actionProvider = (ActionProvider)p.getLookup ().lookup (ActionProvider.class);
125
        ActionProvider actionProvider = (ActionProvider)p.getLookup ().lookup (ActionProvider.class);
125
        if (actionProvider == null) return false;
126
        if (actionProvider == null) return false;
(-)a/web.examples/src/org/netbeans/modules/web/examples/Bundle.properties (-3 lines)
Lines 80-85 Link Here
80
LBL_NWP1_SelectProjectLocation=Select Project Location
80
LBL_NWP1_SelectProjectLocation=Select Project Location
81
MSG_IllegalProjectName=Project Name is not valid folder name.
81
MSG_IllegalProjectName=Project Name is not valid folder name.
82
MSG_ProjectFolderExists=Project Folder already exists and is not empty.
82
MSG_ProjectFolderExists=Project Folder already exists and is not empty.
83
LBL_NWP1_SetAsMain_CheckBox=Set as Main Project
84
LBL_NWP1_SetAsMain_CheckBoxMnemonic=M
85
ACS_LBL_NWP1_SetAsMain_A11YDesc=Set as Main Project
(-)a/web.examples/src/org/netbeans/modules/web/examples/PanelConfigureProjectVisual.form (-16 lines)
Lines 27-47 Link Here
27
27
28
      <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
28
      <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
29
    </Container>
29
    </Container>
30
    <Component class="javax.swing.JSeparator" name="jSeparator1">
31
      <Constraints>
32
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
33
          <GridBagConstraints gridX="-1" gridY="-1" gridWidth="0" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="12" insetsLeft="0" insetsBottom="12" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
34
        </Constraint>
35
      </Constraints>
36
    </Component>
37
    <Container class="javax.swing.JPanel" name="optionsContainer">
38
      <Constraints>
39
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
40
          <GridBagConstraints gridX="-1" gridY="-1" gridWidth="0" gridHeight="0" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="1.0"/>
41
        </Constraint>
42
      </Constraints>
43
44
      <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
45
    </Container>
46
  </SubComponents>
30
  </SubComponents>
47
</Form>
31
</Form>
(-)a/web.examples/src/org/netbeans/modules/web/examples/PanelConfigureProjectVisual.java (-32 / +3 lines)
Lines 54-60 Link Here
54
    private PanelConfigureProject panel;
54
    private PanelConfigureProject panel;
55
55
56
    private PanelProjectLocationVisual projectLocationPanel;
56
    private PanelProjectLocationVisual projectLocationPanel;
57
    private PanelOptionsVisual optionsPanel;
58
57
59
    /** Creates new form PanelInitProject */
58
    /** Creates new form PanelInitProject */
60
    public PanelConfigureProjectVisual(PanelConfigureProject panel) {
59
    public PanelConfigureProjectVisual(PanelConfigureProject panel) {
Lines 65-90 Link Here
65
        projectLocationPanel = new PanelProjectLocationVisual(panel);
64
        projectLocationPanel = new PanelProjectLocationVisual(panel);
66
        locationContainer.add(projectLocationPanel, java.awt.BorderLayout.NORTH);
65
        locationContainer.add(projectLocationPanel, java.awt.BorderLayout.NORTH);
67
66
68
        optionsPanel = new PanelOptionsVisual(panel);
69
        optionsContainer.add(optionsPanel, java.awt.BorderLayout.NORTH);
70
71
        // Provide a name in the title bar.
67
        // Provide a name in the title bar.
72
        setName(NbBundle.getMessage(PanelConfigureProjectVisual.class, "LBL_NWP1_ProjectTitleName")); //NOI18N
68
        setName(NbBundle.getMessage(PanelConfigureProjectVisual.class, "LBL_NWP1_ProjectTitleName")); //NOI18N
73
        putClientProperty ("NewProjectWizard_Title", NbBundle.getMessage(PanelConfigureProjectVisual.class, "TXT_NewWebApp")); //NOI18N
69
        putClientProperty ("NewProjectWizard_Title", NbBundle.getMessage(PanelConfigureProjectVisual.class, "TXT_NewWebApp")); //NOI18N
74
    }
70
    }
75
71
76
    boolean valid(WizardDescriptor wizardDescriptor) {
72
    boolean valid(WizardDescriptor wizardDescriptor) {
77
        return projectLocationPanel.valid(wizardDescriptor) && optionsPanel.valid(wizardDescriptor);
73
        return projectLocationPanel.valid(wizardDescriptor);
78
    }
74
    }
79
75
80
    void read (WizardDescriptor d) {
76
    void read (WizardDescriptor d) {
81
        projectLocationPanel.read(d);
77
        projectLocationPanel.read(d);
82
        optionsPanel.read(d);
83
    }
78
    }
84
79
85
    void store(WizardDescriptor d) {
80
    void store(WizardDescriptor d) {
86
        projectLocationPanel.store(d);
81
        projectLocationPanel.store(d);
87
        optionsPanel.store(d);
88
    }
82
    }
89
83
90
    /** This method is called from within the constructor to
84
    /** This method is called from within the constructor to
Lines 92-139 Link Here
92
     * WARNING: Do NOT modify this code. The content of this method is
86
     * WARNING: Do NOT modify this code. The content of this method is
93
     * always regenerated by the Form Editor.
87
     * always regenerated by the Form Editor.
94
     */
88
     */
95
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
89
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
96
    private void initComponents() {
90
    private void initComponents() {
97
        java.awt.GridBagConstraints gridBagConstraints;
91
        java.awt.GridBagConstraints gridBagConstraints;
98
92
99
        locationContainer = new javax.swing.JPanel();
93
        locationContainer = new javax.swing.JPanel();
100
        jSeparator1 = new javax.swing.JSeparator();
101
        optionsContainer = new javax.swing.JPanel();
102
94
95
        setRequestFocusEnabled(false);
103
        setLayout(new java.awt.GridBagLayout());
96
        setLayout(new java.awt.GridBagLayout());
104
97
105
        setRequestFocusEnabled(false);
106
        locationContainer.setLayout(new java.awt.BorderLayout());
98
        locationContainer.setLayout(new java.awt.BorderLayout());
107
108
        gridBagConstraints = new java.awt.GridBagConstraints();
99
        gridBagConstraints = new java.awt.GridBagConstraints();
109
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
100
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
110
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
101
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
111
        gridBagConstraints.weightx = 1.0;
102
        gridBagConstraints.weightx = 1.0;
112
        add(locationContainer, gridBagConstraints);
103
        add(locationContainer, gridBagConstraints);
113
114
        gridBagConstraints = new java.awt.GridBagConstraints();
115
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
116
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
117
        gridBagConstraints.weightx = 1.0;
118
        gridBagConstraints.insets = new java.awt.Insets(12, 0, 12, 0);
119
        add(jSeparator1, gridBagConstraints);
120
121
        optionsContainer.setLayout(new java.awt.BorderLayout());
122
123
        gridBagConstraints = new java.awt.GridBagConstraints();
124
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
125
        gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
126
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
127
        gridBagConstraints.weightx = 1.0;
128
        gridBagConstraints.weighty = 1.0;
129
        add(optionsContainer, gridBagConstraints);
130
131
    }// </editor-fold>//GEN-END:initComponents
104
    }// </editor-fold>//GEN-END:initComponents
132
105
133
    // Variables declaration - do not modify//GEN-BEGIN:variables
106
    // Variables declaration - do not modify//GEN-BEGIN:variables
134
    private javax.swing.JSeparator jSeparator1;
135
    private javax.swing.JPanel locationContainer;
107
    private javax.swing.JPanel locationContainer;
136
    private javax.swing.JPanel optionsContainer;
137
    // End of variables declaration//GEN-END:variables
108
    // End of variables declaration//GEN-END:variables
138
109
139
    /** Help context where to find more about the paste type action.
110
    /** Help context where to find more about the paste type action.
(-)a/web.examples/src/org/netbeans/modules/web/examples/PanelOptionsVisual.form (-57 lines)
Lines 1-57 Link Here
1
<?xml version="1.0" encoding="UTF-8" ?>
2
3
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <AuxValues>
5
    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
6
    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
7
    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
8
    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
9
    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
10
    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
11
    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
12
    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
13
    <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,2,18,0,0,2,-33"/>
14
  </AuxValues>
15
16
  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
17
  <SubComponents>
18
    <Component class="javax.swing.JCheckBox" name="setAsMainCheckBox">
19
      <Properties>
20
        <Property name="mnemonic" type="int" editor="org.netbeans.modules.i18n.form.FormI18nMnemonicEditor">
21
          <ResourceString bundle="org/netbeans/modules/web/examples/Bundle.properties" key="LBL_NWP1_SetAsMain_CheckBoxMnemonic" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
22
        </Property>
23
        <Property name="selected" type="boolean" value="true"/>
24
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
25
          <ResourceString bundle="org/netbeans/modules/web/examples/Bundle.properties" key="LBL_NWP1_SetAsMain_CheckBox" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
26
        </Property>
27
        <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
28
          <Insets value="[0, 0, 0, 0]"/>
29
        </Property>
30
      </Properties>
31
      <AccessibilityProperties>
32
        <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
33
          <ResourceString bundle="org/netbeans/modules/web/examples/Bundle.properties" key="ACS_LBL_NWP1_SetAsMain_A11YDesc" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
34
        </Property>
35
      </AccessibilityProperties>
36
      <Constraints>
37
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
38
          <GridBagConstraints gridX="0" gridY="0" gridWidth="0" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="11" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
39
        </Constraint>
40
      </Constraints>
41
    </Component>
42
    <Container class="javax.swing.JScrollPane" name="jScrollPane1">
43
      <Properties>
44
        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
45
          <Border info="null"/>
46
        </Property>
47
      </Properties>
48
      <Constraints>
49
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
50
          <GridBagConstraints gridX="-1" gridY="-1" gridWidth="0" gridHeight="0" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="12" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="1.0"/>
51
        </Constraint>
52
      </Constraints>
53
54
      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
55
    </Container>
56
  </SubComponents>
57
</Form>
(-)a/web.examples/src/org/netbeans/modules/web/examples/PanelOptionsVisual.java (-115 lines)
Lines 1-115 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * Contributor(s):
28
 *
29
 * The Original Software is NetBeans. The Initial Developer of the Original
30
 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
31
 * Microsystems, Inc. All Rights Reserved.
32
 *
33
 * If you wish your version of this file to be governed by only the CDDL
34
 * or only the GPL Version 2, indicate your decision by adding
35
 * "[Contributor] elects to include this software in this distribution
36
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
37
 * single choice of license, a recipient has the option to distribute
38
 * your version of this file under either the CDDL, the GPL Version 2 or
39
 * to extend the choice of license to its licensees as provided above.
40
 * However, if you add GPL Version 2 code and therefore, elected the GPL
41
 * Version 2 license, then the option applies only if the new code is
42
 * made subject to such option by the copyright holder.
43
 */
44
45
package org.netbeans.modules.web.examples;
46
47
import org.openide.WizardDescriptor;
48
49
class PanelOptionsVisual extends javax.swing.JPanel {
50
51
    private PanelConfigureProject panel;
52
53
    /** Creates new form PanelOptionsVisual */
54
    public PanelOptionsVisual(PanelConfigureProject panel) {
55
        initComponents();
56
        this.panel = panel;
57
    }
58
59
    /** This method is called from within the constructor to
60
     * initialize the form.
61
     * WARNING: Do NOT modify this code. The content of this method is
62
     * always regenerated by the Form Editor.
63
     */
64
    private void initComponents() {//GEN-BEGIN:initComponents
65
        java.awt.GridBagConstraints gridBagConstraints;
66
67
        setAsMainCheckBox = new javax.swing.JCheckBox();
68
        jScrollPane1 = new javax.swing.JScrollPane();
69
70
        setLayout(new java.awt.GridBagLayout());
71
72
        setAsMainCheckBox.setMnemonic(org.openide.util.NbBundle.getMessage(PanelOptionsVisual.class, "LBL_NWP1_SetAsMain_CheckBoxMnemonic").charAt(0));
73
        setAsMainCheckBox.setSelected(true);
74
        setAsMainCheckBox.setText(org.openide.util.NbBundle.getMessage(PanelOptionsVisual.class, "LBL_NWP1_SetAsMain_CheckBox"));
75
        setAsMainCheckBox.setActionCommand("Set as Main Project");
76
        setAsMainCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
77
        gridBagConstraints = new java.awt.GridBagConstraints();
78
        gridBagConstraints.gridx = 0;
79
        gridBagConstraints.gridy = 0;
80
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
81
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
82
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 11, 0);
83
        add(setAsMainCheckBox, gridBagConstraints);
84
        setAsMainCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(PanelOptionsVisual.class, "ACS_LBL_NWP1_SetAsMain_A11YDesc"));
85
86
        jScrollPane1.setBorder(null);
87
        gridBagConstraints = new java.awt.GridBagConstraints();
88
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
89
        gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
90
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
91
        gridBagConstraints.weightx = 1.0;
92
        gridBagConstraints.weighty = 1.0;
93
        gridBagConstraints.insets = new java.awt.Insets(0, 12, 0, 0);
94
        add(jScrollPane1, gridBagConstraints);
95
96
    }//GEN-END:initComponents
97
    
98
    boolean valid(WizardDescriptor wizardDescriptor) {
99
        return true;
100
    }
101
102
    void store(WizardDescriptor d) {
103
        d.putProperty(WizardProperties.SET_AS_MAIN, setAsMainCheckBox.isSelected() ? Boolean.TRUE : Boolean.FALSE );
104
    }
105
    
106
    void read(WizardDescriptor d) {
107
    }
108
    
109
    // Variables declaration - do not modify//GEN-BEGIN:variables
110
    private javax.swing.JScrollPane jScrollPane1;
111
    private javax.swing.JCheckBox setAsMainCheckBox;
112
    // End of variables declaration//GEN-END:variables
113
114
}
115
(-)a/web.examples/src/org/netbeans/modules/web/examples/WizardProperties.java (-1 lines)
Lines 49-55 Link Here
49
    public static final String NAME = "name"; //NOI18N
49
    public static final String NAME = "name"; //NOI18N
50
    public static final String SOURCE_ROOT = "sourceRoot"; //NOI18N
50
    public static final String SOURCE_ROOT = "sourceRoot"; //NOI18N
51
51
52
    public static final String SET_AS_MAIN = "setAsMain"; //NOI18N
53
    public static final String J2EE_LEVEL = "j2eeLevel"; //NOI18N
52
    public static final String J2EE_LEVEL = "j2eeLevel"; //NOI18N
54
    public static final String CONTEXT_PATH = "contextPath"; //NOI18N
53
    public static final String CONTEXT_PATH = "contextPath"; //NOI18N
55
54
(-)a/web.project/src/org/netbeans/modules/web/project/ui/resources/layer.xml (-4 lines)
Lines 250-259 Link Here
250
                    <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
250
                    <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
251
                    <attr name="position" intvalue="1300"/>
251
                    <attr name="position" intvalue="1300"/>
252
                </file>
252
                </file>
253
                <file name="org-netbeans-modules-project-ui-SetMainProject.shadow">
254
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-SetMainProject.instance"/>
255
                    <attr name="position" intvalue="1400"/>
256
                </file>
257
                <file name="org-netbeans-modules-project-ui-actions-OpenSubprojects.shadow">
253
                <file name="org-netbeans-modules-project-ui-actions-OpenSubprojects.shadow">
258
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-actions-OpenSubprojects.instance"/>
254
                    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-actions-OpenSubprojects.instance"/>
259
                    <attr name="position" intvalue="1500"/>
255
                    <attr name="position" intvalue="1500"/>

Return to bug 166780