Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 213269 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/pde/internal/ui/wizards/plugin/NewProjectCreationPage.java (-98 lines)
Lines 11-26 Link Here
11
 *******************************************************************************/
11
 *******************************************************************************/
12
package org.eclipse.pde.internal.ui.wizards.plugin;
12
package org.eclipse.pde.internal.ui.wizards.plugin;
13
13
14
import java.util.TreeSet;
15
16
import org.eclipse.core.resources.IProject;
14
import org.eclipse.core.resources.IProject;
17
import org.eclipse.core.resources.IResource;
15
import org.eclipse.core.resources.IResource;
18
import org.eclipse.core.resources.IWorkspace;
16
import org.eclipse.core.resources.IWorkspace;
19
import org.eclipse.core.resources.ResourcesPlugin;
17
import org.eclipse.core.resources.ResourcesPlugin;
20
import org.eclipse.core.runtime.IStatus;
18
import org.eclipse.core.runtime.IStatus;
21
import org.eclipse.jdt.launching.IVMInstall;
22
import org.eclipse.jdt.launching.JavaRuntime;
23
import org.eclipse.jdt.launching.environments.IExecutionEnvironment;
24
import org.eclipse.jdt.ui.PreferenceConstants;
19
import org.eclipse.jdt.ui.PreferenceConstants;
25
import org.eclipse.jface.dialogs.Dialog;
20
import org.eclipse.jface.dialogs.Dialog;
26
import org.eclipse.jface.dialogs.IDialogSettings;
21
import org.eclipse.jface.dialogs.IDialogSettings;
Lines 31-37 Link Here
31
import org.eclipse.pde.internal.core.TargetPlatformHelper;
26
import org.eclipse.pde.internal.core.TargetPlatformHelper;
32
import org.eclipse.pde.internal.ui.IHelpContextIds;
27
import org.eclipse.pde.internal.ui.IHelpContextIds;
33
import org.eclipse.pde.internal.ui.PDEUIMessages;
28
import org.eclipse.pde.internal.ui.PDEUIMessages;
34
import org.eclipse.pde.internal.ui.launcher.VMHelper;
35
import org.eclipse.swt.SWT;
29
import org.eclipse.swt.SWT;
36
import org.eclipse.swt.events.ModifyEvent;
30
import org.eclipse.swt.events.ModifyEvent;
37
import org.eclipse.swt.events.ModifyListener;
31
import org.eclipse.swt.events.ModifyListener;
Lines 42-54 Link Here
42
import org.eclipse.swt.widgets.Button;
36
import org.eclipse.swt.widgets.Button;
43
import org.eclipse.swt.widgets.Combo;
37
import org.eclipse.swt.widgets.Combo;
44
import org.eclipse.swt.widgets.Composite;
38
import org.eclipse.swt.widgets.Composite;
45
import org.eclipse.swt.widgets.Event;
46
import org.eclipse.swt.widgets.Group;
39
import org.eclipse.swt.widgets.Group;
47
import org.eclipse.swt.widgets.Label;
40
import org.eclipse.swt.widgets.Label;
48
import org.eclipse.swt.widgets.Listener;
49
import org.eclipse.swt.widgets.Text;
41
import org.eclipse.swt.widgets.Text;
50
import org.eclipse.ui.PlatformUI;
42
import org.eclipse.ui.PlatformUI;
51
import org.eclipse.ui.dialogs.PreferencesUtil;
52
import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
43
import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
53
44
54
45
Lines 65-72 Link Here
65
	private Combo fOSGiCombo;
56
	private Combo fOSGiCombo;
66
	private Button fOSGIButton;
57
	private Button fOSGIButton;
67
	private IStructuredSelection fSelection;
58
	private IStructuredSelection fSelection;
68
	private Button fExeEnvButton;
69
	private Combo fEEChoice;
70
	
59
	
71
	private static final String S_OSGI_PROJECT = "osgiProject"; //$NON-NLS-1$
60
	private static final String S_OSGI_PROJECT = "osgiProject"; //$NON-NLS-1$
72
	private static final String S_TARGET_NAME = "targetName"; //$NON-NLS-1$
61
	private static final String S_TARGET_NAME = "targetName"; //$NON-NLS-1$
Lines 86-92 Link Here
86
75
87
		createProjectTypeGroup(control);
76
		createProjectTypeGroup(control);
