Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 86000 Details for
Bug 213269
New Plug-in Project wizard is humongous
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Updated patch
213269NewPluginWizardIsHumongous.patch (text/plain), 19.36 KB, created by
Curtis Windatt
on 2008-01-02 12:43:18 EST
(
hide
)
Description:
Updated patch
Filename:
MIME Type:
Creator:
Curtis Windatt
Created:
2008-01-02 12:43:18 EST
Size:
19.36 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.ui >Index: src/org/eclipse/pde/internal/ui/wizards/plugin/NewProjectCreationPage.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewProjectCreationPage.java,v >retrieving revision 1.43 >diff -u -r1.43 NewProjectCreationPage.java >--- src/org/eclipse/pde/internal/ui/wizards/plugin/NewProjectCreationPage.java 28 Dec 2007 00:16:50 -0000 1.43 >+++ src/org/eclipse/pde/internal/ui/wizards/plugin/NewProjectCreationPage.java 2 Jan 2008 17:42:48 -0000 >@@ -11,16 +11,11 @@ > *******************************************************************************/ > package org.eclipse.pde.internal.ui.wizards.plugin; > >-import java.util.TreeSet; >- > import org.eclipse.core.resources.IProject; > import org.eclipse.core.resources.IResource; > import org.eclipse.core.resources.IWorkspace; > import org.eclipse.core.resources.ResourcesPlugin; > import org.eclipse.core.runtime.IStatus; >-import org.eclipse.jdt.launching.IVMInstall; >-import org.eclipse.jdt.launching.JavaRuntime; >-import org.eclipse.jdt.launching.environments.IExecutionEnvironment; > import org.eclipse.jdt.ui.PreferenceConstants; > import org.eclipse.jface.dialogs.Dialog; > import org.eclipse.jface.dialogs.IDialogSettings; >@@ -31,7 +26,6 @@ > import org.eclipse.pde.internal.core.TargetPlatformHelper; > import org.eclipse.pde.internal.ui.IHelpContextIds; > import org.eclipse.pde.internal.ui.PDEUIMessages; >-import org.eclipse.pde.internal.ui.launcher.VMHelper; > import org.eclipse.swt.SWT; > import org.eclipse.swt.events.ModifyEvent; > import org.eclipse.swt.events.ModifyListener; >@@ -42,13 +36,10 @@ > import org.eclipse.swt.widgets.Button; > import org.eclipse.swt.widgets.Combo; > import org.eclipse.swt.widgets.Composite; >-import org.eclipse.swt.widgets.Event; > import org.eclipse.swt.widgets.Group; > import org.eclipse.swt.widgets.Label; >-import org.eclipse.swt.widgets.Listener; > import org.eclipse.swt.widgets.Text; > import org.eclipse.ui.PlatformUI; >-import org.eclipse.ui.dialogs.PreferencesUtil; > import org.eclipse.ui.dialogs.WizardNewProjectCreationPage; > > >@@ -65,8 +56,6 @@ > private Combo fOSGiCombo; > private Button fOSGIButton; > private IStructuredSelection fSelection; >- private Button fExeEnvButton; >- private Combo fEEChoice; > > private static final String S_OSGI_PROJECT = "osgiProject"; //$NON-NLS-1$ > private static final String S_TARGET_NAME = "targetName"; //$NON-NLS-1$ >@@ -86,7 +75,6 @@ > > createProjectTypeGroup(control); > createFormatGroup(control); >- createExecutionEnvironmentGroup(control); > createWorkingSetGroup( > control, > fSelection, >@@ -103,62 +91,6 @@ > setControl(control); > } > >- private void createExecutionEnvironmentGroup(Composite container) { >- Group group = new Group(container, SWT.NONE); >- group.setText(PDEUIMessages.NewProjectCreationPage_targetEnvironment); >- GridLayout layout = new GridLayout(); >- layout.numColumns = 3; >- group.setLayout(layout); >- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >- >- // Create label >- Label envs = new Label(group, SWT.NONE); >- envs.setText(PDEUIMessages.NewProjectCreationPage_executionEnvironments_label); >- >- // Create combo >- fEEChoice = new Combo(group, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER); >- fEEChoice.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >- >- // Gather EEs >- IExecutionEnvironment[] exeEnvs = VMHelper.getExecutionEnvironments(); >- TreeSet availableEEs = new TreeSet(); >- for (int i = 0; i < exeEnvs.length; i++) { >- availableEEs.add(exeEnvs[i].getId()); >- } >- >- // Set data >- fEEChoice.setItems((String[]) availableEEs.toArray(new String[availableEEs.size()-1])); >- >- // Set default EE based on strict match to default VM >- IVMInstall defaultVM = JavaRuntime.getDefaultVMInstall(); >- String[] EEChoices = fEEChoice.getItems(); >- for (int i = 0; i < EEChoices.length; i++) { >- if(VMHelper.getExecutionEnvironment(EEChoices[i]).isStrictlyCompatible(defaultVM)) { >- fEEChoice.select(i); >- break; >- } >- } >- >- fEEChoice.addSelectionListener(new SelectionAdapter(){ >- public void widgetSelected(SelectionEvent e) { >- setPageComplete(validatePage()); >- } >- }); >- >- // Create button >- fExeEnvButton = createButton(group, SWT.PUSH, 1, 0); >- fExeEnvButton.setText(PDEUIMessages.NewProjectCreationPage_environmentsButton); >- fExeEnvButton.addListener(SWT.Selection, new Listener() { >- public void handleEvent(Event event) { >- PreferencesUtil.createPreferenceDialogOn( >- getShell(), >- "org.eclipse.jdt.debug.ui.jreProfiles", //$NON-NLS-1$ >- new String[] { "org.eclipse.jdt.debug.ui.jreProfiles" }, null).open(); //$NON-NLS-1$ >- } >- }); >- updateExecEnvSection(); >- } >- > private void createProjectTypeGroup(Composite container) { > Group group = new Group(container, SWT.NONE); > group.setText(PDEUIMessages.ProjectStructurePage_settings); >@@ -177,7 +109,6 @@ > fSourceText.setEnabled(enabled); > fOutputlabel.setEnabled(enabled); > fOutputText.setEnabled(enabled); >- updateExecEnvSection(); > setPageComplete(validatePage()); > } > }); >@@ -234,12 +165,6 @@ > else > fTargetCombo.setText(ICoreConstants.TARGET33); > } >- fTargetCombo.addSelectionListener(new SelectionAdapter(){ >- public void widgetSelected(SelectionEvent e) { >- updateExecEnvSection(); >- setPageComplete(validatePage()); >- } >- }); > > fOSGIButton = createButton(group, SWT.RADIO, 1, 30); > fOSGIButton.setText(PDEUIMessages.NewProjectCreationPage_pPureOSGi); >@@ -259,16 +184,6 @@ > > } > >- private void updateExecEnvSection() { >- if (fTargetCombo.getText().equals(ICoreConstants.TARGET30) || !fJavaButton.getSelection()){ >- fEEChoice.setEnabled(false); >- fExeEnvButton.setEnabled(false); >- } else { >- fEEChoice.setEnabled(true); >- fExeEnvButton.setEnabled(true); >- } >- } >- > private void updateRuntimeDependency() { > boolean depends = fEclipseButton.getSelection(); > fTargetCombo.setEnabled(depends); >@@ -315,8 +230,6 @@ > fData.setHasBundleStructure(fOSGIButton.getSelection() || Double.parseDouble(fTargetCombo.getText()) >= 3.1); > fData.setOSGiFramework(fOSGIButton.getSelection() ? fOSGiCombo.getText() : null); > fData.setWorkingSets(getSelectedWorkingSets()); >- if(fJavaButton.getSelection()) >- fData.setExecutionEnvironment(fEEChoice.getText().trim()); > } > > protected boolean validatePage() { >@@ -335,16 +248,6 @@ > return false; > } > >- String eeid = fEEChoice.getText(); >- if(eeid != null && fEEChoice.isEnabled()) { >- IExecutionEnvironment ee = VMHelper.getExecutionEnvironment(eeid); >- IVMInstall[] vms = ee.getCompatibleVMs(); >- if(vms.length == 0) { >- setErrorMessage(PDEUIMessages.NewProjectCreationPage_invalidEE); >- return false; >- } >- } >- > if (fJavaButton.getSelection()) { > IWorkspace workspace = ResourcesPlugin.getWorkspace(); > IProject dmy = workspace.getRoot().getProject("project"); //$NON-NLS-1$ >@@ -364,7 +267,6 @@ > } > } > } >- > setErrorMessage(null); > setMessage(null); > return true; >Index: src/org/eclipse/pde/internal/ui/wizards/plugin/NewProjectCreationOperation.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewProjectCreationOperation.java,v >retrieving revision 1.86 >diff -u -r1.86 NewProjectCreationOperation.java >--- src/org/eclipse/pde/internal/ui/wizards/plugin/NewProjectCreationOperation.java 5 Nov 2007 22:47:32 -0000 1.86 >+++ src/org/eclipse/pde/internal/ui/wizards/plugin/NewProjectCreationOperation.java 2 Jan 2008 17:42:48 -0000 >@@ -408,15 +408,13 @@ > monitor.done(); > } > >- private IClasspathEntry[] getClassPathEntries(IJavaProject project, >- IFieldData data) { >- IClasspathEntry[] internalClassPathEntries = getInternalClassPathEntries( >- project, data); >+ private IClasspathEntry[] getClassPathEntries(IJavaProject project, IFieldData data) { >+ IClasspathEntry[] internalClassPathEntries = getInternalClassPathEntries(project, data); > IClasspathEntry[] entries = new IClasspathEntry[internalClassPathEntries.length + 2]; > System.arraycopy(internalClassPathEntries, 0, entries, 0, internalClassPathEntries.length); > > // Set EE of new project >- String executionEnvironment = ""; //$NON-NLS-1$ >+ String executionEnvironment = null; //$NON-NLS-1$ > if(data instanceof AbstractFieldData) { > executionEnvironment = ((AbstractFieldData) data).getExecutionEnvironment(); > } >Index: src/org/eclipse/pde/internal/ui/wizards/plugin/ContentPage.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/ContentPage.java,v >retrieving revision 1.38 >diff -u -r1.38 ContentPage.java >--- src/org/eclipse/pde/internal/ui/wizards/plugin/ContentPage.java 8 Jun 2007 16:37:10 -0000 1.38 >+++ src/org/eclipse/pde/internal/ui/wizards/plugin/ContentPage.java 2 Jan 2008 17:42:48 -0000 >@@ -71,6 +71,15 @@ > return text; > } > >+ protected Text createText(Composite parent, ModifyListener listener, int horizSpan){ >+ Text text = new Text(parent, SWT.BORDER | SWT.SINGLE); >+ GridData data = new GridData(GridData.FILL_HORIZONTAL); >+ data.horizontalSpan = horizSpan; >+ text.setLayoutData(data); >+ text.addModifyListener(listener); >+ return text; >+ } >+ > protected abstract void validatePage(); > > protected String validateProperties() { >Index: src/org/eclipse/pde/internal/ui/wizards/plugin/PluginContentPage.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/PluginContentPage.java,v >retrieving revision 1.35 >diff -u -r1.35 PluginContentPage.java >--- src/org/eclipse/pde/internal/ui/wizards/plugin/PluginContentPage.java 16 May 2007 22:05:17 -0000 1.35 >+++ src/org/eclipse/pde/internal/ui/wizards/plugin/PluginContentPage.java 2 Jan 2008 17:42:48 -0000 >@@ -12,9 +12,13 @@ > package org.eclipse.pde.internal.ui.wizards.plugin; > > import java.util.Locale; >+import java.util.TreeSet; > > import org.eclipse.core.runtime.IStatus; > import org.eclipse.jdt.core.JavaConventions; >+import org.eclipse.jdt.launching.IVMInstall; >+import org.eclipse.jdt.launching.JavaRuntime; >+import org.eclipse.jdt.launching.environments.IExecutionEnvironment; > import org.eclipse.jface.dialogs.Dialog; > import org.eclipse.jface.dialogs.IDialogSettings; > import org.eclipse.jface.dialogs.IMessageProvider; >@@ -22,6 +26,7 @@ > import org.eclipse.pde.internal.core.util.PDEJavaHelper; > import org.eclipse.pde.internal.ui.IHelpContextIds; > import org.eclipse.pde.internal.ui.PDEUIMessages; >+import org.eclipse.pde.internal.ui.launcher.VMHelper; > import org.eclipse.pde.internal.ui.wizards.IProjectProvider; > import org.eclipse.swt.SWT; > import org.eclipse.swt.events.ModifyEvent; >@@ -31,11 +36,15 @@ > import org.eclipse.swt.layout.GridData; > import org.eclipse.swt.layout.GridLayout; > import org.eclipse.swt.widgets.Button; >+import org.eclipse.swt.widgets.Combo; > import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Event; > import org.eclipse.swt.widgets.Group; > import org.eclipse.swt.widgets.Label; >+import org.eclipse.swt.widgets.Listener; > import org.eclipse.swt.widgets.Text; > import org.eclipse.ui.PlatformUI; >+import org.eclipse.ui.dialogs.PreferencesUtil; > > public class PluginContentPage extends ContentPage { > protected final static int P_CLASS_GROUP = 2; >@@ -44,6 +53,9 @@ > private Button fGenerateClass; > private Button fUIPlugin; > private Label fClassLabel; >+ private Label fEELabel; >+ private Button fExeEnvButton; >+ private Combo fEEChoice; > > private Label fLabel; > private Button fYesButton; >@@ -53,6 +65,8 @@ > private final static String S_UI_PLUGIN = "uiPlugin"; //$NON-NLS-1$ > private final static String S_RCP_PLUGIN = "rcpPlugin"; //$NON-NLS-1$ > >+ private final static String NO_EXECUTION_ENVIRONMENT = "<No Execution Environment>"; >+ > private ModifyListener classListener = new ModifyListener() { > public void modifyText(ModifyEvent e) { > if (fInitialized) >@@ -88,29 +102,82 @@ > > private void createPluginPropertiesGroup(Composite container) { > Group propertiesGroup = new Group(container, SWT.NONE); >- propertiesGroup.setLayout(new GridLayout(2, false)); >+ propertiesGroup.setLayout(new GridLayout(3, false)); > propertiesGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); > propertiesGroup.setText(PDEUIMessages.ContentPage_pGroup); > > Label label = new Label(propertiesGroup, SWT.NONE); > label.setText(PDEUIMessages.ContentPage_pid); >- fIdText = createText(propertiesGroup, propertiesListener); >+ fIdText = createText(propertiesGroup, propertiesListener, 2); > > label = new Label(propertiesGroup, SWT.NONE); > label.setText(PDEUIMessages.ContentPage_pversion); >- fVersionText = createText(propertiesGroup, propertiesListener); >+ fVersionText = createText(propertiesGroup, propertiesListener, 2); > > label = new Label(propertiesGroup, SWT.NONE); > label.setText(PDEUIMessages.ContentPage_pname); >- fNameText = createText(propertiesGroup, propertiesListener); >+ fNameText = createText(propertiesGroup, propertiesListener, 2); > > label = new Label(propertiesGroup, SWT.NONE); > label.setText(PDEUIMessages.ContentPage_pprovider); >- fProviderText = createText(propertiesGroup, propertiesListener); >+ fProviderText = createText(propertiesGroup, propertiesListener, 2); > > fLibraryLabel = new Label(propertiesGroup, SWT.NONE); > fLibraryLabel.setText(PDEUIMessages.ProjectStructurePage_library); >- fLibraryText = createText(propertiesGroup, propertiesListener); >+ fLibraryText = createText(propertiesGroup, propertiesListener, 2); >+ >+ createExecutionEnvironmentControls(propertiesGroup); >+ } >+ >+ private void createExecutionEnvironmentControls(Composite container) { >+ // Create label >+ fEELabel = new Label(container, SWT.NONE); >+ fEELabel.setText(PDEUIMessages.NewProjectCreationPage_executionEnvironments_label); >+ >+ // Create combo >+ fEEChoice = new Combo(container, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER); >+ fEEChoice.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ >+ // Gather EEs >+ IExecutionEnvironment[] exeEnvs = VMHelper.getExecutionEnvironments(); >+ TreeSet availableEEs = new TreeSet(); >+ for (int i = 0; i < exeEnvs.length; i++) { >+ availableEEs.add(exeEnvs[i].getId()); >+ } >+ availableEEs.add(NO_EXECUTION_ENVIRONMENT); >+ >+ // Set data >+ fEEChoice.setItems((String[]) availableEEs.toArray(new String[availableEEs.size()-1])); >+ fEEChoice.addSelectionListener(new SelectionAdapter(){ >+ public void widgetSelected(SelectionEvent e) { >+ validatePage(); >+ } >+ }); >+ >+ // Set default EE based on strict match to default VM >+ IVMInstall defaultVM = JavaRuntime.getDefaultVMInstall(); >+ String[] EEChoices = fEEChoice.getItems(); >+ for (int i = 0; i < EEChoices.length; i++) { >+ if (!EEChoices[i].equals(NO_EXECUTION_ENVIRONMENT)){ >+ if(VMHelper.getExecutionEnvironment(EEChoices[i]).isStrictlyCompatible(defaultVM)) { >+ fEEChoice.select(i); >+ break; >+ } >+ } >+ } >+ >+ // Create button >+ fExeEnvButton = new Button(container, SWT.PUSH); >+ fExeEnvButton.setLayoutData(new GridData()); >+ fExeEnvButton.setText(PDEUIMessages.NewProjectCreationPage_environmentsButton); >+ fExeEnvButton.addListener(SWT.Selection, new Listener() { >+ public void handleEvent(Event event) { >+ PreferencesUtil.createPreferenceDialogOn( >+ getShell(), >+ "org.eclipse.jdt.debug.ui.jreProfiles", //$NON-NLS-1$ >+ new String[] { "org.eclipse.jdt.debug.ui.jreProfiles" }, null).open(); //$NON-NLS-1$ >+ } >+ }); > } > > private void createPluginClassGroup(Composite container) { >@@ -166,6 +233,11 @@ > data.setUIPlugin(fUIPlugin.getSelection()); > data.setDoGenerateClass(fGenerateClass.isEnabled() && fGenerateClass.getSelection()); > data.setRCPApplicationPlugin(!fData.isSimple() && !isPureOSGi() && fYesButton.getSelection()); >+ if(fEEChoice.isEnabled() && !fEEChoice.getText().equals(NO_EXECUTION_ENVIRONMENT)) { >+ fData.setExecutionEnvironment(fEEChoice.getText().trim()); >+ } else { >+ fData.setExecutionEnvironment(null); >+ } > } > > private void createRCPGroup(Composite container){ >@@ -239,7 +311,13 @@ > int oldfChanged = fChangedGroups; > fClassText.setText(computeId().toLowerCase(Locale.ENGLISH) + ".Activator"); //$NON-NLS-1$ > fChangedGroups = oldfChanged; >- } >+ } >+ >+ boolean allowEESelection = !fData.isSimple() && fData.hasBundleStructure(); >+ fEELabel.setEnabled(allowEESelection); >+ fEEChoice.setEnabled(allowEESelection); >+ fExeEnvButton.setEnabled(allowEESelection); >+ > fRCPGroup.setVisible(!fData.isSimple() && !isPureOSGi()); > } > super.setVisible(visible); >@@ -265,6 +343,16 @@ > setMessage(status.getMessage(), IMessageProvider.WARNING); > } > } >+ if (errorMessage == null){ >+ String eeid = fEEChoice.getText(); >+ if(eeid != null && fEEChoice.isEnabled()) { >+ IExecutionEnvironment ee = VMHelper.getExecutionEnvironment(eeid); >+ IVMInstall[] vms = ee.getCompatibleVMs(); >+ if(vms.length == 0) { >+ errorMessage = PDEUIMessages.NewProjectCreationPage_invalidEE; >+ } >+ } >+ } > setErrorMessage(errorMessage); > setPageComplete(errorMessage == null); > } >Index: src/org/eclipse/pde/internal/ui/pderesources.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/pderesources.properties,v >retrieving revision 1.948 >diff -u -r1.948 pderesources.properties >--- src/org/eclipse/pde/internal/ui/pderesources.properties 28 Dec 2007 00:16:50 -0000 1.948 >+++ src/org/eclipse/pde/internal/ui/pderesources.properties 2 Jan 2008 17:42:47 -0000 >@@ -770,7 +770,6 @@ > NewProjectCreationPage_pDependsOnRuntime=&Eclipse version: > NewProjectCreationPage_environmentsButton=En&vironments... > NewProjectCreationPage_executionEnvironments_label=E&xecution Environment: >-NewProjectCreationPage_targetEnvironment=Target Environment > NewProjectCreationPage_invalidProjectName=Project name cannot contain % > NewProjectCreationPage_invalidLocationPath=Location path cannot contain % > NewProjectCreationPage_invalidEE=Execution Environment isn't compatible with any installed JRE >Index: src/org/eclipse/pde/internal/ui/PDEUIMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDEUIMessages.java,v >retrieving revision 1.343 >diff -u -r1.343 PDEUIMessages.java >--- src/org/eclipse/pde/internal/ui/PDEUIMessages.java 28 Dec 2007 00:16:50 -0000 1.343 >+++ src/org/eclipse/pde/internal/ui/PDEUIMessages.java 2 Jan 2008 17:42:47 -0000 >@@ -2422,9 +2422,6 @@ > > public static String NewProjectCreationPage_environmentsButton; > >- public static String NewProjectCreationPage_targetEnvironment; >- >- > public static String RequiredExecutionEnvironmentSection_title; > > public static String PluginGeneralInfoSection_lazyStart;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 213269
:
85475
| 86000 |
86020