Lines 43-59
Link Here
|
43 |
|
43 |
|
44 |
import java.awt.event.ActionEvent; |
44 |
import java.awt.event.ActionEvent; |
45 |
import java.awt.event.ActionListener; |
45 |
import java.awt.event.ActionListener; |
|
|
46 |
import java.beans.PropertyChangeEvent; |
47 |
import java.beans.PropertyChangeListener; |
46 |
import java.io.File; |
48 |
import java.io.File; |
47 |
import java.io.IOException; |
|
|
48 |
import java.text.MessageFormat; |
49 |
import java.text.MessageFormat; |
49 |
import javax.swing.ButtonModel; |
|
|
50 |
import javax.swing.JComboBox; |
50 |
import javax.swing.JComboBox; |
51 |
import javax.swing.JFileChooser; |
51 |
import javax.swing.JFileChooser; |
52 |
import javax.swing.event.DocumentEvent; |
52 |
import javax.swing.event.DocumentEvent; |
53 |
import javax.swing.event.DocumentListener; |
53 |
import javax.swing.event.DocumentListener; |
54 |
import org.netbeans.api.project.Project; |
|
|
55 |
import org.netbeans.api.project.ProjectManager; |
56 |
import org.netbeans.api.project.ProjectUtils; |
57 |
import org.netbeans.modules.apisupport.project.ui.ModuleUISettings; |
54 |
import org.netbeans.modules.apisupport.project.ui.ModuleUISettings; |
58 |
import org.netbeans.modules.apisupport.project.universe.ModuleList; |
55 |
import org.netbeans.modules.apisupport.project.universe.ModuleList; |
59 |
import org.netbeans.modules.apisupport.project.universe.NbPlatform; |
56 |
import org.netbeans.modules.apisupport.project.universe.NbPlatform; |
Lines 61-70
Link Here
|
61 |
import org.netbeans.modules.apisupport.project.ui.customizer.SuiteUtils; |
58 |
import org.netbeans.modules.apisupport.project.ui.customizer.SuiteUtils; |
62 |
import org.netbeans.modules.apisupport.project.ui.platform.PlatformComponentFactory; |
59 |
import org.netbeans.modules.apisupport.project.ui.platform.PlatformComponentFactory; |
63 |
import org.netbeans.modules.apisupport.project.ui.platform.NbPlatformCustomizer; |
60 |
import org.netbeans.modules.apisupport.project.ui.platform.NbPlatformCustomizer; |
|
|
61 |
import org.netbeans.modules.apisupport.project.ui.wizard.spi.ModuleTypeChooserPanel; |
64 |
import org.netbeans.spi.project.ui.support.ProjectChooser; |
62 |
import org.netbeans.spi.project.ui.support.ProjectChooser; |
65 |
import org.openide.DialogDescriptor; |
|
|
66 |
import org.openide.DialogDisplayer; |
67 |
import org.openide.ErrorManager; |
68 |
import org.openide.filesystems.FileUtil; |
63 |
import org.openide.filesystems.FileUtil; |
69 |
import org.openide.util.NbBundle; |
64 |
import org.openide.util.NbBundle; |
70 |
|
65 |
|
Lines 83-95
Link Here
|
83 |
* |
78 |
* |
84 |
* @author Martin Krauskopf |
79 |
* @author Martin Krauskopf |
85 |
*/ |
80 |
*/ |
86 |
public class BasicInfoVisualPanel extends BasicVisualPanel.NewTemplatePanel { |
81 |
public class BasicInfoVisualPanel extends BasicVisualPanel.NewTemplatePanel |
|
|
82 |
implements PropertyChangeListener |
83 |
{ |
87 |
|
84 |
|
88 |
private ButtonModel lastSelectedType; |
|
|
89 |
private static String lastSelectedSuite; |
85 |
private static String lastSelectedSuite; |
90 |
private boolean locationUpdated; |
86 |
private boolean locationUpdated; |
91 |
private boolean nameUpdated; |
87 |
private boolean nameUpdated; |
92 |
private boolean moduleTypeGroupAttached = true; |
|
|
93 |
private boolean mainProjectTouched; |
88 |
private boolean mainProjectTouched; |
94 |
|
89 |
|
95 |
/** Creates new form BasicInfoVisualPanel */ |
90 |
/** Creates new form BasicInfoVisualPanel */ |
Lines 97-122
Link Here
|
97 |
super(data); |
92 |
super(data); |
98 |
initComponents(); |
93 |
initComponents(); |
99 |
initAccessibility(); |
94 |
initAccessibility(); |
100 |
initPlatformCombos(); |
95 |
initPlatformCombo(suitePlatformValue); |
|
|
96 |
initPanels(); |
101 |
setComponentsVisibility(); |
97 |
setComponentsVisibility(); |
102 |
switch (data.getWizardType()) { |
98 |
switch (data.getWizardType()) { |
103 |
case SUITE: |
99 |
case SUITE: |
104 |
case APPLICATION: |
100 |
case APPLICATION: |
105 |
detachModuleTypeGroup(); |
101 |
case LIBRARY_MODULE: |
106 |
break; |
102 |
break; |
107 |
case MODULE: |
103 |
case MODULE: |
108 |
case SUITE_COMPONENT: |
104 |
case SUITE_COMPONENT: |
109 |
if (moduleSuiteValue.getItemCount() > 0) { |
105 |
if (TypeChooserPanelImpl.getDefaultSuitesComboBox().getItemCount() > 0) { |
110 |
restoreSelectedSuite(); |
|
|
111 |
suiteComponent.setSelected(true); |
112 |
mainProject.setSelected(false); |
106 |
mainProject.setSelected(false); |
113 |
} |
|
|
114 |
break; |
115 |
case LIBRARY_MODULE: |
116 |
moduleSuite.setText(getMessage("LBL_Add_to_Suite")); // NOI18N |
117 |
suiteComponent.setSelected(true); |
118 |
if (moduleSuiteValue.getItemCount() > 0) { |
119 |
restoreSelectedSuite(); |
120 |
} |
107 |
} |
121 |
break; |
108 |
break; |
122 |
default: |
109 |
default: |
Lines 125-136
Link Here
|
125 |
attachDocumentListeners(); |
112 |
attachDocumentListeners(); |
126 |
setInitialLocation(); |
113 |
setInitialLocation(); |
127 |
setInitialProjectName(); |
114 |
setInitialProjectName(); |
128 |
updateEnabled(); |
115 |
} |
|
|
116 |
|
117 |
protected static boolean isNetBeansOrgFolder(File folder) { |
118 |
return ModuleList.findNetBeansOrg(folder) != null; |
119 |
} |
120 |
|
121 |
protected static void initPlatformCombo(JComboBox combo) { |
122 |
if (combo == null){ |
123 |
return; |
124 |
} |
125 |
if (combo.getItemCount() <= 0) { |
126 |
return; |
127 |
} |
128 |
boolean set = false; |
129 |
String idToSelect = ModuleUISettings.getDefault().getLastUsedPlatformID(); |
130 |
for (int i = 0; i < combo.getItemCount(); i++) { |
131 |
if (((NbPlatform) combo.getItemAt(i)).getID().equals(idToSelect)) { |
132 |
combo.setSelectedIndex(i); |
133 |
set = true; |
134 |
break; |
135 |
} |
136 |
} |
137 |
if (!set) { |
138 |
NbPlatform defPlaf = NbPlatform.getDefaultPlatform(); |
139 |
combo.setSelectedItem(defPlaf == null ? combo.getItemAt(0) : defPlaf); |
140 |
} |
141 |
} |
142 |
|
143 |
public void propertyChange(PropertyChangeEvent evt) { |
144 |
String name = evt.getPropertyName(); |
145 |
Object value = evt.getNewValue(); |
146 |
|
147 |
if (ModuleTypeChooserPanel.IS_STANDALONE.equals(name)){ |
148 |
standAloneModuletypeChanged(value); |
149 |
} else if (ModuleTypeChooserPanel.IS_SUITE_COMPONENT.equals(name)){ |
150 |
suiteComponenttypeChanged(value); |
151 |
} else if (ModuleTypeChooserPanel.SUITE_ROOT.equals(name)){ |
152 |
moduleSuiteValueChanged(value); |
153 |
} |
154 |
updateAndCheck(); |
155 |
} |
156 |
|
157 |
private void moduleSuiteValueChanged(Object val) { |
158 |
String suite = null; |
159 |
if (val != null && val instanceof String){ |
160 |
suite = (String)val; |
161 |
} |
162 |
if (!locationUpdated) { |
163 |
computeAndSetLocation(suite, true); |
164 |
} |
165 |
updateAndCheck(); |
166 |
} |
167 |
|
168 |
private void suiteComponenttypeChanged(Object val) { |
169 |
Boolean isSuiteComp = false; |
170 |
if (val != null && val instanceof Boolean){ |
171 |
isSuiteComp = ((Boolean)val).booleanValue(); |
172 |
} |
173 |
|
174 |
if (!mainProjectTouched) { |
175 |
mainProject.setSelected(!isSuiteComp); |
176 |
} |
177 |
if (!locationUpdated) { |
178 |
setInitialLocation(); |
179 |
} |
180 |
if (!nameUpdated) { |
181 |
setInitialProjectName(); |
182 |
} |
183 |
updateAndCheck(); |
184 |
} |
185 |
|
186 |
private void standAloneModuletypeChanged(Object val) { |
187 |
Boolean isStandAlone = false; |
188 |
if (val != null && val instanceof Boolean){ |
189 |
isStandAlone = ((Boolean)val).booleanValue(); |
190 |
} |
191 |
|
192 |
if (!mainProjectTouched) { |
193 |
mainProject.setSelected(isStandAlone); |
194 |
} |
195 |
if (!locationUpdated) { |
196 |
setInitialLocation(); |
197 |
} |
198 |
if (!nameUpdated) { |
199 |
setInitialProjectName(); |
200 |
} |
201 |
updateAndCheck(); |
129 |
} |
202 |
} |
130 |
|
203 |
|
131 |
private void setInitialLocation() { |
204 |
private void setInitialLocation() { |
132 |
if (isSuiteComponent()) { |
205 |
if (typeChooserPanel.isSuiteComponent()) { |
133 |
computeAndSetLocation((String) moduleSuiteValue.getSelectedItem(), true); |
206 |
computeAndSetLocation(typeChooserPanel.getSelectedSuite(), true); |
134 |
} else { // suite or standalone module |
207 |
} else { // suite or standalone module |
135 |
String location = computeLocationValue(ProjectChooser.getProjectsFolder().getAbsolutePath()); |
208 |
String location = computeLocationValue(ProjectChooser.getProjectsFolder().getAbsolutePath()); |
136 |
File locationF = new File(location); |
209 |
File locationF = new File(location); |
Lines 145-164
Link Here
|
145 |
private void initAccessibility() { |
218 |
private void initAccessibility() { |
146 |
this.getAccessibleContext().setAccessibleDescription(getMessage("ACS_BasicInfoVisualPanel")); |
219 |
this.getAccessibleContext().setAccessibleDescription(getMessage("ACS_BasicInfoVisualPanel")); |
147 |
browseButton.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_BrowseButton")); |
220 |
browseButton.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_BrowseButton")); |
148 |
browseSuiteButton.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_BrowseSuiteButton")); |
|
|
149 |
folderValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_FolderValue")); |
221 |
folderValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_FolderValue")); |
150 |
locationValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_LocationValue")); |
222 |
locationValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_LocationValue")); |
151 |
mainProject.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_MainProject")); |
223 |
mainProject.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_MainProject")); |
152 |
managePlatform.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_ManagePlatform")); |
|
|
153 |
manageSuitePlatform.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_ManageSuitePlatform")); |
224 |
manageSuitePlatform.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_ManageSuitePlatform")); |
154 |
moduleSuiteValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_ModuleSuiteValue")); |
|
|
155 |
nameValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_NameValue")); |
225 |
nameValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_NameValue")); |
156 |
platformValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_PlatformValue")); |
|
|
157 |
standAloneModule.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_StandAloneModule")); |
158 |
suiteComponent.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_SuiteModule")); |
159 |
suitePlatformValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_SuitePlatformValue")); |
226 |
suitePlatformValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_SuitePlatformValue")); |
160 |
} |
227 |
} |
161 |
|
228 |
|
|
|
229 |
private void initPanels(){ |
230 |
if (typeChooserPanel != null){ |
231 |
typeChooserPanelContainer.removeAll(); |
232 |
typeChooserPanel = null; |
233 |
} |
234 |
typeChooserPanel = new TypeChooserPanelImpl(); |
235 |
typeChooserPanelContainer.add(typeChooserPanel); |
236 |
typeChooserPanelContainer.validate(); |
237 |
} |
238 |
|
162 |
private void setComponentsVisibility() { |
239 |
private void setComponentsVisibility() { |
163 |
boolean isSuiteWizard = isSuiteWizard(); |
240 |
boolean isSuiteWizard = isSuiteWizard(); |
164 |
boolean isSuiteComponentWizard = isSuiteComponentWizard(); |
241 |
boolean isSuiteComponentWizard = isSuiteComponentWizard(); |
Lines 170-213
Link Here
|
170 |
manageSuitePlatform.setVisible(isSuiteWizard); |
247 |
manageSuitePlatform.setVisible(isSuiteWizard); |
171 |
mainProject.setVisible(!isLibraryWizard); |
248 |
mainProject.setVisible(!isLibraryWizard); |
172 |
|
249 |
|
173 |
suiteComponent.setVisible(!isLibraryWizard); |
|
|
174 |
platform.setVisible(!isLibraryWizard); |
175 |
platformValue.setVisible(!isLibraryWizard); |
176 |
managePlatform.setVisible(!isLibraryWizard); |
177 |
standAloneModule.setVisible(!isLibraryWizard); |
178 |
mainProject.setSelected(!isLibraryWizard); |
250 |
mainProject.setSelected(!isLibraryWizard); |
179 |
|
251 |
|
180 |
standAloneModule.setVisible(!isSuiteComponentWizard && !isLibraryWizard); |
252 |
if (typeChooserPanel != null){ |
181 |
platform.setVisible(!isSuiteComponentWizard && !isLibraryWizard); |
253 |
typeChooserPanel.setComponentsVisibility(isSuiteComponentWizard, isLibraryWizard); |
182 |
platformValue.setVisible(!isSuiteComponentWizard && !isLibraryWizard); |
|
|
183 |
managePlatform.setVisible(!isSuiteComponentWizard && !isLibraryWizard); |
184 |
suiteComponent.setVisible(!isSuiteComponentWizard && !isLibraryWizard); |
185 |
} |
186 |
|
187 |
private void restoreSelectedSuite() { |
188 |
String preferredSuiteDir = getPreferredSuiteDir(); |
189 |
if (preferredSuiteDir != null) { |
190 |
lastSelectedSuite = preferredSuiteDir; |
191 |
} |
254 |
} |
192 |
if (lastSelectedSuite != null) { |
|
|
193 |
int max = moduleSuiteValue.getModel().getSize(); |
194 |
for (int i=0; i < max; i++) { |
195 |
if (lastSelectedSuite.equals(moduleSuiteValue.getModel().getElementAt(i))) { |
196 |
moduleSuiteValue.setSelectedItem(lastSelectedSuite); |
197 |
break; |
198 |
} |
199 |
} |
200 |
} |
201 |
} |
202 |
|
203 |
private String getPreferredSuiteDir() { |
204 |
return (String) getSettings().getProperty(NewNbModuleWizardIterator.PREFERRED_SUITE_DIR); |
205 |
} |
206 |
|
207 |
private boolean isOneSuiteDedicatedMode() { |
208 |
Boolean b = (Boolean) getSettings().getProperty( |
209 |
NewNbModuleWizardIterator.ONE_SUITE_DEDICATED_MODE); |
210 |
return b != null ? b.booleanValue() : false; |
211 |
} |
255 |
} |
212 |
|
256 |
|
213 |
private String getNameValue() { |
257 |
private String getNameValue() { |
Lines 222-242
Link Here
|
222 |
return new File(getLocationValue()); |
266 |
return new File(getLocationValue()); |
223 |
} |
267 |
} |
224 |
|
268 |
|
225 |
private void updateEnabled() { |
|
|
226 |
boolean isNetBeansOrg = isNetBeansOrgFolder(); |
227 |
standAloneModule.setEnabled(!isNetBeansOrg); |
228 |
suiteComponent.setEnabled(!isNetBeansOrg); |
229 |
|
230 |
boolean standalone = isStandAlone(); |
231 |
boolean suiteModuleSelected = isSuiteComponent(); |
232 |
platform.setEnabled(standalone); |
233 |
platformValue.setEnabled(standalone); |
234 |
managePlatform.setEnabled(standalone); |
235 |
moduleSuite.setEnabled(suiteModuleSelected); |
236 |
moduleSuiteValue.setEnabled(suiteModuleSelected && !isOneSuiteDedicatedMode()); |
237 |
browseSuiteButton.setEnabled(suiteModuleSelected && !isOneSuiteDedicatedMode()); |
238 |
} |
239 |
|
240 |
void updateAndCheck() { |
269 |
void updateAndCheck() { |
241 |
updateGUI(); |
270 |
updateGUI(); |
242 |
|
271 |
|
Lines 246-256
Link Here
|
246 |
setError(getMessage("MSG_LocationCannotBeEmpty")); |
275 |
setError(getMessage("MSG_LocationCannotBeEmpty")); |
247 |
} else if (isLibraryWizard() && isNetBeansOrgFolder()) { |
276 |
} else if (isLibraryWizard() && isNetBeansOrgFolder()) { |
248 |
setError(getMessage("MSG_LibraryWrapperForNBOrgUnsupported")); |
277 |
setError(getMessage("MSG_LibraryWrapperForNBOrgUnsupported")); |
249 |
} else if (isSuiteComponent() && moduleSuiteValue.getSelectedItem() == null) { |
278 |
} else if (!typeChooserPanel.validate(getSettings())) { |
250 |
setError(getMessage("MSG_ChooseRegularSuite")); |
279 |
markInvalid(); |
251 |
} else if (isStandAlone() && |
|
|
252 |
(platformValue.getSelectedItem() == null || !((NbPlatform) platformValue.getSelectedItem()).isValid())) { |
253 |
setError(getMessage("MSG_ChosenPlatformIsInvalid")); |
254 |
} else if (isSuiteWizard() && |
280 |
} else if (isSuiteWizard() && |
255 |
(suitePlatformValue.getSelectedItem() == null || !((NbPlatform) suitePlatformValue.getSelectedItem()).isValid())) { |
281 |
(suitePlatformValue.getSelectedItem() == null || !((NbPlatform) suitePlatformValue.getSelectedItem()).isValid())) { |
256 |
setError(getMessage("MSG_ChosenPlatformIsInvalid")); |
282 |
setError(getMessage("MSG_ChosenPlatformIsInvalid")); |
Lines 268-304
Link Here
|
268 |
private void updateGUI() { |
294 |
private void updateGUI() { |
269 |
// update project folder |
295 |
// update project folder |
270 |
folderValue.setText(getFolder().getPath()); |
296 |
folderValue.setText(getFolder().getPath()); |
271 |
|
297 |
|
272 |
if (isSuiteWizard() || isNetBeansOrgFolder()) { |
298 |
getSettings().putProperty(ModuleTypeChooserPanel.PROJECT_FOLDER, getFolder()); |
273 |
detachModuleTypeGroup(); |
299 |
typeChooserPanel.updateUI(getSettings()); |
274 |
} else { |
|
|
275 |
attachModuleTypeGroup(); |
276 |
} |
277 |
updateEnabled(); |
278 |
} |
279 |
|
280 |
private void detachModuleTypeGroup() { |
281 |
if (moduleTypeGroupAttached) { |
282 |
lastSelectedType = moduleTypeGroup.getSelection(); |
283 |
moduleTypeGroup.remove(standAloneModule); |
284 |
moduleTypeGroup.remove(suiteComponent); |
285 |
standAloneModule.setSelected(false); |
286 |
suiteComponent.setSelected(false); |
287 |
moduleTypeGroupAttached = false; |
288 |
} |
289 |
} |
290 |
|
291 |
private void attachModuleTypeGroup() { |
292 |
if (!moduleTypeGroupAttached) { |
293 |
moduleTypeGroup.add(standAloneModule); |
294 |
moduleTypeGroup.add(suiteComponent); |
295 |
if (isLibraryWizard()) { |
296 |
suiteComponent.setSelected(true); |
297 |
} else { |
298 |
moduleTypeGroup.setSelected(lastSelectedType, true); |
299 |
} |
300 |
moduleTypeGroupAttached = true; |
301 |
} |
302 |
} |
300 |
} |
303 |
|
301 |
|
304 |
/** Set <em>next</em> free project name. */ |
302 |
/** Set <em>next</em> free project name. */ |
Lines 324-335
Link Here
|
324 |
getData().setProjectFolder(folderValue.getText()); |
322 |
getData().setProjectFolder(folderValue.getText()); |
325 |
getData().setMainProject(mainProject.isSelected()); |
323 |
getData().setMainProject(mainProject.isSelected()); |
326 |
getData().setNetBeansOrg(isNetBeansOrgFolder()); |
324 |
getData().setNetBeansOrg(isNetBeansOrgFolder()); |
327 |
getData().setStandalone(isStandAlone()); |
325 |
getData().setStandalone(typeChooserPanel.isStandAlone()); |
328 |
getData().setSuiteRoot((String) moduleSuiteValue.getSelectedItem()); |
326 |
getData().setSuiteRoot(typeChooserPanel.getSelectedSuite()); |
329 |
if (isSuiteWizard() && suitePlatformValue.getSelectedItem() != null) { |
327 |
if (isSuiteWizard() && suitePlatformValue.getSelectedItem() != null) { |
330 |
getData().setPlatformID(((NbPlatform) suitePlatformValue.getSelectedItem()).getID()); |
328 |
getData().setPlatformID(((NbPlatform) suitePlatformValue.getSelectedItem()).getID()); |
331 |
} else if (platformValue.getSelectedItem() != null) { |
329 |
} else if (typeChooserPanel.getSelectedPlatform() != null) { |
332 |
getData().setPlatformID(((NbPlatform) platformValue.getSelectedItem()).getID()); |
330 |
getData().setPlatformID(typeChooserPanel.getSelectedPlatform()); |
333 |
} |
331 |
} |
334 |
} |
332 |
} |
335 |
|
333 |
|
Lines 387-394
Link Here
|
387 |
updateAndCheck(); |
385 |
updateAndCheck(); |
388 |
} |
386 |
} |
389 |
}; |
387 |
}; |
390 |
platformValue.addActionListener(plafAL); |
|
|
391 |
suitePlatformValue.addActionListener(plafAL); |
388 |
suitePlatformValue.addActionListener(plafAL); |
|
|
389 |
typeChooserPanel.addPropertyChangeListener(this); |
392 |
} |
390 |
} |
393 |
|
391 |
|
394 |
private File getFolder() { |
392 |
private File getFolder() { |
Lines 401-434
Link Here
|
401 |
} |
399 |
} |
402 |
|
400 |
|
403 |
private boolean isNetBeansOrgFolder() { |
401 |
private boolean isNetBeansOrgFolder() { |
404 |
return ModuleList.findNetBeansOrg(getFolder()) != null; |
402 |
return isNetBeansOrgFolder(getFolder()); |
405 |
} |
403 |
} |
406 |
|
404 |
|
407 |
private static String getMessage(String key) { |
405 |
private static String getMessage(String key) { |
408 |
return NbBundle.getMessage(BasicInfoVisualPanel.class, key); |
406 |
return NbBundle.getMessage(BasicInfoVisualPanel.class, key); |
409 |
} |
407 |
} |
410 |
|
408 |
|
411 |
private void initPlatformCombos() { |
409 |
|
412 |
if (platformValue.getItemCount() <= 0) { |
|
|
413 |
return; |
414 |
} |
415 |
boolean set = false; |
416 |
String idToSelect = ModuleUISettings.getDefault().getLastUsedPlatformID(); |
417 |
for (int i = 0; i < platformValue.getItemCount(); i++) { |
418 |
if (((NbPlatform) platformValue.getItemAt(i)).getID().equals(idToSelect)) { |
419 |
platformValue.setSelectedIndex(i); |
420 |
suitePlatformValue.setSelectedIndex(i); |
421 |
set = true; |
422 |
break; |
423 |
} |
424 |
} |
425 |
if (!set) { |
426 |
NbPlatform defPlaf = NbPlatform.getDefaultPlatform(); |
427 |
platformValue.setSelectedItem(defPlaf == null ? platformValue.getItemAt(0) : defPlaf); |
428 |
suitePlatformValue.setSelectedItem(defPlaf == null ? suitePlatformValue.getItemAt(0) : defPlaf); |
429 |
} |
430 |
} |
431 |
|
432 |
private void setLocation(String location, boolean silently) { |
410 |
private void setLocation(String location, boolean silently) { |
433 |
boolean revert = silently && !locationUpdated; |
411 |
boolean revert = silently && !locationUpdated; |
434 |
locationValue.setText(location); |
412 |
locationValue.setText(location); |
Lines 451-470
Link Here
|
451 |
} |
429 |
} |
452 |
} |
430 |
} |
453 |
|
431 |
|
454 |
private boolean isStandAlone() { |
|
|
455 |
return standAloneModule.isSelected(); |
456 |
} |
457 |
|
458 |
private boolean isSuiteComponent() { |
459 |
return suiteComponent.isSelected(); |
460 |
} |
461 |
|
462 |
/** This method is called from within the constructor to |
432 |
/** This method is called from within the constructor to |
463 |
* initialize the form. |
433 |
* initialize the form. |
464 |
* WARNING: Do NOT modify this code. The content of this method is |
434 |
* WARNING: Do NOT modify this code. The content of this method is |
465 |
* always regenerated by the Form Editor. |
435 |
* always regenerated by the Form Editor. |
466 |
*/ |
436 |
*/ |
467 |
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents |
437 |
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents |
468 |
private void initComponents() { |
438 |
private void initComponents() { |
469 |
java.awt.GridBagConstraints gridBagConstraints; |
439 |
java.awt.GridBagConstraints gridBagConstraints; |
470 |
|
440 |
|
Lines 483-506
Link Here
|
483 |
manageSuitePlatform = new javax.swing.JButton(); |
453 |
manageSuitePlatform = new javax.swing.JButton(); |
484 |
separator3 = new javax.swing.JSeparator(); |
454 |
separator3 = new javax.swing.JSeparator(); |
485 |
mainProject = new javax.swing.JCheckBox(); |
455 |
mainProject = new javax.swing.JCheckBox(); |
486 |
typeChooserPanel = new javax.swing.JPanel(); |
|
|
487 |
standAloneModule = new javax.swing.JRadioButton(); |
488 |
platform = new javax.swing.JLabel(); |
489 |
platformValue = PlatformComponentFactory.getNbPlatformsComboxBox(); |
490 |
managePlatform = new javax.swing.JButton(); |
491 |
suiteComponent = new javax.swing.JRadioButton(); |
492 |
moduleSuite = new javax.swing.JLabel(); |
493 |
moduleSuiteValue = PlatformComponentFactory.getSuitesComboBox(); |
494 |
browseSuiteButton = new javax.swing.JButton(); |
495 |
chooserFiller = new javax.swing.JLabel(); |
496 |
pnlThouShaltBeholdLayout = new javax.swing.JPanel(); |
456 |
pnlThouShaltBeholdLayout = new javax.swing.JPanel(); |
|
|
457 |
typeChooserPanelContainer = new javax.swing.JPanel(); |
497 |
|
458 |
|
498 |
setLayout(new java.awt.GridBagLayout()); |
459 |
setLayout(new java.awt.GridBagLayout()); |
499 |
|
460 |
|
500 |
infoPanel.setLayout(new java.awt.GridBagLayout()); |
461 |
infoPanel.setLayout(new java.awt.GridBagLayout()); |
501 |
|
462 |
|
502 |
nameLbl.setLabelFor(nameValue); |
463 |
nameLbl.setLabelFor(nameValue); |
503 |
org.openide.awt.Mnemonics.setLocalizedText(nameLbl, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_ProjectName")); |
464 |
org.openide.awt.Mnemonics.setLocalizedText(nameLbl, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_ProjectName")); // NOI18N |
504 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
465 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
505 |
gridBagConstraints.gridx = 0; |
466 |
gridBagConstraints.gridx = 0; |
506 |
gridBagConstraints.gridy = 0; |
467 |
gridBagConstraints.gridy = 0; |
Lines 509-515
Link Here
|
509 |
infoPanel.add(nameLbl, gridBagConstraints); |
470 |
infoPanel.add(nameLbl, gridBagConstraints); |
510 |
|
471 |
|
511 |
locationLbl.setLabelFor(locationValue); |
472 |
locationLbl.setLabelFor(locationValue); |
512 |
org.openide.awt.Mnemonics.setLocalizedText(locationLbl, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_ProjectLocation")); |
473 |
org.openide.awt.Mnemonics.setLocalizedText(locationLbl, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_ProjectLocation")); // NOI18N |
513 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
474 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
514 |
gridBagConstraints.gridx = 0; |
475 |
gridBagConstraints.gridx = 0; |
515 |
gridBagConstraints.gridy = 1; |
476 |
gridBagConstraints.gridy = 1; |
Lines 518-524
Link Here
|
518 |
infoPanel.add(locationLbl, gridBagConstraints); |
479 |
infoPanel.add(locationLbl, gridBagConstraints); |
519 |
|
480 |
|
520 |
folderLbl.setLabelFor(folderValue); |
481 |
folderLbl.setLabelFor(folderValue); |
521 |
org.openide.awt.Mnemonics.setLocalizedText(folderLbl, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_ProjectFolder")); |
482 |
org.openide.awt.Mnemonics.setLocalizedText(folderLbl, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_ProjectFolder")); // NOI18N |
522 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
483 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
523 |
gridBagConstraints.gridx = 0; |
484 |
gridBagConstraints.gridx = 0; |
524 |
gridBagConstraints.gridy = 2; |
485 |
gridBagConstraints.gridy = 2; |
Lines 544-562
Link Here
|
544 |
gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 0); |
505 |
gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 0); |
545 |
infoPanel.add(locationValue, gridBagConstraints); |
506 |
infoPanel.add(locationValue, gridBagConstraints); |
546 |
|
507 |
|
547 |
org.openide.awt.Mnemonics.setLocalizedText(browseButton, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "CTL_BrowseButton_o")); |
508 |
org.openide.awt.Mnemonics.setLocalizedText(browseButton, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "CTL_BrowseButton_o")); // NOI18N |
548 |
browseButton.addActionListener(new java.awt.event.ActionListener() { |
509 |
browseButton.addActionListener(new java.awt.event.ActionListener() { |
549 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
510 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
550 |
browseLocation(evt); |
511 |
browseLocation(evt); |
551 |
} |
512 |
} |
552 |
}); |
513 |
}); |
553 |
|
|
|
554 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
514 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
555 |
gridBagConstraints.gridx = 2; |
515 |
gridBagConstraints.gridx = 2; |
556 |
gridBagConstraints.gridy = 1; |
516 |
gridBagConstraints.gridy = 1; |
557 |
gridBagConstraints.insets = new java.awt.Insets(6, 12, 6, 0); |
517 |
gridBagConstraints.insets = new java.awt.Insets(6, 12, 6, 0); |
558 |
infoPanel.add(browseButton, gridBagConstraints); |
518 |
infoPanel.add(browseButton, gridBagConstraints); |
559 |
|
|
|
560 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
519 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
561 |
gridBagConstraints.gridx = 1; |
520 |
gridBagConstraints.gridx = 1; |
562 |
gridBagConstraints.gridy = 5; |
521 |
gridBagConstraints.gridy = 5; |
Lines 572-585
Link Here
|
572 |
infoPanel.add(folderValue, gridBagConstraints); |
531 |
infoPanel.add(folderValue, gridBagConstraints); |
573 |
|
532 |
|
574 |
suitePlatform.setLabelFor(suitePlatformValue); |
533 |
suitePlatform.setLabelFor(suitePlatformValue); |
575 |
org.openide.awt.Mnemonics.setLocalizedText(suitePlatform, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_NetBeansPlatform")); |
534 |
org.openide.awt.Mnemonics.setLocalizedText(suitePlatform, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_NetBeansPlatform")); // NOI18N |
576 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
535 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
577 |
gridBagConstraints.gridx = 0; |
536 |
gridBagConstraints.gridx = 0; |
578 |
gridBagConstraints.gridy = 4; |
537 |
gridBagConstraints.gridy = 4; |
579 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; |
538 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; |
580 |
gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 12); |
539 |
gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 12); |
581 |
infoPanel.add(suitePlatform, gridBagConstraints); |
540 |
infoPanel.add(suitePlatform, gridBagConstraints); |
582 |
|
|
|
583 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
541 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
584 |
gridBagConstraints.gridx = 1; |
542 |
gridBagConstraints.gridx = 1; |
585 |
gridBagConstraints.gridy = 4; |
543 |
gridBagConstraints.gridy = 4; |
Lines 589-601
Link Here
|
589 |
gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 0); |
547 |
gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 0); |
590 |
infoPanel.add(suitePlatformValue, gridBagConstraints); |
548 |
infoPanel.add(suitePlatformValue, gridBagConstraints); |
591 |
|
549 |
|
592 |
org.openide.awt.Mnemonics.setLocalizedText(manageSuitePlatform, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "CTL_ManagePlatforms_g")); |
550 |
org.openide.awt.Mnemonics.setLocalizedText(manageSuitePlatform, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "CTL_ManagePlatforms_g")); // NOI18N |
593 |
manageSuitePlatform.addActionListener(new java.awt.event.ActionListener() { |
551 |
manageSuitePlatform.addActionListener(new java.awt.event.ActionListener() { |
594 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
552 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
595 |
manageSuitePlatformActionPerformed(evt); |
553 |
manageSuitePlatformActionPerformed(evt); |
596 |
} |
554 |
} |
597 |
}); |
555 |
}); |
598 |
|
|
|
599 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
556 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
600 |
gridBagConstraints.gridx = 2; |
557 |
gridBagConstraints.gridx = 2; |
601 |
gridBagConstraints.gridy = 4; |
558 |
gridBagConstraints.gridy = 4; |
Lines 603-609
Link Here
|
603 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; |
560 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; |
604 |
gridBagConstraints.insets = new java.awt.Insets(6, 12, 6, 0); |
561 |
gridBagConstraints.insets = new java.awt.Insets(6, 12, 6, 0); |
605 |
infoPanel.add(manageSuitePlatform, gridBagConstraints); |
562 |
infoPanel.add(manageSuitePlatform, gridBagConstraints); |
606 |
|
|
|
607 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
563 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
608 |
gridBagConstraints.gridx = 0; |
564 |
gridBagConstraints.gridx = 0; |
609 |
gridBagConstraints.gridy = 3; |
565 |
gridBagConstraints.gridy = 3; |
Lines 621-764
Link Here
|
621 |
add(infoPanel, gridBagConstraints); |
577 |
add(infoPanel, gridBagConstraints); |
622 |
|
578 |
|
623 |
mainProject.setSelected(true); |
579 |
mainProject.setSelected(true); |
624 |
org.openide.awt.Mnemonics.setLocalizedText(mainProject, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "CTL_SetAsMainProject")); |
580 |
org.openide.awt.Mnemonics.setLocalizedText(mainProject, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "CTL_SetAsMainProject")); // NOI18N |
625 |
mainProject.addActionListener(new java.awt.event.ActionListener() { |
581 |
mainProject.addActionListener(new java.awt.event.ActionListener() { |
626 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
582 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
627 |
mainProjectActionPerformed(evt); |
583 |
mainProjectActionPerformed(evt); |
628 |
} |
584 |
} |
629 |
}); |
585 |
}); |
630 |
|
|
|
631 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
586 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
632 |
gridBagConstraints.gridx = 0; |
587 |
gridBagConstraints.gridx = 0; |
633 |
gridBagConstraints.gridy = 2; |
588 |
gridBagConstraints.gridy = 2; |
634 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; |
589 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; |
635 |
gridBagConstraints.insets = new java.awt.Insets(12, 0, 0, 0); |
590 |
gridBagConstraints.insets = new java.awt.Insets(12, 0, 0, 0); |
636 |
add(mainProject, gridBagConstraints); |
591 |
add(mainProject, gridBagConstraints); |
637 |
|
|
|
638 |
typeChooserPanel.setLayout(new java.awt.GridBagLayout()); |
639 |
|
640 |
moduleTypeGroup.add(standAloneModule); |
641 |
standAloneModule.setSelected(true); |
642 |
org.openide.awt.Mnemonics.setLocalizedText(standAloneModule, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "CTL_StandaloneModule")); |
643 |
standAloneModule.addActionListener(new java.awt.event.ActionListener() { |
644 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
645 |
typeChanged(evt); |
646 |
} |
647 |
}); |
648 |
|
649 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
650 |
gridBagConstraints.gridx = 0; |
651 |
gridBagConstraints.gridy = 0; |
652 |
gridBagConstraints.gridwidth = 3; |
653 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; |
654 |
gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 0); |
655 |
typeChooserPanel.add(standAloneModule, gridBagConstraints); |
656 |
|
657 |
platform.setLabelFor(platformValue); |
658 |
org.openide.awt.Mnemonics.setLocalizedText(platform, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_NetBeansPlatform")); |
659 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
660 |
gridBagConstraints.gridx = 0; |
661 |
gridBagConstraints.gridy = 1; |
662 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; |
663 |
gridBagConstraints.insets = new java.awt.Insets(0, 18, 0, 12); |
664 |
typeChooserPanel.add(platform, gridBagConstraints); |
665 |
|
666 |
platformValue.addActionListener(new java.awt.event.ActionListener() { |
667 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
668 |
platformChosen(evt); |
669 |
} |
670 |
}); |
671 |
|
672 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
673 |
gridBagConstraints.gridx = 1; |
674 |
gridBagConstraints.gridy = 1; |
675 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
676 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; |
677 |
gridBagConstraints.weightx = 1.0; |
678 |
gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 12); |
679 |
typeChooserPanel.add(platformValue, gridBagConstraints); |
680 |
|
681 |
org.openide.awt.Mnemonics.setLocalizedText(managePlatform, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "CTL_ManagePlatforms_g")); |
682 |
managePlatform.addActionListener(new java.awt.event.ActionListener() { |
683 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
684 |
managePlatformActionPerformed(evt); |
685 |
} |
686 |
}); |
687 |
|
688 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
689 |
gridBagConstraints.gridx = 2; |
690 |
gridBagConstraints.gridy = 1; |
691 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
692 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; |
693 |
typeChooserPanel.add(managePlatform, gridBagConstraints); |
694 |
|
695 |
moduleTypeGroup.add(suiteComponent); |
696 |
org.openide.awt.Mnemonics.setLocalizedText(suiteComponent, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "CTL_AddToModuleSuite")); |
697 |
suiteComponent.addActionListener(new java.awt.event.ActionListener() { |
698 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
699 |
typeChanged(evt); |
700 |
} |
701 |
}); |
702 |
|
703 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
704 |
gridBagConstraints.gridx = 0; |
705 |
gridBagConstraints.gridy = 2; |
706 |
gridBagConstraints.gridwidth = 3; |
707 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; |
708 |
gridBagConstraints.insets = new java.awt.Insets(18, 0, 0, 0); |
709 |
typeChooserPanel.add(suiteComponent, gridBagConstraints); |
710 |
|
711 |
moduleSuite.setLabelFor(moduleSuiteValue); |
712 |
org.openide.awt.Mnemonics.setLocalizedText(moduleSuite, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_ModuleSuite")); |
713 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
714 |
gridBagConstraints.gridx = 0; |
715 |
gridBagConstraints.gridy = 3; |
716 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; |
717 |
gridBagConstraints.insets = new java.awt.Insets(6, 18, 0, 12); |
718 |
typeChooserPanel.add(moduleSuite, gridBagConstraints); |
719 |
|
720 |
moduleSuiteValue.addActionListener(new java.awt.event.ActionListener() { |
721 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
722 |
moduleSuiteChosen(evt); |
723 |
} |
724 |
}); |
725 |
|
726 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
727 |
gridBagConstraints.gridx = 1; |
728 |
gridBagConstraints.gridy = 3; |
729 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
730 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; |
731 |
gridBagConstraints.weightx = 1.0; |
732 |
gridBagConstraints.insets = new java.awt.Insets(6, 0, 0, 12); |
733 |
typeChooserPanel.add(moduleSuiteValue, gridBagConstraints); |
734 |
|
735 |
org.openide.awt.Mnemonics.setLocalizedText(browseSuiteButton, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "CTL_BrowseButton_w")); |
736 |
browseSuiteButton.addActionListener(new java.awt.event.ActionListener() { |
737 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
738 |
browseModuleSuite(evt); |
739 |
} |
740 |
}); |
741 |
|
742 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
743 |
gridBagConstraints.gridx = 2; |
744 |
gridBagConstraints.gridy = 3; |
745 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
746 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; |
747 |
gridBagConstraints.insets = new java.awt.Insets(6, 0, 0, 0); |
748 |
typeChooserPanel.add(browseSuiteButton, gridBagConstraints); |
749 |
|
750 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
751 |
gridBagConstraints.gridx = 0; |
752 |
gridBagConstraints.gridy = 4; |
753 |
gridBagConstraints.weighty = 1.0; |
754 |
typeChooserPanel.add(chooserFiller, gridBagConstraints); |
755 |
|
756 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
757 |
gridBagConstraints.gridx = 0; |
758 |
gridBagConstraints.gridy = 1; |
759 |
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; |
760 |
add(typeChooserPanel, gridBagConstraints); |
761 |
|
762 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
592 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
763 |
gridBagConstraints.gridx = 0; |
593 |
gridBagConstraints.gridx = 0; |
764 |
gridBagConstraints.gridy = 3; |
594 |
gridBagConstraints.gridy = 3; |
Lines 768-773
Link Here
|
768 |
gridBagConstraints.weighty = 1.0; |
598 |
gridBagConstraints.weighty = 1.0; |
769 |
add(pnlThouShaltBeholdLayout, gridBagConstraints); |
599 |
add(pnlThouShaltBeholdLayout, gridBagConstraints); |
770 |
|
600 |
|
|
|
601 |
typeChooserPanelContainer.setLayout(new java.awt.BorderLayout()); |
602 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
603 |
gridBagConstraints.gridx = 0; |
604 |
gridBagConstraints.gridy = 1; |
605 |
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; |
606 |
add(typeChooserPanelContainer, gridBagConstraints); |
771 |
}// </editor-fold>//GEN-END:initComponents |
607 |
}// </editor-fold>//GEN-END:initComponents |
772 |
|
608 |
|
773 |
private void manageSuitePlatformActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_manageSuitePlatformActionPerformed |
609 |
private void manageSuitePlatformActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_manageSuitePlatformActionPerformed |
Lines 777-849
Link Here
|
777 |
private void mainProjectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mainProjectActionPerformed |
613 |
private void mainProjectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mainProjectActionPerformed |
778 |
mainProjectTouched = true; |
614 |
mainProjectTouched = true; |
779 |
}//GEN-LAST:event_mainProjectActionPerformed |
615 |
}//GEN-LAST:event_mainProjectActionPerformed |
780 |
|
616 |
|
781 |
private void managePlatformActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_managePlatformActionPerformed |
|
|
782 |
managePlatform(platformValue); |
783 |
}//GEN-LAST:event_managePlatformActionPerformed |
784 |
|
785 |
private void managePlatform(final JComboBox platformCombo) { |
617 |
private void managePlatform(final JComboBox platformCombo) { |
786 |
NbPlatformCustomizer.showCustomizer(); |
618 |
NbPlatformCustomizer.showCustomizer(); |
787 |
platformCombo.setModel(new PlatformComponentFactory.NbPlatformListModel()); // refresh |
619 |
platformCombo.setModel(new PlatformComponentFactory.NbPlatformListModel()); // refresh |
788 |
platformCombo.requestFocus(); |
620 |
platformCombo.requestFocus(); |
789 |
updateAndCheck(); |
621 |
updateAndCheck(); |
790 |
} |
622 |
} |
791 |
|
623 |
|
792 |
private void platformChosen(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_platformChosen |
|
|
793 |
updateAndCheck(); |
794 |
}//GEN-LAST:event_platformChosen |
795 |
|
796 |
private void moduleSuiteChosen(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_moduleSuiteChosen |
797 |
if (!locationUpdated) { |
798 |
String suite = (String) moduleSuiteValue.getSelectedItem(); |
799 |
computeAndSetLocation(suite, true); |
800 |
lastSelectedSuite = suite; |
801 |
} |
802 |
updateAndCheck(); |
803 |
}//GEN-LAST:event_moduleSuiteChosen |
804 |
|
805 |
private void browseModuleSuite(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseModuleSuite |
806 |
JFileChooser chooser = ProjectChooser.projectChooser(); |
807 |
int option = chooser.showOpenDialog(this); |
808 |
if (option == JFileChooser.APPROVE_OPTION) { |
809 |
File projectDir = chooser.getSelectedFile(); |
810 |
UIUtil.setProjectChooserDirParent(projectDir); |
811 |
try { |
812 |
Project suite = ProjectManager.getDefault().findProject( |
813 |
FileUtil.toFileObject(projectDir)); |
814 |
if (suite != null) { |
815 |
String suiteDir = SuiteUtils.getSuiteDirectoryPath(suite); |
816 |
if (suiteDir != null) { |
817 |
// register for this session |
818 |
PlatformComponentFactory.addUserSuite(suiteDir); |
819 |
// add to current combobox |
820 |
moduleSuiteValue.addItem(suiteDir); |
821 |
moduleSuiteValue.setSelectedItem(suiteDir); |
822 |
} else { |
823 |
DialogDisplayer.getDefault().notify(new DialogDescriptor.Message( |
824 |
NbBundle.getMessage(BasicInfoVisualPanel.class, "MSG_NotRegularSuite", |
825 |
ProjectUtils.getInformation(suite).getDisplayName()))); |
826 |
} |
827 |
} |
828 |
} catch (IOException e) { |
829 |
ErrorManager.getDefault().notify(ErrorManager.WARNING, e); |
830 |
} |
831 |
} |
832 |
}//GEN-LAST:event_browseModuleSuite |
833 |
|
834 |
private void typeChanged(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_typeChanged |
835 |
if (!mainProjectTouched) { |
836 |
mainProject.setSelected(isStandAlone()); |
837 |
} |
838 |
if (!locationUpdated) { |
839 |
setInitialLocation(); |
840 |
} |
841 |
if (!nameUpdated) { |
842 |
setInitialProjectName(); |
843 |
} |
844 |
updateAndCheck(); |
845 |
}//GEN-LAST:event_typeChanged |
846 |
|
847 |
private void browseLocation(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseLocation |
624 |
private void browseLocation(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseLocation |
848 |
JFileChooser chooser = new JFileChooser(getLocationValue()); |
625 |
JFileChooser chooser = new JFileChooser(getLocationValue()); |
849 |
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); |
626 |
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); |
Lines 855-862
Link Here
|
855 |
|
632 |
|
856 |
// Variables declaration - do not modify//GEN-BEGIN:variables |
633 |
// Variables declaration - do not modify//GEN-BEGIN:variables |
857 |
private javax.swing.JButton browseButton; |
634 |
private javax.swing.JButton browseButton; |
858 |
private javax.swing.JButton browseSuiteButton; |
|
|
859 |
private javax.swing.JLabel chooserFiller; |
860 |
private javax.swing.JLabel filler; |
635 |
private javax.swing.JLabel filler; |
861 |
private javax.swing.JLabel folderLbl; |
636 |
private javax.swing.JLabel folderLbl; |
862 |
private javax.swing.JTextField folderValue; |
637 |
private javax.swing.JTextField folderValue; |
Lines 864-885
Link Here
|
864 |
private javax.swing.JLabel locationLbl; |
639 |
private javax.swing.JLabel locationLbl; |
865 |
private javax.swing.JTextField locationValue; |
640 |
private javax.swing.JTextField locationValue; |
866 |
private javax.swing.JCheckBox mainProject; |
641 |
private javax.swing.JCheckBox mainProject; |
867 |
private javax.swing.JButton managePlatform; |
|
|
868 |
private javax.swing.JButton manageSuitePlatform; |
642 |
private javax.swing.JButton manageSuitePlatform; |
869 |
private javax.swing.JLabel moduleSuite; |
|
|
870 |
private javax.swing.JComboBox moduleSuiteValue; |
871 |
private javax.swing.ButtonGroup moduleTypeGroup; |
643 |
private javax.swing.ButtonGroup moduleTypeGroup; |
872 |
private javax.swing.JLabel nameLbl; |
644 |
private javax.swing.JLabel nameLbl; |
873 |
javax.swing.JTextField nameValue; |
645 |
javax.swing.JTextField nameValue; |
874 |
private javax.swing.JLabel platform; |
|
|
875 |
private javax.swing.JComboBox platformValue; |
876 |
private javax.swing.JPanel pnlThouShaltBeholdLayout; |
646 |
private javax.swing.JPanel pnlThouShaltBeholdLayout; |
877 |
private javax.swing.JSeparator separator3; |
647 |
private javax.swing.JSeparator separator3; |
878 |
private javax.swing.JRadioButton standAloneModule; |
|
|
879 |
private javax.swing.JRadioButton suiteComponent; |
880 |
private javax.swing.JLabel suitePlatform; |
648 |
private javax.swing.JLabel suitePlatform; |
881 |
private javax.swing.JComboBox suitePlatformValue; |
649 |
private javax.swing.JComboBox suitePlatformValue; |
882 |
private javax.swing.JPanel typeChooserPanel; |
650 |
private javax.swing.JPanel typeChooserPanelContainer; |
883 |
// End of variables declaration//GEN-END:variables |
651 |
// End of variables declaration//GEN-END:variables |
884 |
|
652 |
|
|
|
653 |
private TypeChooserPanelImpl typeChooserPanel; |
885 |
} |
654 |
} |