88
		createFormatGroup(control);
77
		createFormatGroup(control);
89
		createExecutionEnvironmentGroup(control);
90
		createWorkingSetGroup(
78
		createWorkingSetGroup(
91
				control,
79
				control,
92
				fSelection,
80
				fSelection,
Lines 103-164 Link Here
103
		setControl(control);
91
		setControl(control);
104
	}
92
	}
105
	
93
	
106
	private void createExecutionEnvironmentGroup(Composite container) {
107
		Group group = new Group(container, SWT.NONE);
108
		group.setText(PDEUIMessages.NewProjectCreationPage_targetEnvironment);
109
		GridLayout layout = new GridLayout();
110
		layout.numColumns = 3;
111
		group.setLayout(layout);
112
		group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
113
		
114
		// Create label
115
		Label envs = new Label(group, SWT.NONE);	
116
		envs.setText(PDEUIMessages.NewProjectCreationPage_executionEnvironments_label);
117
118
		// Create combo
119
		fEEChoice = new Combo(group, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER);
120
		fEEChoice.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
121
		
122
		// Gather EEs 
123
		IExecutionEnvironment[] exeEnvs = VMHelper.getExecutionEnvironments();
124
		TreeSet availableEEs = new TreeSet();		
125
		for (int i = 0; i < exeEnvs.length; i++) {
126
			availableEEs.add(exeEnvs[i].getId());		
127
		}
128
		
129
		// Set data 
130
		fEEChoice.setItems((String[]) availableEEs.toArray(new String[availableEEs.size()-1]));
131
		
132
		// Set default EE based on strict match to default VM
133
		IVMInstall defaultVM = JavaRuntime.getDefaultVMInstall();
134
		String[] EEChoices = fEEChoice.getItems();
135
		for (int i = 0; i < EEChoices.length; i++) {			
136
			if(VMHelper.getExecutionEnvironment(EEChoices[i]).isStrictlyCompatible(defaultVM)) {
137
					fEEChoice.select(i);
138
					break;							
139
			}
140
		}
141
		
142
		fEEChoice.addSelectionListener(new SelectionAdapter(){
143
			public void widgetSelected(SelectionEvent e) {
144
				setPageComplete(validatePage());
145
			}
146
		});
147
		
148
		// Create button
149
		fExeEnvButton = createButton(group, SWT.PUSH, 1, 0);
150
		fExeEnvButton.setText(PDEUIMessages.NewProjectCreationPage_environmentsButton);		
151
		fExeEnvButton.addListener(SWT.Selection, new Listener() {
152
			public void handleEvent(Event event) {
153
				PreferencesUtil.createPreferenceDialogOn(
154
						getShell(), 
155
						"org.eclipse.jdt.debug.ui.jreProfiles", //$NON-NLS-1$
156
						new String[] { "org.eclipse.jdt.debug.ui.jreProfiles" }, null).open(); //$NON-NLS-1$ 
157
			}
158
		});
159
		updateExecEnvSection();
160
	}
161
	
162
	private void createProjectTypeGroup(Composite container) {
94
	private void createProjectTypeGroup(Composite container) {
163
		Group group = new Group(container, SWT.NONE);
95
		Group group = new Group(container, SWT.NONE);
164
		group.setText(PDEUIMessages.ProjectStructurePage_settings); 
96
		group.setText(PDEUIMessages.ProjectStructurePage_settings); 
Lines 177-183 Link Here
177
				fSourceText.setEnabled(enabled);
109
				fSourceText.setEnabled(enabled);
178
				fOutputlabel.setEnabled(enabled);
110
				fOutputlabel.setEnabled(enabled);
179
				fOutputText.setEnabled(enabled);
111
				fOutputText.setEnabled(enabled);
180
				updateExecEnvSection();
181
				setPageComplete(validatePage());
112
				setPageComplete(validatePage());
182
			}
113
			}
183
		});
114
		});
Lines 234-245 Link Here
234
			else
165
			else
235
				fTargetCombo.setText(ICoreConstants.TARGET33);
166
				fTargetCombo.setText(ICoreConstants.TARGET33);
236
		}
167
		}
237
		fTargetCombo.addSelectionListener(new SelectionAdapter(){
238
			public void widgetSelected(SelectionEvent e) {
239
				updateExecEnvSection();
240
				setPageComplete(validatePage());
241
			}
242
		});
