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.ModuleTypePanelCreator.ModuleTypePanel; |
64 |
import org.netbeans.spi.project.ui.support.ProjectChooser; |
62 |
import org.netbeans.spi.project.ui.support.ProjectChooser; |
65 |
import org.openide.DialogDescriptor; |
63 |
import org.openide.WizardDescriptor; |
66 |
import org.openide.DialogDisplayer; |
|
|
67 |
import org.openide.ErrorManager; |
68 |
import org.openide.filesystems.FileUtil; |
64 |
import org.openide.filesystems.FileUtil; |
69 |
import org.openide.util.NbBundle; |
65 |
import org.openide.util.NbBundle; |
70 |
|
66 |
|
Lines 83-122
Link Here
|
83 |
* |
79 |
* |
84 |
* @author Martin Krauskopf |
80 |
* @author Martin Krauskopf |
85 |
*/ |
81 |
*/ |
86 |
public class BasicInfoVisualPanel extends BasicVisualPanel.NewTemplatePanel { |
82 |
public class BasicInfoVisualPanel extends BasicVisualPanel.NewTemplatePanel |
|
|
83 |
implements PropertyChangeListener |
84 |
{ |
87 |
|
85 |
|
88 |
private ButtonModel lastSelectedType; |
|
|
89 |
private static String lastSelectedSuite; |
86 |
private static String lastSelectedSuite; |
90 |
private boolean locationUpdated; |
87 |
private boolean locationUpdated; |
91 |
private boolean nameUpdated; |
88 |
private boolean nameUpdated; |
92 |
private boolean moduleTypeGroupAttached = true; |
|
|
93 |
private boolean mainProjectTouched; |
89 |
private boolean mainProjectTouched; |
94 |
|
90 |
|
95 |
/** Creates new form BasicInfoVisualPanel */ |
91 |
/** Creates new form BasicInfoVisualPanel */ |
96 |
BasicInfoVisualPanel(final NewModuleProjectData data) { |
92 |
BasicInfoVisualPanel(final NewModuleProjectData data) { |
97 |
super(data); |
93 |
super(data); |
98 |
initComponents(); |
94 |
initComponents(); |
99 |
initAccessibility(); |
95 |
initPlatformCombo(suitePlatformValue); |
100 |
initPlatformCombos(); |
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 (ModuleTypePanel.IS_STANDALONE_OR_SUITE_COMPONENT.equals(name)){ |
148 |
moduletypeChanged(value); |
149 |
} else if (ModuleTypePanel.SUITE_ROOT.equals(name)){ |
150 |
moduleSuiteValueChanged(value); |
151 |
} else if (ModuleTypePanel.ACTIVE_PLATFORM.equals(name)){ |
152 |
updateAndCheck(); |
153 |
} |
154 |
} |
155 |
|
156 |
private void moduleSuiteValueChanged(Object val) { |
157 |
String suite = null; |
158 |
if (val != null && val instanceof String){ |
159 |
suite = (String)val; |
160 |
} |
161 |
if (!locationUpdated) { |
162 |
computeAndSetLocation(suite, true); |
163 |
} |
164 |
updateAndCheck(); |
165 |
} |
166 |
|
167 |
private void moduletypeChanged(Object val) { |
168 |
Boolean isStandAlone = null; |
169 |
if (val != null && val instanceof Boolean){ |
170 |
isStandAlone = ((Boolean)val).booleanValue(); |
171 |
// todo TEST |
172 |
} |
173 |
// null means both radio uttons are deselected and disaled |
174 |
if (isStandAlone == null){ |
175 |
return; |
176 |
} |
177 |
|
178 |
if (!mainProjectTouched) { |
179 |
mainProject.setSelected(isStandAlone); |
180 |
} |
181 |
if (!locationUpdated) { |
182 |
setInitialLocation(); |
183 |
} |
184 |
if (!nameUpdated) { |
185 |
setInitialProjectName(); |
186 |
} |
187 |
updateAndCheck(); |
129 |
} |
188 |
} |
130 |
|
189 |
|
131 |
private void setInitialLocation() { |
190 |
private void setInitialLocation() { |
132 |
if (isSuiteComponent()) { |
191 |
if (typeChooserPanel.isSuiteComponent()) { |
133 |
computeAndSetLocation((String) moduleSuiteValue.getSelectedItem(), true); |
192 |
computeAndSetLocation(typeChooserPanel.getSelectedSuite(), true); |
134 |
} else { // suite or standalone module |
193 |
} else { // suite or standalone module |
135 |
String location = computeLocationValue(ProjectChooser.getProjectsFolder().getAbsolutePath()); |
194 |
String location = computeLocationValue(ProjectChooser.getProjectsFolder().getAbsolutePath()); |
136 |
File locationF = new File(location); |
195 |
File locationF = new File(location); |
Lines 142-164
Link Here
|
142 |
} |
201 |
} |
143 |
} |
202 |
} |
144 |
|
203 |
|
145 |
private void initAccessibility() { |
204 |
private void initPanels(){ |
146 |
this.getAccessibleContext().setAccessibleDescription(getMessage("ACS_BasicInfoVisualPanel")); |
205 |
if (typeChooserPanel != null){ |
147 |
browseButton.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_BrowseButton")); |
206 |
typeChooserPanelContainer.removeAll(); |
148 |
browseSuiteButton.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_BrowseSuiteButton")); |
207 |
typeChooserPanel = null; |
149 |
folderValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_FolderValue")); |
208 |
} |
150 |
locationValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_LocationValue")); |
209 |
typeChooserPanel = new TypeChooserPanelImpl(); |
151 |
mainProject.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_MainProject")); |
210 |
typeChooserPanelContainer.add(typeChooserPanel); |
152 |
managePlatform.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_ManagePlatform")); |
211 |
typeChooserPanelContainer.validate(); |
153 |
manageSuitePlatform.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_ManageSuitePlatform")); |
|
|
154 |
moduleSuiteValue.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_ModuleSuiteValue")); |
155 |
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")); |
160 |
} |
212 |
} |
161 |
|
213 |
|
162 |
private void setComponentsVisibility() { |
214 |
private void setComponentsVisibility() { |
163 |
boolean isSuiteWizard = isSuiteWizard(); |
215 |
boolean isSuiteWizard = isSuiteWizard(); |
164 |
boolean isSuiteComponentWizard = isSuiteComponentWizard(); |
216 |
boolean isSuiteComponentWizard = isSuiteComponentWizard(); |
Lines 170-213
Link Here
|
170 |
manageSuitePlatform.setVisible(isSuiteWizard); |
222 |
manageSuitePlatform.setVisible(isSuiteWizard); |
171 |
mainProject.setVisible(!isLibraryWizard); |
223 |
mainProject.setVisible(!isLibraryWizard); |
172 |
|
224 |
|
173 |
suiteComponent.setVisible(!isLibraryWizard); |
|
|
174 |
platform.setVisible(!isLibraryWizard); |
175 |
platformValue.setVisible(!isLibraryWizard); |
176 |
managePlatform.setVisible(!isLibraryWizard); |
177 |
standAloneModule.setVisible(!isLibraryWizard); |
178 |
mainProject.setSelected(!isLibraryWizard); |
225 |
mainProject.setSelected(!isLibraryWizard); |
179 |
|
226 |
|
180 |
standAloneModule.setVisible(!isSuiteComponentWizard && !isLibraryWizard); |
227 |
if (typeChooserPanel != null){ |
181 |
platform.setVisible(!isSuiteComponentWizard && !isLibraryWizard); |
228 |
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 |
} |
229 |
} |
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 |
} |
230 |
} |
212 |
|
231 |
|
213 |
private String getNameValue() { |
232 |
private String getNameValue() { |
Lines 222-265
Link Here
|
222 |
return new File(getLocationValue()); |
241 |
return new File(getLocationValue()); |
223 |
} |
242 |
} |
224 |
|
243 |
|
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() { |
244 |
void updateAndCheck() { |
241 |
updateGUI(); |
245 |
updateGUI(); |
242 |
|
246 |
|
243 |
if ("".equals(getNameValue())) { |
247 |
if ("".equals(getNameValue())) { |
244 |
setError(getMessage("MSG_NameCannotBeEmpty")); |
248 |
setError(NbBundle.getMessage( |
|
|
249 |
BasicInfoVisualPanel.class, "MSG_NameCannotBeEmpty"));//NOI18N |
245 |
} else if ("".equals(getLocationValue())) { |
250 |
} else if ("".equals(getLocationValue())) { |
246 |
setError(getMessage("MSG_LocationCannotBeEmpty")); |
251 |
setError(NbBundle.getMessage( |
|
|
252 |
BasicInfoVisualPanel.class, "MSG_LocationCannotBeEmpty"));//NOI18N |
247 |
} else if (isLibraryWizard() && isNetBeansOrgFolder()) { |
253 |
} else if (isLibraryWizard() && isNetBeansOrgFolder()) { |
248 |
setError(getMessage("MSG_LibraryWrapperForNBOrgUnsupported")); |
254 |
setError(NbBundle.getMessage( |
249 |
} else if (isSuiteComponent() && moduleSuiteValue.getSelectedItem() == null) { |
255 |
BasicInfoVisualPanel.class, "MSG_LibraryWrapperForNBOrgUnsupported"));//NOI18N |
250 |
setError(getMessage("MSG_ChooseRegularSuite")); |
256 |
} else if (!typeChooserPanel.validate(getSettings())) { |
251 |
} else if (isStandAlone() && |
257 |
setError((String)getSettings().getProperty(WizardDescriptor.PROP_ERROR_MESSAGE)); |
252 |
(platformValue.getSelectedItem() == null || !((NbPlatform) platformValue.getSelectedItem()).isValid())) { |
|
|
253 |
setError(getMessage("MSG_ChosenPlatformIsInvalid")); |
254 |
} else if (isSuiteWizard() && |
258 |
} else if (isSuiteWizard() && |
255 |
(suitePlatformValue.getSelectedItem() == null || !((NbPlatform) suitePlatformValue.getSelectedItem()).isValid())) { |
259 |
(suitePlatformValue.getSelectedItem() == null || !((NbPlatform) suitePlatformValue.getSelectedItem()).isValid())) |
256 |
setError(getMessage("MSG_ChosenPlatformIsInvalid")); |
260 |
{ |
|
|
261 |
setError(NbBundle.getMessage( |
262 |
BasicInfoVisualPanel.class, "MSG_ChosenPlatformIsInvalid"));//NOI18N |
257 |
} else if (getFolder().exists()) { |
263 |
} else if (getFolder().exists()) { |
258 |
setError(getMessage("MSG_ProjectFolderExists")); |
264 |
setError(NbBundle.getMessage( |
|
|
265 |
BasicInfoVisualPanel.class, "MSG_ProjectFolderExists"));//NOI18N |
259 |
} else if (!getLocationFile().exists()) { |
266 |
} else if (!getLocationFile().exists()) { |
260 |
setError(getMessage("MSG_LocationMustExist")); |
267 |
setError(NbBundle.getMessage( |
|
|
268 |
BasicInfoVisualPanel.class, "MSG_LocationMustExist"));//NOI18N |
261 |
} else if (!getLocationFile().canWrite()) { |
269 |
} else if (!getLocationFile().canWrite()) { |
262 |
setError(getMessage("MSG_LocationNotWritable")); |
270 |
setError(NbBundle.getMessage( |
|
|
271 |
BasicInfoVisualPanel.class, "MSG_LocationNotWritable"));//NOI18N |
263 |
} else { |
272 |
} else { |
264 |
markValid(); |
273 |
markValid(); |
265 |
} |
274 |
} |
Lines 268-304
Link Here
|
268 |
private void updateGUI() { |
277 |
private void updateGUI() { |
269 |
// update project folder |
278 |
// update project folder |
270 |
folderValue.setText(getFolder().getPath()); |
279 |
folderValue.setText(getFolder().getPath()); |
271 |
|
280 |
|
272 |
if (isSuiteWizard() || isNetBeansOrgFolder()) { |
281 |
getSettings().putProperty(ModuleTypePanel.PROJECT_FOLDER, getFolder()); |
273 |
detachModuleTypeGroup(); |
282 |
typeChooserPanel.setProjectFolder(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 |
} |
283 |
} |
303 |
|
284 |
|
304 |
/** Set <em>next</em> free project name. */ |
285 |
/** Set <em>next</em> free project name. */ |
Lines 324-335
Link Here
|
324 |
getData().setProjectFolder(folderValue.getText()); |
305 |
getData().setProjectFolder(folderValue.getText()); |
325 |
getData().setMainProject(mainProject.isSelected()); |
306 |
getData().setMainProject(mainProject.isSelected()); |
326 |
getData().setNetBeansOrg(isNetBeansOrgFolder()); |
307 |
getData().setNetBeansOrg(isNetBeansOrgFolder()); |
327 |
getData().setStandalone(isStandAlone()); |
308 |
getData().setStandalone(typeChooserPanel.isStandAlone()); |
328 |
getData().setSuiteRoot((String) moduleSuiteValue.getSelectedItem()); |
309 |
getData().setSuiteRoot(typeChooserPanel.getSelectedSuite()); |
329 |
if (isSuiteWizard() && suitePlatformValue.getSelectedItem() != null) { |
310 |
if (isSuiteWizard() && suitePlatformValue.getSelectedItem() != null) { |
330 |
getData().setPlatformID(((NbPlatform) suitePlatformValue.getSelectedItem()).getID()); |
311 |
getData().setPlatformID(((NbPlatform) suitePlatformValue.getSelectedItem()).getID()); |
331 |
} else if (platformValue.getSelectedItem() != null) { |
312 |
} else if (typeChooserPanel.getSelectedPlatform() != null) { |
332 |
getData().setPlatformID(((NbPlatform) platformValue.getSelectedItem()).getID()); |
313 |
getData().setPlatformID(typeChooserPanel.getSelectedPlatform()); |
333 |
} |
314 |
} |
334 |
} |
315 |
} |
335 |
|
316 |
|
Lines 365-371
Link Here
|
365 |
default: |
346 |
default: |
366 |
assert false : "Unknown wizard type = " + getData().getWizardType(); |
347 |
assert false : "Unknown wizard type = " + getData().getWizardType(); |
367 |
} |
348 |
} |
368 |
setProjectName(getMessage(bundlekey), counter); |
349 |
setProjectName(NbBundle.getMessage(BasicInfoVisualPanel.class, bundlekey), counter); |
369 |
nameValue.select(0, nameValue.getText().length()); |
350 |
nameValue.select(0, nameValue.getText().length()); |
370 |
nameUpdated = false; |
351 |
nameUpdated = false; |
371 |
} |
352 |
} |
Lines 387-394
Link Here
|
387 |
updateAndCheck(); |
368 |
updateAndCheck(); |
388 |
} |
369 |
} |
389 |
}; |
370 |
}; |
390 |
platformValue.addActionListener(plafAL); |
|
|
391 |
suitePlatformValue.addActionListener(plafAL); |
371 |
suitePlatformValue.addActionListener(plafAL); |
|
|
372 |
getSettings().addPropertyChangeListener(this); |
392 |
} |
373 |
} |
393 |
|
374 |
|
394 |
private File getFolder() { |
375 |
private File getFolder() { |
Lines 401-432
Link Here
|
401 |
} |
382 |
} |
402 |
|
383 |
|
403 |
private boolean isNetBeansOrgFolder() { |
384 |
private boolean isNetBeansOrgFolder() { |
404 |
return ModuleList.findNetBeansOrg(getFolder()) != null; |
385 |
return isNetBeansOrgFolder(getFolder()); |
405 |
} |
|
|
406 |
|
407 |
private static String getMessage(String key) { |
408 |
return NbBundle.getMessage(BasicInfoVisualPanel.class, key); |
409 |
} |
410 |
|
411 |
private void initPlatformCombos() { |
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 |
} |
386 |
} |
431 |
|
387 |
|
432 |
private void setLocation(String location, boolean silently) { |
388 |
private void setLocation(String location, boolean silently) { |
Lines 451-470
Link Here
|
451 |
} |
407 |
} |
452 |
} |
408 |
} |
453 |
|
409 |
|
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 |
410 |
/** This method is called from within the constructor to |
463 |
* initialize the form. |
411 |
* initialize the form. |
464 |
* WARNING: Do NOT modify this code. The content of this method is |
412 |
* WARNING: Do NOT modify this code. The content of this method is |
465 |
* always regenerated by the Form Editor. |
413 |
* always regenerated by the Form Editor. |
466 |
*/ |
414 |
*/ |
467 |
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents |
415 |
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents |
468 |
private void initComponents() { |
416 |
private void initComponents() { |
469 |
java.awt.GridBagConstraints gridBagConstraints; |
417 |
java.awt.GridBagConstraints gridBagConstraints; |
470 |
|
418 |
|
Lines 483-506
Link Here
|
483 |
manageSuitePlatform = new javax.swing.JButton(); |
431 |
manageSuitePlatform = new javax.swing.JButton(); |
484 |
separator3 = new javax.swing.JSeparator(); |
432 |
separator3 = new javax.swing.JSeparator(); |
485 |
mainProject = new javax.swing.JCheckBox(); |
433 |
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(); |
434 |
pnlThouShaltBeholdLayout = new javax.swing.JPanel(); |
|
|
435 |
typeChooserPanelContainer = new javax.swing.JPanel(); |
497 |
|
436 |
|
498 |
setLayout(new java.awt.GridBagLayout()); |
437 |
setLayout(new java.awt.GridBagLayout()); |
499 |
|
438 |
|
500 |
infoPanel.setLayout(new java.awt.GridBagLayout()); |
439 |
infoPanel.setLayout(new java.awt.GridBagLayout()); |
501 |
|
440 |
|
502 |
nameLbl.setLabelFor(nameValue); |
441 |
nameLbl.setLabelFor(nameValue); |
503 |
org.openide.awt.Mnemonics.setLocalizedText(nameLbl, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_ProjectName")); |
442 |
org.openide.awt.Mnemonics.setLocalizedText(nameLbl, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_ProjectName")); // NOI18N |
504 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
443 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
505 |
gridBagConstraints.gridx = 0; |
444 |
gridBagConstraints.gridx = 0; |
506 |
gridBagConstraints.gridy = 0; |
445 |
gridBagConstraints.gridy = 0; |
Lines 509-515
Link Here
|
509 |
infoPanel.add(nameLbl, gridBagConstraints); |
448 |
infoPanel.add(nameLbl, gridBagConstraints); |
510 |
|
449 |
|
511 |
locationLbl.setLabelFor(locationValue); |
450 |
locationLbl.setLabelFor(locationValue); |
512 |
org.openide.awt.Mnemonics.setLocalizedText(locationLbl, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_ProjectLocation")); |
451 |
org.openide.awt.Mnemonics.setLocalizedText(locationLbl, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_ProjectLocation")); // NOI18N |
513 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
452 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
514 |
gridBagConstraints.gridx = 0; |
453 |
gridBagConstraints.gridx = 0; |
515 |
gridBagConstraints.gridy = 1; |
454 |
gridBagConstraints.gridy = 1; |
Lines 518-524
Link Here
|
518 |
infoPanel.add(locationLbl, gridBagConstraints); |
457 |
infoPanel.add(locationLbl, gridBagConstraints); |
519 |
|
458 |
|
520 |
folderLbl.setLabelFor(folderValue); |
459 |
folderLbl.setLabelFor(folderValue); |
521 |
org.openide.awt.Mnemonics.setLocalizedText(folderLbl, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_ProjectFolder")); |
460 |
org.openide.awt.Mnemonics.setLocalizedText(folderLbl, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_ProjectFolder")); // NOI18N |
522 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
461 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
523 |
gridBagConstraints.gridx = 0; |
462 |
gridBagConstraints.gridx = 0; |
524 |
gridBagConstraints.gridy = 2; |
463 |
gridBagConstraints.gridy = 2; |
Lines 534-539
Link Here
|
534 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; |
473 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; |
535 |
gridBagConstraints.weightx = 1.0; |
474 |
gridBagConstraints.weightx = 1.0; |
536 |
infoPanel.add(nameValue, gridBagConstraints); |
475 |
infoPanel.add(nameValue, gridBagConstraints); |
|
|
476 |
nameValue.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "ACS_CTL_NameValue")); // NOI18N |
477 |
nameValue.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "ACS_CTL_NameValue")); // NOI18N |
537 |
|
478 |
|
538 |
locationValue.setHorizontalAlignment(javax.swing.JTextField.LEFT); |
479 |
locationValue.setHorizontalAlignment(javax.swing.JTextField.LEFT); |
539 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
480 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
Lines 543-561
Link Here
|
543 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; |
484 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; |
544 |
gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 0); |
485 |
gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 0); |
545 |
infoPanel.add(locationValue, gridBagConstraints); |
486 |
infoPanel.add(locationValue, gridBagConstraints); |
|
|
487 |
locationValue.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "ACS_CTL_LocationValue")); // NOI18N |
488 |
locationValue.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "ACS_CTL_LocationValue")); // NOI18N |
546 |
|
489 |
|
547 |
org.openide.awt.Mnemonics.setLocalizedText(browseButton, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "CTL_BrowseButton_o")); |
490 |
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() { |
491 |
browseButton.addActionListener(new java.awt.event.ActionListener() { |
549 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
492 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
550 |
browseLocation(evt); |
493 |
browseLocation(evt); |
551 |
} |
494 |
} |
552 |
}); |
495 |
}); |
553 |
|
|
|
554 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
496 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
555 |
gridBagConstraints.gridx = 2; |
497 |
gridBagConstraints.gridx = 2; |
556 |
gridBagConstraints.gridy = 1; |
498 |
gridBagConstraints.gridy = 1; |
557 |
gridBagConstraints.insets = new java.awt.Insets(6, 12, 6, 0); |
499 |
gridBagConstraints.insets = new java.awt.Insets(6, 12, 6, 0); |
558 |
infoPanel.add(browseButton, gridBagConstraints); |
500 |
infoPanel.add(browseButton, gridBagConstraints); |
|
|
501 |
browseButton.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "ACS_CTL_BrowseButton")); // NOI18N |
502 |
browseButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "ACS_CTL_BrowseButton")); // NOI18N |
559 |
|
503 |
|
560 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
504 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
561 |
gridBagConstraints.gridx = 1; |
505 |
gridBagConstraints.gridx = 1; |
Lines 570-585
Link Here
|
570 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
514 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
571 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; |
515 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; |
572 |
infoPanel.add(folderValue, gridBagConstraints); |
516 |
infoPanel.add(folderValue, gridBagConstraints); |
|
|
517 |
folderValue.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "ACS_CTL_FolderValue")); // NOI18N |
518 |
folderValue.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "ACS_CTL_FolderValue")); // NOI18N |
573 |
|
519 |
|
574 |
suitePlatform.setLabelFor(suitePlatformValue); |
520 |
suitePlatform.setLabelFor(suitePlatformValue); |
575 |
org.openide.awt.Mnemonics.setLocalizedText(suitePlatform, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_NetBeansPlatform")); |
521 |
org.openide.awt.Mnemonics.setLocalizedText(suitePlatform, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "LBL_NetBeansPlatform")); // NOI18N |
576 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
522 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
577 |
gridBagConstraints.gridx = 0; |
523 |
gridBagConstraints.gridx = 0; |
578 |
gridBagConstraints.gridy = 4; |
524 |
gridBagConstraints.gridy = 4; |
579 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; |
525 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; |
580 |
gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 12); |
526 |
gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 12); |
581 |
infoPanel.add(suitePlatform, gridBagConstraints); |
527 |
infoPanel.add(suitePlatform, gridBagConstraints); |
582 |
|
|
|
583 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
528 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
584 |
gridBagConstraints.gridx = 1; |
529 |
gridBagConstraints.gridx = 1; |
585 |
gridBagConstraints.gridy = 4; |
530 |
gridBagConstraints.gridy = 4; |
Lines 588-601
Link Here
|
588 |
gridBagConstraints.weightx = 1.0; |
533 |
gridBagConstraints.weightx = 1.0; |
589 |
gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 0); |
534 |
gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 0); |
590 |
infoPanel.add(suitePlatformValue, gridBagConstraints); |
535 |
infoPanel.add(suitePlatformValue, gridBagConstraints); |
|
|
536 |
suitePlatformValue.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "ACS_CTL_SuitePlatformValue")); // NOI18N |
537 |
suitePlatformValue.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "ACS_CTL_SuitePlatformValue")); // NOI18N |
591 |
|
538 |
|
592 |
org.openide.awt.Mnemonics.setLocalizedText(manageSuitePlatform, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "CTL_ManagePlatforms_g")); |
539 |
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() { |
540 |
manageSuitePlatform.addActionListener(new java.awt.event.ActionListener() { |
594 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
541 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
595 |
manageSuitePlatformActionPerformed(evt); |
542 |
manageSuitePlatformActionPerformed(evt); |
596 |
} |
543 |
} |
597 |
}); |
544 |
}); |
598 |
|
|
|
599 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
545 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
600 |
gridBagConstraints.gridx = 2; |
546 |
gridBagConstraints.gridx = 2; |
601 |
gridBagConstraints.gridy = 4; |
547 |
gridBagConstraints.gridy = 4; |
Lines 603-608
Link Here
|
603 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; |
549 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; |
604 |
gridBagConstraints.insets = new java.awt.Insets(6, 12, 6, 0); |
550 |
gridBagConstraints.insets = new java.awt.Insets(6, 12, 6, 0); |
605 |
infoPanel.add(manageSuitePlatform, gridBagConstraints); |
551 |
infoPanel.add(manageSuitePlatform, gridBagConstraints); |
|
|
552 |
manageSuitePlatform.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "ACS_CTL_ManageSuitePlatform")); // NOI18N |
553 |
manageSuitePlatform.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "ACS_CTL_ManageSuitePlatform")); // NOI18N |
606 |
|
554 |
|
607 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
555 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
608 |
gridBagConstraints.gridx = 0; |
556 |
gridBagConstraints.gridx = 0; |
Lines 621-763
Link Here
|
621 |
add(infoPanel, gridBagConstraints); |
569 |
add(infoPanel, gridBagConstraints); |
622 |
|
570 |
|
623 |
mainProject.setSelected(true); |
571 |
mainProject.setSelected(true); |
624 |
org.openide.awt.Mnemonics.setLocalizedText(mainProject, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "CTL_SetAsMainProject")); |
572 |
org.openide.awt.Mnemonics.setLocalizedText(mainProject, org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "CTL_SetAsMainProject")); // NOI18N |
625 |
mainProject.addActionListener(new java.awt.event.ActionListener() { |
573 |
mainProject.addActionListener(new java.awt.event.ActionListener() { |
626 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
574 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
627 |
mainProjectActionPerformed(evt); |
575 |
mainProjectActionPerformed(evt); |
628 |
} |
576 |
} |
629 |
}); |
577 |
}); |
630 |
|
|
|
631 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
578 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
632 |
gridBagConstraints.gridx = 0; |
579 |
gridBagConstraints.gridx = 0; |
633 |
gridBagConstraints.gridy = 2; |
580 |
gridBagConstraints.gridy = 2; |
634 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; |
581 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; |
635 |
gridBagConstraints.insets = new java.awt.Insets(12, 0, 0, 0); |
582 |
gridBagConstraints.insets = new java.awt.Insets(12, 0, 0, 0); |
636 |
add(mainProject, gridBagConstraints); |
583 |
add(mainProject, gridBagConstraints); |
637 |
|
584 |
mainProject.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "ACS_CTL_MainProject")); // NOI18N |
638 |
typeChooserPanel.setLayout(new java.awt.GridBagLayout()); |
585 |
mainProject.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "ACS_CTL_MainProject")); // NOI18N |
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 |
|
586 |
|
762 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
587 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
763 |
gridBagConstraints.gridx = 0; |
588 |
gridBagConstraints.gridx = 0; |
Lines 768-773
Link Here
|
768 |
gridBagConstraints.weighty = 1.0; |
593 |
gridBagConstraints.weighty = 1.0; |
769 |
add(pnlThouShaltBeholdLayout, gridBagConstraints); |
594 |
add(pnlThouShaltBeholdLayout, gridBagConstraints); |
770 |
|
595 |
|
|
|
596 |
typeChooserPanelContainer.setLayout(new java.awt.BorderLayout()); |
597 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
598 |
gridBagConstraints.gridx = 0; |
599 |
gridBagConstraints.gridy = 1; |
600 |
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; |
601 |
add(typeChooserPanelContainer, gridBagConstraints); |
602 |
|
603 |
getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "ACS_BasicInfoVisualPanel")); // NOI18N |
604 |
getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BasicInfoVisualPanel.class, "ACS_BasicInfoVisualPanel")); // NOI18N |
771 |
}// </editor-fold>//GEN-END:initComponents |
605 |
}// </editor-fold>//GEN-END:initComponents |
772 |
|
606 |
|
773 |
private void manageSuitePlatformActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_manageSuitePlatformActionPerformed |
607 |
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 |
611 |
private void mainProjectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mainProjectActionPerformed |
778 |
mainProjectTouched = true; |
612 |
mainProjectTouched = true; |
779 |
}//GEN-LAST:event_mainProjectActionPerformed |
613 |
}//GEN-LAST:event_mainProjectActionPerformed |
780 |
|
614 |
|
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) { |
615 |
private void managePlatform(final JComboBox platformCombo) { |
786 |
NbPlatformCustomizer.showCustomizer(); |
616 |
NbPlatformCustomizer.showCustomizer(); |
787 |
platformCombo.setModel(new PlatformComponentFactory.NbPlatformListModel()); // refresh |
617 |
platformCombo.setModel(new PlatformComponentFactory.NbPlatformListModel()); // refresh |
788 |
platformCombo.requestFocus(); |
618 |
platformCombo.requestFocus(); |
789 |
updateAndCheck(); |
619 |
updateAndCheck(); |
790 |
} |
620 |
} |
791 |
|
621 |
|
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 |
622 |
private void browseLocation(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseLocation |
848 |
JFileChooser chooser = new JFileChooser(getLocationValue()); |
623 |
JFileChooser chooser = new JFileChooser(getLocationValue()); |
849 |
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); |
624 |
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); |
Lines 855-862
Link Here
|
855 |
|
630 |
|
856 |
// Variables declaration - do not modify//GEN-BEGIN:variables |
631 |
// Variables declaration - do not modify//GEN-BEGIN:variables |
857 |
private javax.swing.JButton browseButton; |
632 |
private javax.swing.JButton browseButton; |
858 |
private javax.swing.JButton browseSuiteButton; |
|
|
859 |
private javax.swing.JLabel chooserFiller; |
860 |
private javax.swing.JLabel filler; |
633 |
private javax.swing.JLabel filler; |
861 |
private javax.swing.JLabel folderLbl; |
634 |
private javax.swing.JLabel folderLbl; |
862 |
private javax.swing.JTextField folderValue; |
635 |
private javax.swing.JTextField folderValue; |
Lines 864-885
Link Here
|
864 |
private javax.swing.JLabel locationLbl; |
637 |
private javax.swing.JLabel locationLbl; |
865 |
private javax.swing.JTextField locationValue; |
638 |
private javax.swing.JTextField locationValue; |
866 |
private javax.swing.JCheckBox mainProject; |
639 |
private javax.swing.JCheckBox mainProject; |
867 |
private javax.swing.JButton managePlatform; |
|
|
868 |
private javax.swing.JButton manageSuitePlatform; |
640 |
private javax.swing.JButton manageSuitePlatform; |
869 |
private javax.swing.JLabel moduleSuite; |
|
|
870 |
private javax.swing.JComboBox moduleSuiteValue; |
871 |
private javax.swing.ButtonGroup moduleTypeGroup; |
641 |
private javax.swing.ButtonGroup moduleTypeGroup; |
872 |
private javax.swing.JLabel nameLbl; |
642 |
private javax.swing.JLabel nameLbl; |
873 |
javax.swing.JTextField nameValue; |
643 |
javax.swing.JTextField nameValue; |
874 |
private javax.swing.JLabel platform; |
|
|
875 |
private javax.swing.JComboBox platformValue; |
876 |
private javax.swing.JPanel pnlThouShaltBeholdLayout; |
644 |
private javax.swing.JPanel pnlThouShaltBeholdLayout; |
877 |
private javax.swing.JSeparator separator3; |
645 |
private javax.swing.JSeparator separator3; |
878 |
private javax.swing.JRadioButton standAloneModule; |
|
|
879 |
private javax.swing.JRadioButton suiteComponent; |
880 |
private javax.swing.JLabel suitePlatform; |
646 |
private javax.swing.JLabel suitePlatform; |
881 |
private javax.swing.JComboBox suitePlatformValue; |
647 |
private javax.swing.JComboBox suitePlatformValue; |
882 |
private javax.swing.JPanel typeChooserPanel; |
648 |
private javax.swing.JPanel typeChooserPanelContainer; |
883 |
// End of variables declaration//GEN-END:variables |
649 |
// End of variables declaration//GEN-END:variables |
884 |
|
650 |
|
|
|
651 |
private TypeChooserPanelImpl typeChooserPanel; |
885 |
} |
652 |
} |