diff options
author | Wim Jongman | 2012-10-29 16:59:58 -0400 |
---|---|---|
committer | Lars Vogel | 2012-10-29 16:59:58 -0400 |
commit | 7d95ffbaeb320604aa5d2ac1c12021026dc8e51d (patch) | |
tree | 62975dcf72ec7477c5a35c346cae726f06b89717 | |
parent | 5b11babea702388912e79f55575167714ece9ff9 (diff) | |
download | org.eclipse.e4.tools-7d95ffbaeb320604aa5d2ac1c12021026dc8e51d.tar.gz org.eclipse.e4.tools-7d95ffbaeb320604aa5d2ac1c12021026dc8e51d.tar.xz org.eclipse.e4.tools-7d95ffbaeb320604aa5d2ac1c12021026dc8e51d.zip |
Bug 391604 - Application model editor is opened after project generation
Opening the application model makes more sense than
opening the plugin.xml editor which guides people into
pressing the start button.
-rw-r--r-- | bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/project/E4NewProjectWizard.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/project/E4NewProjectWizard.java b/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/project/E4NewProjectWizard.java index 6cb549b5..ed3268fe 100644 --- a/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/project/E4NewProjectWizard.java +++ b/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/project/E4NewProjectWizard.java @@ -9,6 +9,7 @@ * Soyatec - initial API and implementation * IBM Corporation - ongoing enhancements * Sopot Cela - ongoing enhancements + * Lars Vogel - ongoing enhancements *******************************************************************************/ package org.eclipse.e4.internal.tools.wizards.project; @@ -86,7 +87,12 @@ import org.eclipse.pde.internal.ui.wizards.IProjectProvider; import org.eclipse.pde.internal.ui.wizards.plugin.NewPluginProjectWizard; import org.eclipse.pde.internal.ui.wizards.plugin.NewProjectCreationOperation; import org.eclipse.pde.internal.ui.wizards.plugin.PluginFieldData; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.IWorkingSet; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.part.FileEditorInput; import org.osgi.framework.Bundle; import org.osgi.framework.Version; @@ -95,6 +101,7 @@ import org.osgi.framework.Version; */ public class E4NewProjectWizard extends NewPluginProjectWizard { + private static final String MODEL_EDITOR_ID = "org.eclipse.e4.tools.emf.editor3x.e4wbm"; private static final String APPLICATION_MODEL = "Application.e4xmi"; private PluginFieldData fPluginData; private NewApplicationWizardPage fApplicationPage; @@ -218,6 +225,10 @@ public class E4NewProjectWizard extends NewPluginProjectWizard { new NullProgressMonitor()); // Add the product sources adjustBuildPropertiesFile(fProjectProvider.getProject()); + + // Open the model editor + openEditorForApplicationModel(); + return true; } catch (InvocationTargetException e) { PDEPlugin.logException(e); @@ -227,6 +238,18 @@ public class E4NewProjectWizard extends NewPluginProjectWizard { } return false; } + + private void openEditorForApplicationModel() throws PartInitException { + IFile file = fProjectProvider.getProject().getFile( + APPLICATION_MODEL); + if (file != null) { + FileEditorInput input = new FileEditorInput(file); + IWorkbenchWindow window = PlatformUI.getWorkbench() + .getActiveWorkbenchWindow(); + IWorkbenchPage page = window.getActivePage(); + page.openEditor(input, MODEL_EDITOR_ID); + } + } private void adjustBuildPropertiesFile(IProject project) throws CoreException { IFile file = PDEProject.getBuildProperties(project); |