243
		
168
		
244
	    fOSGIButton = createButton(group, SWT.RADIO, 1, 30);
169
	    fOSGIButton = createButton(group, SWT.RADIO, 1, 30);
245
    	fOSGIButton.setText(PDEUIMessages.NewProjectCreationPage_pPureOSGi); 	   
170
    	fOSGIButton.setText(PDEUIMessages.NewProjectCreationPage_pPureOSGi); 	   
Lines 259-274 Link Here
259
		
184
		
260
	}
185
	}
261
	
186
	
262
	private void updateExecEnvSection() {
263
		if (fTargetCombo.getText().equals(ICoreConstants.TARGET30) || !fJavaButton.getSelection()){
264
			fEEChoice.setEnabled(false);
265
			fExeEnvButton.setEnabled(false);
266
		} else {
267
			fEEChoice.setEnabled(true);
268
			fExeEnvButton.setEnabled(true);
269
		}
270
	}
271
	
272
	private void updateRuntimeDependency() {
187
	private void updateRuntimeDependency() {
273
		boolean depends = fEclipseButton.getSelection();
188
		boolean depends = fEclipseButton.getSelection();
274
		fTargetCombo.setEnabled(depends);
189
		fTargetCombo.setEnabled(depends);
Lines 315-322 Link Here
315
		fData.setHasBundleStructure(fOSGIButton.getSelection() || Double.parseDouble(fTargetCombo.getText()) >= 3.1);	
230
		fData.setHasBundleStructure(fOSGIButton.getSelection() || Double.parseDouble(fTargetCombo.getText()) >= 3.1);	
316
		fData.setOSGiFramework(fOSGIButton.getSelection() ? fOSGiCombo.getText() : null);
231
		fData.setOSGiFramework(fOSGIButton.getSelection() ? fOSGiCombo.getText() : null);
317
		fData.setWorkingSets(getSelectedWorkingSets());
232
		fData.setWorkingSets(getSelectedWorkingSets());
318
		if(fJavaButton.getSelection())
319
			fData.setExecutionEnvironment(fEEChoice.getText().trim());
320
	}
233
	}
321
	
234
	
322
    protected boolean validatePage() {
235
    protected boolean validatePage() {
Lines 335-350 Link Here
335
    		return false;
248
    		return false;
336
    	}
249
    	}
337
    	
250
    	
338
    	String eeid = fEEChoice.getText();
339
    	if(eeid != null && fEEChoice.isEnabled()) {
340
    		IExecutionEnvironment ee = VMHelper.getExecutionEnvironment(eeid);
341
    		IVMInstall[] vms = ee.getCompatibleVMs();
342
    		if(vms.length == 0) {
343
    			setErrorMessage(PDEUIMessages.NewProjectCreationPage_invalidEE);
344
    			return false;
345
    		}
346
    	}
347
    	
348
    	if (fJavaButton.getSelection()) {
251
    	if (fJavaButton.getSelection()) {
349
	    	IWorkspace workspace = ResourcesPlugin.getWorkspace();
252
	    	IWorkspace workspace = ResourcesPlugin.getWorkspace();
350
	    	IProject dmy = workspace.getRoot().getProject("project"); //$NON-NLS-1$
253
	    	IProject dmy = workspace.getRoot().getProject("project"); //$NON-NLS-1$
Lines 364-370 Link Here
364
	    		}
267
	    		}
365
	    	}
268
	    	}
366
    	}
269
    	}
367
    	
368
    	setErrorMessage(null);
270
    	setErrorMessage(null);
369
    	setMessage(null);
271
    	setMessage(null);
370
    	return true;
272
    	return true;
(-)src/org/eclipse/pde/internal/ui/wizards/plugin/NewProjectCreationOperation.java (-5 / +3 lines)
Lines 408-422 Link Here
408
		monitor.done();
408
		monitor.done();
409
	}
409
	}
