Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2011-09-15 15:45:17 +0000
committerHenrik Rentz-Reichert2011-09-15 15:45:17 +0000
commit5af148b9e0d41764ef5aa8efc4a10b02e22cb692 (patch)
tree25ada998bd4d75ca888a26625b8a50f9e308191b
parent2ad92cc067b066c0ed25ae3ef392001e55d3c3a4 (diff)
downloadorg.eclipse.etrice-5af148b9e0d41764ef5aa8efc4a10b02e22cb692.tar.gz
org.eclipse.etrice-5af148b9e0d41764ef5aa8efc4a10b02e22cb692.tar.xz
org.eclipse.etrice-5af148b9e0d41764ef5aa8efc4a10b02e22cb692.zip
[generator.launch, generator.launch.java] added a generator launcher
-rw-r--r--plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/newwizard/ProjectCreator.java17
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/newwizard/EmptyProjectWizard.java2
-rw-r--r--plugins/org.eclipse.etrice.generator.launch.java/.classpath7
-rw-r--r--plugins/org.eclipse.etrice.generator.launch.java/.project28
-rw-r--r--plugins/org.eclipse.etrice.generator.launch.java/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--plugins/org.eclipse.etrice.generator.launch.java/META-INF/MANIFEST.MF18
-rw-r--r--plugins/org.eclipse.etrice.generator.launch.java/build.properties5
-rw-r--r--plugins/org.eclipse.etrice.generator.launch.java/icons/eTrice-launch.gifbin0 -> 894 bytes
-rw-r--r--plugins/org.eclipse.etrice.generator.launch.java/plugin.xml32
-rw-r--r--plugins/org.eclipse.etrice.generator.launch.java/src/org/eclipse/etrice/generator/launch/java/Activator.java53
-rw-r--r--plugins/org.eclipse.etrice.generator.launch.java/src/org/eclipse/etrice/generator/launch/java/JavaGeneratorLaunchConfigurationDelegate.java40
-rw-r--r--plugins/org.eclipse.etrice.generator.launch.java/src/org/eclipse/etrice/generator/launch/java/JavaGeneratorLaunchConfigurationTabGroup.java21
-rw-r--r--plugins/org.eclipse.etrice.generator.launch.java/src/org/eclipse/etrice/generator/launch/java/JavaGeneratorMainTab.java32
-rw-r--r--plugins/org.eclipse.etrice.generator.launch/.classpath7
-rw-r--r--plugins/org.eclipse.etrice.generator.launch/.project28
-rw-r--r--plugins/org.eclipse.etrice.generator.launch/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--plugins/org.eclipse.etrice.generator.launch/META-INF/MANIFEST.MF18
-rw-r--r--plugins/org.eclipse.etrice.generator.launch/build.properties5
-rw-r--r--plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/Activator.java65
-rw-r--r--plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorLaunchConfigurationDelegate.java145
-rw-r--r--plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorMainTab.java392
21 files changed, 918 insertions, 13 deletions
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 c5bd3e17b..418df12cf 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
@@ -64,6 +64,7 @@ public class ProjectCreator {
};
private static final String[] commonRequiredBundles = {
+ "org.eclipse.etrice.core.room;bundle-version=\"0.1.0\"",
"org.eclipse.etrice.generator;bundle-version=\"0.1.0\"",
"org.eclipse.emf.mwe2.launch;bundle-version=\"1.0.1\";resolution:=optional",
"org.eclipse.emf.mwe.utils;bundle-version=\"1.0.0\";visibility:=reexport",
@@ -521,22 +522,14 @@ public class ProjectCreator {
false,
"UTF-8");
launch.println("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>");
- launch.println("<launchConfiguration type=\"org.eclipse.jdt.launching.localJavaApplication\">");
- launch.println("<listAttribute key=\"org.eclipse.debug.core.MAPPED_RESOURCE_PATHS\">");
- launch.println("<listEntry value=\"/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/Main.java\"/>");
- launch.println("</listAttribute>");
- launch.println("<listAttribute key=\"org.eclipse.debug.core.MAPPED_RESOURCE_TYPES\">");
- launch.println("<listEntry value=\"1\"/>");
+ launch.println("<launchConfiguration type=\"org.eclipse.etrice.generator.launch.java.launchConfigurationType\">");
+ launch.println("<listAttribute key=\"ModelFiles\">");
+ launch.println("<listEntry value=\"${workspace_loc:/"+baseName+"/model/"+baseName+".room}\"/>");
launch.println("</listAttribute>");
launch.println("<listAttribute key=\"org.eclipse.debug.ui.favoriteGroups\">");
launch.println("<listEntry value=\"org.eclipse.debug.ui.launchGroup.run\"/>");
launch.println("</listAttribute>");
- launch.println("<stringAttribute key=\"org.eclipse.jdt.launching.MAIN_TYPE\" value=\"org.eclipse.etrice.generator.java.Main\"/>");
- launch.println("<stringAttribute key=\"org.eclipse.jdt.launching.PROGRAM_ARGUMENTS\" value=\"${workspace_loc:"+baseName+"}\\model\\"+baseName+".room"
- +"&#13;&#10;${workspace_loc:org.eclipse.etrice.modellib}\\models\\TimingService.room\"/>");
- launch.println("<stringAttribute key=\"org.eclipse.jdt.launching.PROJECT_ATTR\" value=\"org.eclipse.etrice.generator.java\"/>");
- launch.println("<stringAttribute key=\"org.eclipse.jdt.launching.VM_ARGUMENTS\" value=\"-ea\"/>");
- launch.println("<stringAttribute key=\"org.eclipse.jdt.launching.WORKING_DIRECTORY\" value=\"${workspace_loc:org.eclipse.etrice.tutorials}\"/>");
+ launch.println("<stringAttribute key=\"org.eclipse.jdt.launching.PROJECT_ATTR\" value=\""+baseName+"\"/>");
launch.println("</launchConfiguration>");
launch.close();
} catch (UnsupportedEncodingException e) {
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/newwizard/EmptyProjectWizard.java b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/newwizard/EmptyProjectWizard.java
index c8328e208..a99a09c62 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/newwizard/EmptyProjectWizard.java
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/newwizard/EmptyProjectWizard.java
@@ -130,7 +130,7 @@ public class EmptyProjectWizard extends Wizard implements INewWizard {
baseName);
ProjectCreator.createLaunchConfig(URI.createPlatformResourceURI("/"
- +baseName+"/"+baseName+".launch", true),
+ +baseName+"/gen_"+baseName+".launch", true),
baseName);
ProjectCreator.findOrCreateContainer(new Path("/"
diff --git a/plugins/org.eclipse.etrice.generator.launch.java/.classpath b/plugins/org.eclipse.etrice.generator.launch.java/.classpath
new file mode 100644
index 000000000..8a8f1668c
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.launch.java/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.etrice.generator.launch.java/.project b/plugins/org.eclipse.etrice.generator.launch.java/.project
new file mode 100644
index 000000000..fc8ed8a27
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.launch.java/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.etrice.generator.launch.java</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.etrice.generator.launch.java/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.etrice.generator.launch.java/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..dcfadd03c
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.launch.java/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Tue Aug 30 16:50:14 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/plugins/org.eclipse.etrice.generator.launch.java/META-INF/MANIFEST.MF b/plugins/org.eclipse.etrice.generator.launch.java/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..60001333d
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.launch.java/META-INF/MANIFEST.MF
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: eTrice Java Generator Launch
+Bundle-SymbolicName: org.eclipse.etrice.generator.launch.java;singleton:=true
+Bundle-Version: 0.1.0.qualifier
+Bundle-Activator: org.eclipse.etrice.generator.launch.java.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.debug.core,
+ org.eclipse.debug.ui,
+ org.eclipse.jdt.ui;bundle-version="3.7.0",
+ org.eclipse.jdt.core;bundle-version="3.7.0",
+ org.eclipse.etrice.generator.launch;bundle-version="0.1.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Import-Package: org.eclipse.jdt.launching,
+ org.eclipse.ui.dialogs
+Bundle-Vendor: eTrice (Incubation)
diff --git a/plugins/org.eclipse.etrice.generator.launch.java/build.properties b/plugins/org.eclipse.etrice.generator.launch.java/build.properties
new file mode 100644
index 000000000..6f20375d6
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.launch.java/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
diff --git a/plugins/org.eclipse.etrice.generator.launch.java/icons/eTrice-launch.gif b/plugins/org.eclipse.etrice.generator.launch.java/icons/eTrice-launch.gif
new file mode 100644
index 000000000..ca3906465
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.launch.java/icons/eTrice-launch.gif
Binary files differ
diff --git a/plugins/org.eclipse.etrice.generator.launch.java/plugin.xml b/plugins/org.eclipse.etrice.generator.launch.java/plugin.xml
new file mode 100644
index 000000000..457e1fe33
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.launch.java/plugin.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.debug.core.launchConfigurationTypes">
+ <launchConfigurationType
+ delegate="org.eclipse.etrice.generator.launch.java.JavaGeneratorLaunchConfigurationDelegate"
+ delegateDescription="Generates Java source code from ROOM models"
+ delegateName="eTrice Java Generator Delegate"
+ id="org.eclipse.etrice.generator.launch.java.launchConfigurationType"
+ modes="run"
+ name="eTrice Java Generator">
+ </launchConfigurationType>
+ </extension>
+ <extension
+ point="org.eclipse.debug.ui.launchConfigurationTypeImages">
+ <launchConfigurationTypeImage
+ configTypeID="org.eclipse.etrice.generator.launch.java.launchConfigurationType"
+ icon="icons/eTrice-launch.gif"
+ id="org.eclipse.etrice.generator.launch.java.launchConfigurationTypeImage">
+ </launchConfigurationTypeImage>
+ </extension>
+ <extension
+ point="org.eclipse.debug.ui.launchConfigurationTabGroups">
+ <launchConfigurationTabGroup
+ class="org.eclipse.etrice.generator.launch.java.JavaGeneratorLaunchConfigurationTabGroup"
+ description="Tab Group for eTrice Java Generator Launch Configurations"
+ id="org.eclipse.etrice.generator.launch.java.launchConfigurationTabGroup"
+ type="org.eclipse.etrice.generator.launch.java.launchConfigurationType">
+ </launchConfigurationTabGroup>
+ </extension>
+</plugin>
diff --git a/plugins/org.eclipse.etrice.generator.launch.java/src/org/eclipse/etrice/generator/launch/java/Activator.java b/plugins/org.eclipse.etrice.generator.launch.java/src/org/eclipse/etrice/generator/launch/java/Activator.java
new file mode 100644
index 000000000..e383deff5
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.launch.java/src/org/eclipse/etrice/generator/launch/java/Activator.java
@@ -0,0 +1,53 @@
+package org.eclipse.etrice.generator.launch.java;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.etrice.generator.launch.java"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ public void log(Exception e) {
+ }
+
+}
diff --git a/plugins/org.eclipse.etrice.generator.launch.java/src/org/eclipse/etrice/generator/launch/java/JavaGeneratorLaunchConfigurationDelegate.java b/plugins/org.eclipse.etrice.generator.launch.java/src/org/eclipse/etrice/generator/launch/java/JavaGeneratorLaunchConfigurationDelegate.java
new file mode 100644
index 000000000..cbcce9277
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.launch.java/src/org/eclipse/etrice/generator/launch/java/JavaGeneratorLaunchConfigurationDelegate.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * 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:
+ * Thomas Schuetz and Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.generator.launch.java;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.etrice.generator.launch.GeneratorLaunchConfigurationDelegate;
+
+/**
+ * @author hrentz
+ *
+ */
+public class JavaGeneratorLaunchConfigurationDelegate extends GeneratorLaunchConfigurationDelegate {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.etrice.generator.launch.GeneratorLaunchConfigurationDelegate#getMainTypeName()
+ */
+ @Override
+ protected String getMainTypeName() {
+ return "org.eclipse.etrice.generator.java.Main";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.etrice.generator.launch.GeneratorLaunchConfigurationDelegate#addArguments(org.eclipse.debug.core.ILaunchConfiguration, java.lang.StringBuffer)
+ */
+ @Override
+ protected void addArguments(ILaunchConfiguration configuration, StringBuffer argString) throws CoreException {
+ }
+
+}
diff --git a/plugins/org.eclipse.etrice.generator.launch.java/src/org/eclipse/etrice/generator/launch/java/JavaGeneratorLaunchConfigurationTabGroup.java b/plugins/org.eclipse.etrice.generator.launch.java/src/org/eclipse/etrice/generator/launch/java/JavaGeneratorLaunchConfigurationTabGroup.java
new file mode 100644
index 000000000..ee81a112a
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.launch.java/src/org/eclipse/etrice/generator/launch/java/JavaGeneratorLaunchConfigurationTabGroup.java
@@ -0,0 +1,21 @@
+package org.eclipse.etrice.generator.launch.java;
+
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
+import org.eclipse.debug.ui.CommonTab;
+import org.eclipse.debug.ui.EnvironmentTab;
+import org.eclipse.debug.ui.ILaunchConfigurationDialog;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+
+public class JavaGeneratorLaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup {
+
+ @Override
+ public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
+ ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {
+ new JavaGeneratorMainTab(),
+ new EnvironmentTab(),
+ new CommonTab()
+ };
+ setTabs(tabs);
+ }
+
+}
diff --git a/plugins/org.eclipse.etrice.generator.launch.java/src/org/eclipse/etrice/generator/launch/java/JavaGeneratorMainTab.java b/plugins/org.eclipse.etrice.generator.launch.java/src/org/eclipse/etrice/generator/launch/java/JavaGeneratorMainTab.java
new file mode 100644
index 000000000..b8482bb82
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.launch.java/src/org/eclipse/etrice/generator/launch/java/JavaGeneratorMainTab.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * 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:
+ * Thomas Schuetz and Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.generator.launch.java;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.etrice.generator.launch.GeneratorMainTab;
+
+/**
+ * @author hrentz
+ *
+ */
+public class JavaGeneratorMainTab extends GeneratorMainTab {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.etrice.generator.launch.GeneratorMainTab#isValidModelFile(org.eclipse.core.resources.IResource)
+ */
+ @Override
+ protected boolean isValidModelFile(IResource resource) {
+ return resource.getName().endsWith(".room");
+ }
+
+}
diff --git a/plugins/org.eclipse.etrice.generator.launch/.classpath b/plugins/org.eclipse.etrice.generator.launch/.classpath
new file mode 100644
index 000000000..8a8f1668c
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.launch/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.etrice.generator.launch/.project b/plugins/org.eclipse.etrice.generator.launch/.project
new file mode 100644
index 000000000..96a0dce58
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.launch/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.etrice.generator.launch</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.etrice.generator.launch/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.etrice.generator.launch/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..dcfadd03c
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.launch/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Tue Aug 30 16:50:14 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/plugins/org.eclipse.etrice.generator.launch/META-INF/MANIFEST.MF b/plugins/org.eclipse.etrice.generator.launch/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..e223ff36b
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.launch/META-INF/MANIFEST.MF
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: eTrice Generator Launch Base Classes
+Bundle-SymbolicName: org.eclipse.etrice.generator.launch;singleton:=true
+Bundle-Version: 0.1.0.qualifier
+Bundle-Activator: org.eclipse.etrice.generator.launch.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.debug.ui,
+ org.eclipse.jdt.ui;bundle-version="3.7.0",
+ org.eclipse.jdt.core;bundle-version="3.7.0",
+ org.eclipse.core.variables;bundle-version="3.2.500"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Import-Package: org.eclipse.jdt.launching,
+ org.eclipse.ui.dialogs
+Bundle-Vendor: eTrice (Incubation)
+Export-Package: org.eclipse.etrice.generator.launch
diff --git a/plugins/org.eclipse.etrice.generator.launch/build.properties b/plugins/org.eclipse.etrice.generator.launch/build.properties
new file mode 100644
index 000000000..6f20375d6
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.launch/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
diff --git a/plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/Activator.java b/plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/Activator.java
new file mode 100644
index 000000000..d281a01cb
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/Activator.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * 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:
+ * Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.generator.launch;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.etrice.generator.launch"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ public void log(Exception e) {
+ }
+
+}
diff --git a/plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorLaunchConfigurationDelegate.java b/plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorLaunchConfigurationDelegate.java
new file mode 100644
index 000000000..fb3a15020
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorLaunchConfigurationDelegate.java
@@ -0,0 +1,145 @@
+/*******************************************************************************
+ * 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:
+ * Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.generator.launch;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Map;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate;
+import org.eclipse.jdt.launching.ExecutionArguments;
+import org.eclipse.jdt.launching.IVMRunner;
+import org.eclipse.jdt.launching.VMRunnerConfiguration;
+import org.eclipse.core.variables.VariablesPlugin;
+
+/**
+ * @author Henrik Rentz-Reichert (initial contribution)
+ *
+ */
+public abstract class GeneratorLaunchConfigurationDelegate extends AbstractJavaLaunchConfigurationDelegate{
+
+ @Override
+ public void launch(ILaunchConfiguration configuration, String mode,
+ ILaunch launch, IProgressMonitor monitor) throws CoreException {
+
+ if (monitor == null) {
+ monitor = new NullProgressMonitor();
+ }
+
+ monitor.beginTask(configuration.getName()+"...", 3); //$NON-NLS-1$
+
+ if (monitor.isCanceled()) {
+ return;
+ }
+ try {
+ StringBuffer argString = new StringBuffer();
+
+ // constructing program arguments
+ addModels(configuration, argString);
+ addArguments(configuration, argString);
+
+ monitor.subTask("launching generator");
+
+ String mainTypeName = getMainTypeName();
+ IVMRunner runner = getVMRunner(configuration, mode);
+
+ File workingDir = verifyWorkingDirectory(configuration);
+ String workingDirName = null;
+ if (workingDir != null) {
+ workingDirName = workingDir.getAbsolutePath();
+ }
+
+ // Environment variables
+ String[] envp= getEnvironment(configuration);
+
+ // Program & VM arguments
+ String pgmArgs = argString.toString();
+ pgmArgs = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(pgmArgs);
+ String vmArgs = getVMArguments(configuration);
+ ExecutionArguments execArgs = new ExecutionArguments(vmArgs, pgmArgs);
+
+ // VM-specific attributes
+ @SuppressWarnings("rawtypes")
+ Map vmAttributesMap = getVMSpecificAttributesMap(configuration);
+
+ // Classpath
+ String[] classpath = getClasspath(configuration);
+
+ // Create VM config
+ VMRunnerConfiguration runConfig = new VMRunnerConfiguration(mainTypeName, classpath);
+ runConfig.setProgramArguments(execArgs.getProgramArgumentsArray());
+ runConfig.setEnvironment(envp);
+ runConfig.setVMArguments(execArgs.getVMArgumentsArray());
+ runConfig.setWorkingDirectory(workingDirName);
+ runConfig.setVMSpecificAttributesMap(vmAttributesMap);
+
+ // Bootpath
+ runConfig.setBootClassPath(getBootpath(configuration));
+
+ // check for cancellation
+ if (monitor.isCanceled()) {
+ return;
+ }
+
+ // stop in main
+ prepareStopInMain(configuration);
+
+ // done the verification phase
+ monitor.worked(1);
+
+ monitor.subTask("locating sources");
+ // set the default source locator if required
+ setDefaultSourceLocator(launch, configuration);
+ monitor.worked(1);
+
+ // Launch the configuration - 1 unit of work
+ runner.run(runConfig, launch, monitor);
+
+ // check for cancellation
+ if (monitor.isCanceled()) {
+ return;
+ }
+ }
+ finally {
+ monitor.done();
+ }
+ }
+
+ protected void addModels(ILaunchConfiguration configuration, StringBuffer argString) throws CoreException {
+ @SuppressWarnings("unchecked")
+ ArrayList<String> models = (ArrayList<String>) configuration.getAttribute("ModelFiles", Collections.EMPTY_LIST);
+ for (String model : models){
+ argString.append(" file://"+model);
+ }
+ }
+
+ /**
+ * @return the main type of the generator as fully qualified name
+ */
+ protected abstract String getMainTypeName();
+
+ /**
+ * assemble the command line by adding further parameters
+ *
+ * @param configuration
+ * @param argString
+ * @throws CoreException
+ */
+ protected abstract void addArguments(ILaunchConfiguration configuration, StringBuffer argString) throws CoreException;
+}
diff --git a/plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorMainTab.java b/plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorMainTab.java
new file mode 100644
index 000000000..fa139d932
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.launch/src/org/eclipse/etrice/generator/launch/GeneratorMainTab.java
@@ -0,0 +1,392 @@
+/*******************************************************************************
+ * 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:
+ * Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.generator.launch;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.variables.VariablesPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
+import org.eclipse.jdt.core.IJavaModel;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.jdt.ui.JavaElementLabelProvider;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.ElementListSelectionDialog;
+import org.eclipse.ui.dialogs.ResourceListSelectionDialog;
+import org.eclipse.ui.dialogs.ResourceSelectionDialog;
+
+/**
+ * @author Henrik Rentz-Reichert (initial contribution)
+ *
+ */
+public abstract class GeneratorMainTab extends AbstractLaunchConfigurationTab {
+
+ private List modelList;
+ private Text projectText;
+ private Button browseProject;
+
+ @Override
+ public void createControl(Composite parent) {
+ try{
+ // Create main composite
+ Composite mainComposite = new Composite(parent,SWT.NONE);
+ setControl(mainComposite);
+
+ GridLayout layout= new GridLayout();
+ layout.numColumns = 2;
+ layout.marginHeight = 10;
+ layout.marginWidth = 10;
+ mainComposite.setLayout(layout);
+
+ createProjectEditor(mainComposite);
+
+ createModelsEditor(mainComposite);
+
+ Dialog.applyDialogFont(mainComposite);
+ }
+ catch(Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * @param mainComposite
+ */
+ private void createModelsEditor(Composite mainComposite) {
+ createModelList(mainComposite);
+ createModelButtons(mainComposite);
+ }
+
+ /**
+ * @param parent
+ */
+ private void createModelButtons(Composite parent) {
+ Composite buttons = new Composite(parent,SWT.NONE | SWT.TOP);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ buttons.setLayout(layout);
+ GridData gd = new GridData();
+ gd.verticalAlignment = SWT.BEGINNING;
+ buttons.setLayoutData(gd);
+
+ makeButton(buttons, new AddModel(), "Add (filtered)");
+ makeButton(buttons, new AddModelAlt(), "Add (selection)");
+ makeButton(buttons, new RemoveModel(), "Remove");
+ makeButton(buttons, new MoveModelUp(), "Move Up");
+ makeButton(buttons, new MoveModelDown(), "Move Down");
+ }
+
+ /**
+ * @param parent
+ */
+ private void createModelList(Composite parent) {
+ Label label = new Label(parent, SWT.NONE);
+ label.setText("ROOM Models:");
+ GridData gd = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, false, 2, 1);
+ gd.verticalIndent = 20;
+ label.setLayoutData(gd);
+
+ modelList = new List(parent,SWT.NONE | SWT.BORDER | SWT.SINGLE);
+ GridData gridData = new GridData();
+ gridData.horizontalAlignment = GridData.FILL;
+ gridData.grabExcessHorizontalSpace = true;
+ gridData.verticalAlignment = GridData.FILL;
+ gridData.grabExcessVerticalSpace = true;
+ modelList.setLayoutData(gridData);
+ }
+
+ /**
+ * @param buttons
+ * @param listener
+ * @param label
+ * @return
+ */
+ private GridData makeButton(Composite buttons, Listener listener, String label) {
+ Button addBtn = new Button(buttons, SWT.PUSH | SWT.CENTER | SWT.TOP);
+ addBtn.setText(label);
+ GridData gd = new GridData();
+ gd.horizontalAlignment = GridData.FILL;
+ gd.grabExcessHorizontalSpace = false;
+ addBtn.setLayoutData(gd);
+ addBtn.addListener(SWT.Selection,listener);
+ return gd;
+ }
+
+ protected void createProjectEditor(Composite parent) {
+ Label label = new Label(parent, SWT.NONE);
+ label.setText("Project:");
+ GridData gd = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, false, 2, 1);
+ label.setLayoutData(gd);
+
+ projectText = createSingleText(parent, 1);
+ projectText.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ updateLaunchConfigurationDialog();
+ }
+ });
+ browseProject = createPushButton(parent, "Browse...", null);
+ browseProject.addSelectionListener(new SelectionListener( ) {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ handleProjectButtonSelected();
+ }
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ handleProjectButtonSelected();
+ }
+ });
+ }
+
+ private void updateProjectFromConfig(ILaunchConfiguration config) {
+ String projectName = "";
+ try {
+ projectName = config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, "");
+ }
+ catch (CoreException ce) {
+ setErrorMessage(ce.getStatus().getMessage());
+ }
+ projectText.setText(projectName);
+ }
+
+ private void handleProjectButtonSelected() {
+ IJavaProject project = chooseJavaProject();
+ if (project == null) {
+ return;
+ }
+ String projectName = project.getElementName();
+ projectText.setText(projectName);
+ updateLaunchConfigurationDialog();
+ }
+
+ private IJavaProject chooseJavaProject() {
+ ILabelProvider labelProvider= new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT);
+ ElementListSelectionDialog dialog= new ElementListSelectionDialog(getShell(), labelProvider);
+ dialog.setTitle("Project Selection");
+ dialog.setMessage("Select a project to constrain your search");
+ try {
+ dialog.setElements(JavaCore.create(getWorkspaceRoot()).getJavaProjects());
+ }
+ catch (JavaModelException jme) {Activator.getDefault().log(jme);}
+ IJavaProject javaProject= getJavaProject();
+ if (javaProject != null) {
+ dialog.setInitialSelections(new Object[] { javaProject });
+ }
+ if (dialog.open() == Window.OK) {
+ return (IJavaProject) dialog.getFirstResult();
+ }
+ return null;
+ }
+
+ private IJavaModel getJavaModel() {
+ return JavaCore.create(getWorkspaceRoot());
+ }
+
+ private IJavaProject getJavaProject() {
+ String projectName = projectText.getText().trim();
+ if (projectName.length() < 1) {
+ return null;
+ }
+ return getJavaModel().getJavaProject(projectName);
+ }
+
+ private IWorkspaceRoot getWorkspaceRoot() {
+ return ResourcesPlugin.getWorkspace().getRoot();
+ }
+
+ private static Text createSingleText(Composite parent, int hspan) {
+ Text t = new Text(parent, SWT.SINGLE | SWT.BORDER);
+ t.setFont(parent.getFont());
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = hspan;
+ t.setLayoutData(gd);
+ return t;
+ }
+
+ @Override
+ public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void initializeFrom(ILaunchConfiguration configuration) {
+ try {
+ updateProjectFromConfig(configuration);
+
+ modelList.removeAll();
+ ArrayList<String> param = new ArrayList<String>();
+ param = (ArrayList<String>) configuration.getAttribute("ModelFiles", param);
+ for (String tmp : param) {
+ addModelFile(tmp);
+ }
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void performApply(ILaunchConfigurationWorkingCopy configuration) {
+ try {
+ ArrayList<String> param = new ArrayList<String>();
+ String[] tmp = modelList.getItems();
+ for (int i = 0; i < tmp.length; i++) {
+ param.add(tmp[i]);
+ }
+ configuration.setAttribute("ModelFiles", param);
+ configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectText.getText().trim());
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public String getName() {
+ return "Main";
+ }
+
+ private void addModelFile(String str) {
+ modelList.add(str);
+ setDirty(true);
+ updateLaunchConfigurationDialog();
+ }
+
+ protected abstract boolean isValidModelFile(IResource resource);
+
+ private class AddModel implements Listener {
+ @Override
+ public void handleEvent(Event event) {
+ ModelSelectionDialog dialog = new ModelSelectionDialog(modelList.getShell());
+ dialog.setTitle("Resource Selection");
+ dialog.setMessage("Select Room Model:");
+ if (dialog.open() == Window.OK) {
+ Object[] tmp = dialog.getResult();
+ if (tmp != null) {
+ IResource f;
+ for (int i = 0; i < tmp.length; i++) {
+ f = (IResource) tmp[i];
+ String arg = f.getFullPath().toString();
+ String fileLoc = VariablesPlugin.getDefault().getStringVariableManager().generateVariableExpression("workspace_loc", arg); //$NON-NLS-1$
+ addModelFile(fileLoc);
+ }
+ }
+ }
+ }
+ }
+
+ private class AddModelAlt implements Listener {
+ @Override
+ public void handleEvent(Event event) {
+ ResourceSelectionDialog dialog = new ResourceSelectionDialog(modelList.getShell(), ResourcesPlugin.getWorkspace().getRoot(), "");
+ dialog.setTitle("Resource Selection");
+ dialog.setMessage("Select Room Model:");
+ if (dialog.open() == Window.OK) {
+ Object[] tmp = dialog.getResult();
+ if (tmp != null) {
+ IResource f;
+ for (int i = 0; i < tmp.length; i++) {
+ f = (IResource) tmp[i];
+ String arg = f.getFullPath().toString();
+ String fileLoc = VariablesPlugin.getDefault().getStringVariableManager().generateVariableExpression("workspace_loc", arg); //$NON-NLS-1$
+ addModelFile(fileLoc);
+ }
+ }
+ }
+ }
+ }
+
+ private class RemoveModel implements Listener{
+ @Override
+ public void handleEvent(Event event) {
+ String[] arr = modelList.getSelection();
+ for (int i = 0; i < arr.length; i++) {
+ modelList.remove(arr[i]);
+ }
+ setDirty(true);
+ updateLaunchConfigurationDialog();
+ }
+ }
+
+ private class MoveModelUp implements Listener{
+ @Override
+ public void handleEvent(Event event) {
+ String[] arr=modelList.getSelection();
+ for(int i=0; i<arr.length;i++){
+ int index=modelList.indexOf(arr[i]);
+ if(index!=0){
+ modelList.remove(arr[i]);
+ modelList.add(arr[i], index-1);
+ modelList.setSelection(index-1);
+ }
+ }
+ setDirty(true);
+ updateLaunchConfigurationDialog();
+ }
+ }
+ private class MoveModelDown implements Listener{
+ @Override
+ public void handleEvent(Event event) {
+ String[] arr = modelList.getSelection();
+ for (int i = 0; i < arr.length; i++) {
+ int index = modelList.indexOf(arr[i]);
+ if (index != (modelList.getItemCount() - 1)) {
+ modelList.remove(arr[i]);
+ modelList.add(arr[i], index + 1);
+ modelList.setSelection(index + 1);
+ }
+ }
+ setDirty(true);
+ updateLaunchConfigurationDialog();
+ }
+ }
+
+ private class ModelSelectionDialog extends ResourceListSelectionDialog {
+
+ public ModelSelectionDialog(Shell parentShell) {
+ super(parentShell, ResourcesPlugin.getWorkspace().getRoot(), IResource.FILE);
+ }
+
+ @Override
+ protected boolean select(IResource resource) {
+ return isValidModelFile(resource);
+ }
+ }
+}

Back to the top