summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2011-08-01 04:55:35 (EDT)
committer Henrik Rentz-Reichert2011-08-01 04:55:35 (EDT)
commit26d4a7273af9523a7e170dc3ae275160cfa8186c (patch)
tree04ba3d2dc794c504085e9a94012b8ca7061bfe07
parent2556d19dc136feab69edf8bfb689925323aa99a8 (diff)
downloadorg.eclipse.etrice-26d4a7273af9523a7e170dc3ae275160cfa8186c.zip
org.eclipse.etrice-26d4a7273af9523a7e170dc3ae275160cfa8186c.tar.gz
org.eclipse.etrice-26d4a7273af9523a7e170dc3ae275160cfa8186c.tar.bz2
[core.room, generator.java] re-factored new wizard
moved eTrice Java wizard to Java generator Change-Id: I85e7653ad32f66df0b8e736d5d0d94856a58df3a
-rw-r--r--plugins/org.eclipse.etrice.core.room.ui/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.etrice.core.room.ui/plugin.xml16
-rw-r--r--plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/newwizard/ProjectCreator.java29
-rw-r--r--plugins/org.eclipse.etrice.generator.java/META-INF/MANIFEST.MF8
-rw-r--r--plugins/org.eclipse.etrice.generator.java/build.properties3
-rw-r--r--plugins/org.eclipse.etrice.generator.java/icons/NewETriceProject.gifbin0 -> 130 bytes
-rw-r--r--plugins/org.eclipse.etrice.generator.java/plugin.xml21
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/newwizard/EmptyProjectWizard.java (renamed from plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/newwizard/EmptyProjectWizard.java)54
8 files changed, 70 insertions, 64 deletions
diff --git a/plugins/org.eclipse.etrice.core.room.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.etrice.core.room.ui/META-INF/MANIFEST.MF
index 7009252..bacf3b6 100644
--- a/plugins/org.eclipse.etrice.core.room.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.etrice.core.room.ui/META-INF/MANIFEST.MF
@@ -20,5 +20,6 @@ Require-Bundle: org.eclipse.etrice.core.room;bundle-version="0.1.0";visibility:=
Import-Package: org.apache.log4j
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: org.eclipse.etrice.core.ui,
- org.eclipse.etrice.core.ui.contentassist.antlr
+ org.eclipse.etrice.core.ui.contentassist.antlr,
+ org.eclipse.etrice.core.ui.newwizard
Bundle-Activator: org.eclipse.etrice.core.ui.internal.RoomActivator
diff --git a/plugins/org.eclipse.etrice.core.room.ui/plugin.xml b/plugins/org.eclipse.etrice.core.room.ui/plugin.xml
index 1763316..6b6cf8c 100644
--- a/plugins/org.eclipse.etrice.core.room.ui/plugin.xml
+++ b/plugins/org.eclipse.etrice.core.room.ui/plugin.xml
@@ -205,20 +205,4 @@
</menuContribution>
</extension>
- <extension point="org.eclipse.ui.newWizards">
- <category
- id="org.eclipse.etrice.core.ui.wizardCategory"
- name="eTrice"/>
- <wizard
- id="org.eclipse.etrice.core.ui.newwizard.EmptyProjectWizard"
- name="Empty eTrice Java Project"
- class="org.eclipse.etrice.core.ui.newwizard.EmptyProjectWizard"
- category="org.eclipse.etrice.core.ui.wizardCategory"
- project="true"
- icon="icons/NewETriceProject.gif">
- <description>Create an empty Java plug-in project with eTrice dependencies</description>
- <selection class="org.eclipse.core.resources.IResource"/>
- </wizard>
- </extension>
-
</plugin>
diff --git a/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/newwizard/ProjectCreator.java b/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/newwizard/ProjectCreator.java
index 469554c..c8e2328 100644
--- a/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/newwizard/ProjectCreator.java
+++ b/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/newwizard/ProjectCreator.java
@@ -37,10 +37,12 @@ import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.common.util.UniqueEList;
import org.eclipse.emf.ecore.resource.URIConverter;
+import org.eclipse.etrice.core.ui.internal.RoomActivator;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.jface.resource.ImageDescriptor;
/**
* @author Henrik Rentz-Reichert - Initial contribution and API
@@ -454,8 +456,9 @@ public class ProjectCreator {
manifest.print("Require-Bundle:");
manifest.print(" "+it.next());
while (it.hasNext()) {
- manifest.println(",\n "+it.next());
+ manifest.print(",\n "+it.next());
}
+ manifest.println("");
}
manifest.println("Bundle-RequiredExecutionEnvironment: JavaSE-1.6");
manifest.close();
@@ -541,4 +544,28 @@ public class ProjectCreator {
Logger.getLogger(ProjectCreator.class).error(e.getMessage(), e);
}
}
+
+ /**
+ * Returns an image descriptor for the image file at the given plug-in
+ * relative path
+ *
+ * @param path
+ * the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ ImageDescriptor desc = RoomActivator.getInstance().getImageRegistry()
+ .getDescriptor(path);
+ if (desc == null) {
+ desc = RoomActivator.imageDescriptorFromPlugin(
+ "org.eclipse.etrice.core.room.ui", path);
+ if (desc == null)
+ System.err.println("image not found: " + path);
+ else {
+ RoomActivator.getInstance().getImageRegistry().put(path, desc);
+ RoomActivator.getInstance().getImageRegistry().get(path);
+ }
+ }
+ return desc;
+ }
}
diff --git a/plugins/org.eclipse.etrice.generator.java/META-INF/MANIFEST.MF b/plugins/org.eclipse.etrice.generator.java/META-INF/MANIFEST.MF
index 3718a4a..41fffaa 100644
--- a/plugins/org.eclipse.etrice.generator.java/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.etrice.generator.java/META-INF/MANIFEST.MF
@@ -3,9 +3,10 @@ Bundle-ManifestVersion: 2
Bundle-Name: eTrice Java Generator
Bundle-Vendor: eTrice (Incubation)
Bundle-Version: 0.1.0
-Bundle-SymbolicName: org.eclipse.etrice.generator.java; singleton:=true
+Bundle-SymbolicName: org.eclipse.etrice.generator.java;singleton:=true
Bundle-ActivationPolicy: lazy
Require-Bundle: org.eclipse.etrice.core.room;bundle-version="0.1.0";visibility:=reexport,
+ org.eclipse.etrice.core.room.ui;bundle-version="0.1.0",
org.eclipse.etrice.generator;bundle-version="0.1.0",
org.eclipse.xpand;bundle-version="1.0.1";visibility:=reexport,
org.eclipse.xtend;bundle-version="1.0.1";visibility:=reexport,
@@ -16,6 +17,9 @@ Require-Bundle: org.eclipse.etrice.core.room;bundle-version="0.1.0";visibility:=
org.eclipse.xtend.util.stdlib;bundle-version="1.0.1",
org.eclipse.jdt.core;bundle-version="3.6.0",
org.eclipse.core.resources;bundle-version="3.6.0",
- org.eclipse.core.runtime;bundle-version="3.6.0"
+ org.eclipse.core.runtime;bundle-version="3.6.0",
+ org.eclipse.jface;bundle-version="3.7.0",
+ org.eclipse.ui;bundle-version="3.7.0",
+ org.eclipse.ui.ide;bundle-version="3.7.0"
Import-Package: org.apache.log4j
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/plugins/org.eclipse.etrice.generator.java/build.properties b/plugins/org.eclipse.etrice.generator.java/build.properties
index f71c22c..bc3bc50 100644
--- a/plugins/org.eclipse.etrice.generator.java/build.properties
+++ b/plugins/org.eclipse.etrice.generator.java/build.properties
@@ -1,4 +1,5 @@
source.. = src/
bin.includes = META-INF/,\
- .
+ .,\
+ plugin.xml
jre.compilation.profile = JavaSE-1.6
diff --git a/plugins/org.eclipse.etrice.generator.java/icons/NewETriceProject.gif b/plugins/org.eclipse.etrice.generator.java/icons/NewETriceProject.gif
new file mode 100644
index 0000000..2f087aa
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.java/icons/NewETriceProject.gif
Binary files differ
diff --git a/plugins/org.eclipse.etrice.generator.java/plugin.xml b/plugins/org.eclipse.etrice.generator.java/plugin.xml
new file mode 100644
index 0000000..b4a4121
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.java/plugin.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+ <extension point="org.eclipse.ui.newWizards">
+ <category
+ id="org.eclipse.etrice.core.ui.wizardCategory"
+ name="eTrice"/>
+ <wizard
+ id="org.eclipse.etrice.generator.java.newwizard.EmptyProjectWizard"
+ name="Empty eTrice Java Project"
+ class="org.eclipse.etrice.generator.java.newwizard.EmptyProjectWizard"
+ category="org.eclipse.etrice.core.ui.wizardCategory"
+ project="true"
+ icon="icons/NewETriceProject.gif">
+ <description>Create an empty Java plug-in project with eTrice dependencies</description>
+ <selection class="org.eclipse.core.resources.IResource"/>
+ </wizard>
+ </extension>
+
+</plugin>
diff --git a/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/newwizard/EmptyProjectWizard.java b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/newwizard/EmptyProjectWizard.java
index e13a671..8733cd2 100644
--- a/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/newwizard/EmptyProjectWizard.java
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/newwizard/EmptyProjectWizard.java
@@ -1,21 +1,13 @@
-/**
- * <copyright>
- *
- * Copyright (c) 2005-2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
+/*******************************************************************************
+ * Copyright (c) 2011 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *
- * </copyright>
- *
- * EmptyProjectWizard.java,v 1.1 2005/05/06 02:19:59 marcelop Exp
- */
-package org.eclipse.etrice.core.ui.newwizard;
+ *******************************************************************************/
+package org.eclipse.etrice.generator.java.newwizard;
+import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
@@ -28,8 +20,7 @@ import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.emf.common.util.BasicMonitor;
import org.eclipse.emf.common.util.URI;
-import org.eclipse.etrice.core.ui.internal.RoomActivator;
-import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.etrice.core.ui.newwizard.ProjectCreator;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
@@ -43,7 +34,8 @@ import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
import org.eclipse.ui.part.ISetSelectionTarget;
/**
- * @since 2.1.0
+ * @author Henrik Rentz-Reichert (initial contribution and API)
+ *
*/
public class EmptyProjectWizard extends Wizard implements INewWizard {
protected IWorkbench workbench;
@@ -54,33 +46,9 @@ public class EmptyProjectWizard extends Wizard implements INewWizard {
protected IProject runtimeProject;
protected String initialProjectName;
- /**
- * Returns an image descriptor for the image file at the given plug-in
- * relative path
- *
- * @param path
- * the path
- * @return the image descriptor
- */
- public ImageDescriptor getImageDescriptor(String path) {
- ImageDescriptor desc = RoomActivator.getInstance().getImageRegistry()
- .getDescriptor(path);
- if (desc == null) {
- desc = RoomActivator.imageDescriptorFromPlugin(
- "org.eclipse.etrice.core.room.ui", path);
- if (desc == null)
- System.err.println("image not found: " + path);
- else {
- RoomActivator.getInstance().getImageRegistry().put(path, desc);
- RoomActivator.getInstance().getImageRegistry().get(path);
- }
- }
- return desc;
- }
-
public void init(IWorkbench workbench, IStructuredSelection selection) {
this.workbench = workbench;
- setDefaultPageImageDescriptor(getImageDescriptor("icons/NewETriceProjectWizban.gif"));
+ setDefaultPageImageDescriptor(ProjectCreator.getImageDescriptor("icons/NewETriceProjectWizban.gif"));
setWindowTitle("New Empty eTrice Project");
IWorkspace workspace = ResourcesPlugin.getWorkspace();
@@ -119,7 +87,7 @@ public class EmptyProjectWizard extends Wizard implements INewWizard {
}
private List<String> getRequiredBundles() {
- List<String> requiredBundles = ProjectCreator.getCommonRequiredBundles();
+ List<String> requiredBundles = new ArrayList<String>(ProjectCreator.getCommonRequiredBundles());
requiredBundles.add("org.eclipse.etrice.generator.java;bundle-version=\"0.1.0\"");
requiredBundles.add("org.eclipse.etrice.modellib;bundle-version=\"0.1.0\"");
return requiredBundles;