410
410
411
	private IClasspathEntry[] getClassPathEntries(IJavaProject project,
411
	private IClasspathEntry[] getClassPathEntries(IJavaProject project, IFieldData data) {
412
			IFieldData data) {
412
		IClasspathEntry[] internalClassPathEntries = getInternalClassPathEntries(project, data);
413
		IClasspathEntry[] internalClassPathEntries = getInternalClassPathEntries(
414
				project, data);
415
		IClasspathEntry[] entries = new IClasspathEntry[internalClassPathEntries.length + 2];
413
		IClasspathEntry[] entries = new IClasspathEntry[internalClassPathEntries.length + 2];
416
		System.arraycopy(internalClassPathEntries, 0, entries, 0, internalClassPathEntries.length);
414
		System.arraycopy(internalClassPathEntries, 0, entries, 0, internalClassPathEntries.length);
417
415
418
		// Set EE of new project
416
		// Set EE of new project
419
		String executionEnvironment = ""; //$NON-NLS-1$
417
		String executionEnvironment = null; //$NON-NLS-1$
420
		if(data instanceof AbstractFieldData) {
418
		if(data instanceof AbstractFieldData) {
421
			executionEnvironment = ((AbstractFieldData) data).getExecutionEnvironment();
419
			executionEnvironment = ((AbstractFieldData) data).getExecutionEnvironment();
422
		}
420
		}
(-)src/org/eclipse/pde/internal/ui/wizards/plugin/ContentPage.java (+9 lines)
Lines 71-76 Link Here
71
		return text;
71
		return text;
72
	}
72
	}
73
	
73
	
74
	protected Text createText(Composite parent, ModifyListener listener, int horizSpan){
75
		Text text = new Text(parent, SWT.BORDER | SWT.SINGLE);
76
		GridData data = new GridData(GridData.FILL_HORIZONTAL);
77
		data.horizontalSpan = horizSpan;
78
		text.setLayoutData(data);
79
		text.addModifyListener(listener);
80
		return text;
81
	}
82
	
74
	protected abstract void validatePage();
83
	protected abstract void validatePage();
75
84
76
	protected String validateProperties() {
85
	protected String validateProperties() {
(-)src/org/eclipse/pde/internal/ui/wizards/plugin/PluginContentPage.java (-7 / +95 lines)
Lines 12-20 Link Here
12
package org.eclipse.pde.internal.ui.wizards.plugin;
12
package org.eclipse.pde.internal.ui.wizards.plugin;
13
13
14
import java.util.Locale;
14
import java.util.Locale;
15
import java.util.TreeSet;
15
16
16
import org.eclipse.core.runtime.IStatus;
17
import org.eclipse.core.runtime.IStatus;
17
import org.eclipse.jdt.core.JavaConventions;
18
import org.eclipse.jdt.core.JavaConventions;
19
import org.eclipse.jdt.launching.IVMInstall;
20
import org.eclipse.jdt.launching.JavaRuntime;
21
import org.eclipse.jdt.launching.environments.IExecutionEnvironment;
18
import org.eclipse.jface.dialogs.Dialog;
22
import org.eclipse.jface.dialogs.Dialog;
19
import org.eclipse.jface.dialogs.IDialogSettings;
23
import org.eclipse.jface.dialogs.IDialogSettings;
20
import org.eclipse.jface.dialogs.IMessageProvider;
24
import org.eclipse.jface.dialogs.IMessageProvider;
Lines 22-27 Link Here
22
import org.eclipse.pde.internal.core.util.PDEJavaHelper;
26
import org.eclipse.pde.internal.core.util.PDEJavaHelper;
23
import org.eclipse.pde.internal.ui.IHelpContextIds;
27
import org.eclipse.pde.internal.ui.IHelpContextIds;
24
import org.eclipse.pde.internal.ui.PDEUIMessages;
28
import org.eclipse.pde.internal.ui.PDEUIMessages;
29
import org.eclipse.pde.internal.ui.launcher.VMHelper;
25
import org.eclipse.pde.internal.ui.wizards.IProjectProvider;
30
import org.eclipse.pde.internal.ui.wizards.IProjectProvider;
26
import org.eclipse.swt.SWT;
31
import org.eclipse.swt.SWT;
27
import org.eclipse.swt.events.ModifyEvent;
32
import org.eclipse.swt.events.ModifyEvent;
Lines 31-41 Link Here
31
import org.eclipse.swt.layout.GridData;
36
import org.eclipse.swt.layout.GridData;
32
import org.eclipse.swt.layout.GridLayout;
37
import org.eclipse.swt.layout.GridLayout;
33
import org.eclipse.swt.widgets.Button;
38
import org.eclipse.swt.widgets.Button;
39
import org.eclipse.swt.widgets.Combo;
34
import org.eclipse.swt.widgets.Composite;
40
import org.eclipse.swt.widgets.Composite;
41
import org.eclipse.swt.widgets.Event;
35
import org.eclipse.swt.widgets.Group;
42
import org.eclipse.swt.widgets.Group;
36
import org.eclipse.swt.widgets.Label;
43
import org.eclipse.swt.widgets.Label;
44
import org.eclipse.swt.widgets.Listener;
37
import org.eclipse.swt.widgets.Text;
45
import org.eclipse.swt.widgets.Text;
38
import org.eclipse.ui.PlatformUI;
46
import org.eclipse.ui.PlatformUI;
47
import org.eclipse.ui.dialogs.PreferencesUtil;
39
48
40
public class PluginContentPage extends ContentPage {
49
public class PluginContentPage extends ContentPage {
41
	protected final static int P_CLASS_GROUP = 2;
50
	protected final static int P_CLASS_GROUP = 2;
Lines 44-49 Link Here
44
	private Button fGenerateClass;
53
	private Button fGenerateClass;
45
	private Button fUIPlugin;
54
	private Button fUIPlugin;
46
	private Label fClassLabel;
55
	private Label fClassLabel;
56
	private Label fEELabel;
57
	private Button fExeEnvButton;
58
	private Combo fEEChoice;
47
59
48
	private Label fLabel;
60
	private Label fLabel;
49
    private Button fYesButton;
61
    private Button fYesButton;
Lines 53-58 Link Here
53
    private final static String S_UI_PLUGIN = "uiPlugin"; //$NON-NLS-1$
65
    private final static String S_UI_PLUGIN = "uiPlugin"; //$NON-NLS-1$
54
    private final static String S_RCP_PLUGIN = "rcpPlugin"; //$NON-NLS-1$
66
    private final static String S_RCP_PLUGIN = "rcpPlugin"; //$NON-NLS-1$
55
    
67
    
68
    private final static String NO_EXECUTION_ENVIRONMENT = "<No Execution Environment>";
69
    
56
	private ModifyListener classListener = new ModifyListener() {
70
	private ModifyListener classListener = new ModifyListener() {
57
		public void modifyText(ModifyEvent e) {
71
		public void modifyText(ModifyEvent e) {
58
			if (fInitialized)
72
			if (fInitialized)
Lines 88-116 Link Here
88
102
89
	private void createPluginPropertiesGroup(Composite container) {
103
	private void createPluginPropertiesGroup(Composite container) {
90
		Group propertiesGroup = new Group(container, SWT.NONE);
104
		Group propertiesGroup = new Group(container, SWT.NONE);
91
		propertiesGroup.setLayout(new GridLayout(2, false));
105
		propertiesGroup.setLayout(new GridLayout(3, false));
92
		propertiesGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
106
		propertiesGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
93
		propertiesGroup.setText(PDEUIMessages.ContentPage_pGroup); 
107
		propertiesGroup.setText(PDEUIMessages.ContentPage_pGroup); 
94
108
95
		Label label = new Label(propertiesGroup, SWT.NONE);
109
		Label label = new Label(propertiesGroup, SWT.NONE);
96
		label.setText(PDEUIMessages.ContentPage_pid); 
110
		label.setText(PDEUIMessages.ContentPage_pid); 
97
		fIdText = createText(propertiesGroup, propertiesListener);
111
		fIdText = createText(propertiesGroup, propertiesListener, 2);
98
112
99
		label = new Label(propertiesGroup, SWT.NONE);
113
		label = new Label(propertiesGroup, SWT.NONE);
100
		label.setText(PDEUIMessages.ContentPage_pversion); 
114
		label.setText(PDEUIMessages.ContentPage_pversion); 
101
		fVersionText = createText(propertiesGroup, propertiesListener);
115
		fVersionText = createText(propertiesGroup, propertiesListener, 2);
102
116
103
		label = new Label(propertiesGroup, SWT.NONE);
117
		label = new Label(propertiesGroup, SWT.NONE);
104
		label.setText(PDEUIMessages.ContentPage_pname); 
118
		label.setText(PDEUIMessages.ContentPage_pname); 
105
		fNameText = createText(propertiesGroup, propertiesListener);
119
		fNameText = createText(propertiesGroup, propertiesListener, 2);
106
120
107
		label = new Label(propertiesGroup, SWT.NONE);
121
		label = new Label(propertiesGroup, SWT.NONE);
108
		label.setText(PDEUIMessages.ContentPage_pprovider); 
122
		label.setText(PDEUIMessages.ContentPage_pprovider); 
109
		fProviderText = createText(propertiesGroup, propertiesListener);
123
		fProviderText = createText(propertiesGroup, propertiesListener, 2);
110
124
111
		fLibraryLabel = new Label(propertiesGroup, SWT.NONE);
125
		fLibraryLabel = new Label(propertiesGroup, SWT.NONE);
112
		fLibraryLabel.setText(PDEUIMessages.ProjectStructurePage_library); 
126
		fLibraryLabel.setText(PDEUIMessages.ProjectStructurePage_library); 
113
		fLibraryText = createText(propertiesGroup, propertiesListener);
127
		fLibraryText = createText(propertiesGroup, propertiesListener, 2);
128
		
129
		createExecutionEnvironmentControls(propertiesGroup);
130
	}
131
	
132
	private void createExecutionEnvironmentControls(Composite container) {
133
		// Create label
134
		fEELabel = new Label(container, SWT.NONE);	
135
		fEELabel.setText(PDEUIMessages.NewProjectCreationPage_executionEnvironments_label);
136
137
		// Create combo
138
		fEEChoice = new Combo(container, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER);
139
		fEEChoice.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
140
		
141
		// Gather EEs 
142
		IExecutionEnvironment[] exeEnvs = VMHelper.getExecutionEnvironments();
143
		TreeSet availableEEs = new TreeSet();		
144
		for (int i = 0; i < exeEnvs.length; i++) {
145
			availableEEs.add(exeEnvs[i].getId());		
146
		}
147
		availableEEs.add(NO_EXECUTION_ENVIRONMENT);
148
		
149
		// Set data 
150
		fEEChoice.setItems((String[]) availableEEs.toArray(new String[availableEEs.size()-1]));
151
		fEEChoice.addSelectionListener(new SelectionAdapter(){
152
			public void widgetSelected(SelectionEvent e) {
153
				validatePage();
154
			}
155
		});
156
		
157
		// Set default EE based on strict match to default VM
158
		IVMInstall defaultVM = JavaRuntime.getDefaultVMInstall();
159
		String[] EEChoices = fEEChoice.getItems();
160
		for (int i = 0; i < EEChoices.length; i++) {
161
			if (!EEChoices[i].equals(NO_EXECUTION_ENVIRONMENT)){
162
				if(VMHelper.getExecutionEnvironment(EEChoices[i]).isStrictlyCompatible(defaultVM)) {
163
						fEEChoice.select(i);
164
						break;							
165
				}
166
			}
167
		}
168
		
169
		// Create button
170
		fExeEnvButton = new Button(container, SWT.PUSH);
171
		fExeEnvButton.setLayoutData(new GridData());
172
		fExeEnvButton.setText(PDEUIMessages.NewProjectCreationPage_environmentsButton);		
173
		fExeEnvButton.addListener(SWT.Selection, new Listener() {
174
			public void handleEvent(Event event) {
175
				PreferencesUtil.createPreferenceDialogOn(
176
						getShell(), 
177
						"org.eclipse.jdt.debug.ui.jreProfiles", //$NON-NLS-1$
178
						new String[] { "org.eclipse.jdt.debug.ui.jreProfiles" }, null).open(); //$NON-NLS-1$ 
179
			}
180
		});
114
	}
181
	}
115
182
116
	private void createPluginClassGroup(Composite container) {
183
	private void createPluginClassGroup(Composite container) {
Lines 166-171 Link Here
166
		data.setUIPlugin(fUIPlugin.getSelection());
233
		data.setUIPlugin(fUIPlugin.getSelection());
167
		data.setDoGenerateClass(fGenerateClass.isEnabled() && fGenerateClass.getSelection());
234
		data.setDoGenerateClass(fGenerateClass.isEnabled() && fGenerateClass.getSelection());
168
		data.setRCPApplicationPlugin(!fData.isSimple() && !isPureOSGi() && fYesButton.getSelection());
235
		data.setRCPApplicationPlugin(!fData.isSimple() && !isPureOSGi() && fYesButton.getSelection());
236
		if(fEEChoice.isEnabled() && !fEEChoice.getText().equals(NO_EXECUTION_ENVIRONMENT)) {
237
			fData.setExecutionEnvironment(fEEChoice.getText().trim());
238
		} else {
239
			fData.setExecutionEnvironment(null);
240
		}
169
	}
241
	}
170
	
242
	
171
	private void createRCPGroup(Composite container){
243
	private void createRCPGroup(Composite container){
Lines 239-245 Link Here
239
				int oldfChanged = fChangedGroups;
311
				int oldfChanged = fChangedGroups;
240
				fClassText.setText(computeId().toLowerCase(Locale.ENGLISH) + ".Activator"); //$NON-NLS-1$
312
				fClassText.setText(computeId().toLowerCase(Locale.ENGLISH) + ".Activator"); //$NON-NLS-1$
241
				fChangedGroups = oldfChanged;
313
				fChangedGroups = oldfChanged;
242
			}		
314
			}	
315
			
316
			boolean allowEESelection = !fData.isSimple() && fData.hasBundleStructure();
317
			fEELabel.setEnabled(allowEESelection);
318
			fEEChoice.setEnabled(allowEESelection);
319
			fExeEnvButton.setEnabled(allowEESelection);
320
			
243
			fRCPGroup.setVisible(!fData.isSimple() && !isPureOSGi());
321
			fRCPGroup.setVisible(!fData.isSimple() && !isPureOSGi());
244
    	}
322
    	}
245
        super.setVisible(visible);
323
        super.setVisible(visible);
Lines 265-270 Link Here
265
				setMessage(status.getMessage(), IMessageProvider.WARNING);
343
				setMessage(status.getMessage(), IMessageProvider.WARNING);
266
			}
344
			}
267
		}
345
		}
346
		if (errorMessage == null){
347
			String eeid = fEEChoice.getText();
348
	    	if(eeid != null && fEEChoice.isEnabled()) {
349
	    		IExecutionEnvironment ee = VMHelper.getExecutionEnvironment(eeid);
350
	    		IVMInstall[] vms = ee.getCompatibleVMs();
351
	    		if(vms.length == 0) {
352
	    			errorMessage = PDEUIMessages.NewProjectCreationPage_invalidEE;
353
	    		}
354
	    	}
355
		}
268
		setErrorMessage(errorMessage);
356
		setErrorMessage(errorMessage);
269
		setPageComplete(errorMessage == null);
357
		setPageComplete(errorMessage == null);
270
	}
358
	}
(-)src/org/eclipse/pde/internal/ui/pderesources.properties (-1 lines)
Lines 770-776 Link Here
770
NewProjectCreationPage_pDependsOnRuntime=&Eclipse version:
770
NewProjectCreationPage_pDependsOnRuntime=&Eclipse version:
771
NewProjectCreationPage_environmentsButton=En&vironments...
771
NewProjectCreationPage_environmentsButton=En&vironments...
772
NewProjectCreationPage_executionEnvironments_label=E&xecution Environment:
772
NewProjectCreationPage_executionEnvironments_label=E&xecution Environment:
773
NewProjectCreationPage_targetEnvironment=Target Environment
774
NewProjectCreationPage_invalidProjectName=Project name cannot contain %
773
NewProjectCreationPage_invalidProjectName=Project name cannot contain %
775
NewProjectCreationPage_invalidLocationPath=Location path cannot contain %
774
NewProjectCreationPage_invalidLocationPath=Location path cannot contain %
776
NewProjectCreationPage_invalidEE=Execution Environment isn't compatible with any installed JRE
775
NewProjectCreationPage_invalidEE=Execution Environment isn't compatible with any installed JRE
(-)src/org/eclipse/pde/internal/ui/PDEUIMessages.java (-3 lines)
Lines 2422-2430 Link Here
2422
	
2422
	
2423
	public static String NewProjectCreationPage_environmentsButton;
2423
	public static String NewProjectCreationPage_environmentsButton;
2424
	
2424
	
2425
	public static String NewProjectCreationPage_targetEnvironment;
2426
	
2427
2428
	public static String RequiredExecutionEnvironmentSection_title;
2425
	public static String RequiredExecutionEnvironmentSection_title;
2429
2426
2430
	public static String PluginGeneralInfoSection_lazyStart;
2427
	public static String PluginGeneralInfoSection_lazyStart;

Return to bug 213269