Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/pom.xml60
-rw-r--r--doc/pom.xml2
-rw-r--r--examples/pom.xml2
-rw-r--r--extra/org.eclipse.gmf.tooling.codegen.maven/pom.xml3
-rw-r--r--extra/pom.xml5
-rw-r--r--features/pom.xml2
-rw-r--r--plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/Activator.java1
-rw-r--r--plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/GMFGeneratorUIModule.java7
-rw-r--r--plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/CodegenEmittersWithXtend2.java92
-rw-r--r--plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/ExecuteTemplatesOperationWithXtend2.java1
-rw-r--r--plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/GeneratorTextEmitter.java8
-rw-r--r--plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/GeneratorWithXtend2.java31
-rw-r--r--plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/Xtend2ClassEmitter.java32
-rw-r--r--plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/Xtend2Emitter.java104
-rw-r--r--plugins/org.eclipse.gmf.codegen.xtend/src/org/eclipse/gmf/codegen/util/CodegenEmittersWithXtend2.java97
-rw-r--r--plugins/org.eclipse.gmf.codegen.xtend/src/org/eclipse/gmf/codegen/util/GMFGeneratorUIModule.java7
-rw-r--r--plugins/org.eclipse.gmf.codegen.xtend/src/org/eclipse/gmf/codegen/util/GeneratorTextEmitter.java11
-rw-r--r--plugins/org.eclipse.gmf.codegen.xtend/src/org/eclipse/gmf/codegen/util/GeneratorWithXtend2.java41
-rw-r--r--plugins/org.eclipse.gmf.codegen.xtend/src/org/eclipse/gmf/codegen/util/Xtend2ClassEmitter.java37
-rw-r--r--plugins/org.eclipse.gmf.codegen.xtend/src/org/eclipse/gmf/codegen/util/Xtend2Emitter.java110
-rw-r--r--plugins/org.eclipse.gmf.common/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.gmf.common/src/org/eclipse/gmf/internal/common/codegen/OrganizeImportsPostprocessor.java32
-rw-r--r--plugins/org.eclipse.gmf.tooling.codegen.launcher/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.gmf.tooling.codegen.launcher/src/org/eclipse/gmf/tooling/codegen/launcher/Activator.java4
-rw-r--r--plugins/org.eclipse.gmf.tooling.codegen.launcher/src/org/eclipse/gmf/tooling/codegen/launcher/GMFGenerateApplication.java4
-rw-r--r--plugins/pom.xml2
-rw-r--r--pom.xml39
-rw-r--r--repository/pom.xml2
-rw-r--r--test-examples/pom.xml2
-rw-r--r--tests/org.eclipse.gmf.tooling.tests.xtend/src/org/eclipse/gmf/tooling/tests/xtend/rt/EditHelpersTestXtend.java2
-rw-r--r--tests/org.eclipse.gmf.tooling.tests.xtend/src/org/eclipse/gmf/tooling/tests/xtend/setup/RuntimeBasedGeneratorConfigurationXtend.java4
-rw-r--r--tests/pom.xml2
32 files changed, 450 insertions, 302 deletions
diff --git a/build/pom.xml b/build/pom.xml
new file mode 100644
index 000000000..2eb41cae0
--- /dev/null
+++ b/build/pom.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (c) 2011 PetalsLink
+ * 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
+ *
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.eclipse.gmf-tooling</groupId>
+ <artifactId>parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <name>Parent project for GMF Tooling</name>
+ <description>Parent project for GMF Tooling</description>
+
+ <prerequisites>
+ <maven>3.0</maven>
+ </prerequisites>
+
+
+ <modules>
+ <module>../</module>
+ <module>../extra</module>
+ </modules>
+
+ <mailingLists>
+ <mailingList>
+ <name>GMF-dev Mailing List</name>
+ <post>gmf-dev@eclipse.org</post>
+ <subscribe>https://dev.eclipse.org/mailman/listinfo/gmf-dev</subscribe>
+ <unsubscribe>https://dev.eclipse.org/mailman/listinfo/gmf-dev</unsubscribe>
+ <archive>http://dev.eclipse.org/mhonarc/lists/gmf-dev</archive>
+ </mailingList>
+ </mailingLists>
+
+ <issueManagement>
+ <url>https://bugs.eclipse.org/bugs/buglist.cgi?classification=Modeling;query_format=advanced;component=GMF-tooling;product=GMP</url>
+ <system>Bugzilla</system>
+ </issueManagement>
+
+ <licenses>
+ <license>
+ <name>Eclipse Public License v1.0</name>
+ <comments>
+ 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.htm
+ </comments>
+ </license>
+ </licenses>
+
+
+</project>
diff --git a/doc/pom.xml b/doc/pom.xml
index df33ae4ad..69bd0624e 100644
--- a/doc/pom.xml
+++ b/doc/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.eclipse.gmf-tooling</groupId>
- <artifactId>parent</artifactId>
+ <artifactId>eclipse</artifactId>
<version>3.0.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
diff --git a/examples/pom.xml b/examples/pom.xml
index 08f895f87..ae1b6139d 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.eclipse.gmf-tooling</groupId>
- <artifactId>parent</artifactId>
+ <artifactId>eclipse</artifactId>
<version>3.0.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
diff --git a/extra/org.eclipse.gmf.tooling.codegen.maven/pom.xml b/extra/org.eclipse.gmf.tooling.codegen.maven/pom.xml
index 50c52adbf..2e6409193 100644
--- a/extra/org.eclipse.gmf.tooling.codegen.maven/pom.xml
+++ b/extra/org.eclipse.gmf.tooling.codegen.maven/pom.xml
@@ -12,7 +12,7 @@
<parent>
<groupId>org.eclipse.gmf-tooling</groupId>
<artifactId>extra</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>1.0.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
@@ -21,6 +21,7 @@
<plexusVersion>1.5.5</plexusVersion>
<maven-version>3.0</maven-version>
<plexusUtilsVersion>3.0.7</plexusUtilsVersion>
+ <tycho-version>0.23.1</tycho-version>
</properties>
<build>
diff --git a/extra/pom.xml b/extra/pom.xml
index b4ad4a5e9..b72b69e72 100644
--- a/extra/pom.xml
+++ b/extra/pom.xml
@@ -11,13 +11,14 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.gmf-tooling</groupId>
<artifactId>extra</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<parent>
<groupId>org.eclipse.gmf-tooling</groupId>
<artifactId>parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- <relativePath>../</relativePath>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../build</relativePath>
</parent>
<modules>
diff --git a/features/pom.xml b/features/pom.xml
index c1d8d9e72..210745ea8 100644
--- a/features/pom.xml
+++ b/features/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.eclipse.gmf-tooling</groupId>
- <artifactId>parent</artifactId>
+ <artifactId>eclipse</artifactId>
<version>3.0.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
diff --git a/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/Activator.java b/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/Activator.java
index feec5c59c..170ac753e 100644
--- a/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/Activator.java
+++ b/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/Activator.java
@@ -1,6 +1,7 @@
package org.eclipse.gmf.codegen.xtend.ui;
import org.eclipse.gmf.codegen.util.GMFGeneratorModule;
+import org.eclipse.gmf.codegen.util.GMFGeneratorUIModule;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.xtext.util.Modules2;
import org.osgi.framework.BundleContext;
diff --git a/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/GMFGeneratorUIModule.java b/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/GMFGeneratorUIModule.java
index 8ac1a2604..e1a73c86d 100644
--- a/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/GMFGeneratorUIModule.java
+++ b/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/GMFGeneratorUIModule.java
@@ -1,7 +1,8 @@
package org.eclipse.gmf.codegen.xtend.ui;
-import org.eclipse.xtext.service.AbstractGenericModule;
-
-public class GMFGeneratorUIModule extends AbstractGenericModule {
+/**
+ * Use {@link org.eclipse.gmf.codegen.util.GMFGeneratorUIModule}
+ */
+public class GMFGeneratorUIModule extends org.eclipse.gmf.codegen.util.GMFGeneratorUIModule {
}
diff --git a/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/CodegenEmittersWithXtend2.java b/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/CodegenEmittersWithXtend2.java
index e30cb2b1a..cbf7ce2aa 100644
--- a/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/CodegenEmittersWithXtend2.java
+++ b/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/CodegenEmittersWithXtend2.java
@@ -1,23 +1,12 @@
package org.eclipse.gmf.codegen.xtend.ui.handlers;
-import java.util.List;
-
import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.gmf.codegen.util.CodegenEmitters;
-import org.eclipse.gmf.codegen.util.ExtensionTemplatesProviderImpl;
-import org.eclipse.gmf.codegen.util.GMFGeneratorModule;
-import org.eclipse.gmf.codegen.util.IExtensionTemplatesProvider;
-import org.eclipse.gmf.common.UnexpectedBehaviourException;
-import org.eclipse.gmf.internal.common.codegen.JavaClassEmitter;
-
-import com.google.inject.Guice;
-import com.google.inject.Injector;
-
-public class CodegenEmittersWithXtend2 extends CodegenEmitters {
- private final Injector myInjector;
-
- private IExtensionTemplatesProvider myExtensionTemplateProvider = null;
+/**
+ * Use {@link org.eclipse.gmf.codegen.util.CodegenEmittersWithXtend2}
+ */
+@Deprecated
+public class CodegenEmittersWithXtend2 extends org.eclipse.gmf.codegen.util.CodegenEmittersWithXtend2 {
public CodegenEmittersWithXtend2(GenEditorGenerator genModel) {
this(!genModel.isDynamicTemplates(), genModel.getTemplateDirectory(), genModel.getModelAccess() != null);
@@ -25,76 +14,5 @@ public class CodegenEmittersWithXtend2 extends CodegenEmitters {
public CodegenEmittersWithXtend2(boolean useBaseTemplatesOnly, String templateDirectory, boolean includeDynamicModelTemplates) {
super(useBaseTemplatesOnly, templateDirectory, includeDynamicModelTemplates);
- if (templateDirectory != null && !templateDirectory.isEmpty()) {
- myExtensionTemplateProvider = new ExtensionTemplatesProviderImpl(templateDirectory,!useBaseTemplatesOnly);
- }
- myInjector = Guice.createInjector(new GMFGeneratorModule(myExtensionTemplateProvider));
- }
-
- //-----------------------------------------------------------------------------------------
-
- /**
- * FIXME: [MG] make separate xtend templates calling shared code, not vise versa
- */
- @Override
- public JavaClassEmitter getTextNonResizableEditPolicyEmitter() throws UnexpectedBehaviourException {
- return getXtendEmitter("xpt::diagram::editpolicies::TextNonResizableEditPolicy", "TextNonResizableEditPolicy"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * FIXME: [MG] make separate xtend templates calling shared code, not vise versa
- */
- @Override
- public JavaClassEmitter getTextSelectionEditPolicyEmitter() throws UnexpectedBehaviourException {
- return getXtendEmitter("xpt::diagram::editpolicies::TextSelectionEditPolicy", "TextSelectionEditPolicy"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- @Override
- public JavaClassEmitter getPropertySheetLabelProviderEmitter() throws UnexpectedBehaviourException {
- return getXtendEmitter("xpt::propsheet::LabelProvider", "LabelProvider"); //$NON-NLS-1$
- }
-
- @Override
- public JavaClassEmitter getPropertySectionEmitter() throws UnexpectedBehaviourException {
- return getXtendEmitter("xpt::propsheet::PropertySection", "PropertySection"); //$NON-NLS-1$
- }
-
- @Override
- public JavaClassEmitter getModelAccessFacilityEmitter() {
- return getXtendEmitter("metamodel::Facility", "Main");
- }
-
- private JavaClassEmitter getXtendEmitter(String templateFqn, String mainMethod) {
- String classFqn = templateFqn.replace("::", ".");
- Class<?> clazz = null;
- try {
- clazz = Class.forName(classFqn);
- } catch (ClassNotFoundException e) {
- if (myExtensionTemplateProvider != null) {
- List<Class<?>> customClasses = myExtensionTemplateProvider.getCustomTemplateClasses();
- for (Class<?> _class : customClasses) {
- String name = _class.getName();
- if (name.equals(classFqn)) {
- clazz = _class;
- break;
- }
- }
- }
- if (clazz == null) {
- throw new IllegalStateException("Can't load: " + classFqn, e);
- }
- }
- return new Xtend2ClassEmitter(myInjector, clazz, mainMethod);
- }
-
- public void disposeEmitters() {
- if (myExtensionTemplateProvider != null) {
- myExtensionTemplateProvider.dispose();
- }
- }
-
- @Override
- protected JavaClassEmitter createJavaClassEmitter(String templateName, String mainMethod) {
- return getXtendEmitter(templateName, mainMethod);
}
}
diff --git a/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/ExecuteTemplatesOperationWithXtend2.java b/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/ExecuteTemplatesOperationWithXtend2.java
index 934490fff..532786746 100644
--- a/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/ExecuteTemplatesOperationWithXtend2.java
+++ b/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/ExecuteTemplatesOperationWithXtend2.java
@@ -1,5 +1,6 @@
package org.eclipse.gmf.codegen.xtend.ui.handlers;
+import org.eclipse.gmf.codegen.util.GeneratorWithXtend2;
import org.eclipse.gmf.internal.codegen.popup.actions.ExecuteTemplatesOperation;
import org.eclipse.gmf.internal.common.codegen.GeneratorBase;
diff --git a/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/GeneratorTextEmitter.java b/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/GeneratorTextEmitter.java
index 601db499f..677e480c4 100644
--- a/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/GeneratorTextEmitter.java
+++ b/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/GeneratorTextEmitter.java
@@ -1,11 +1,9 @@
package org.eclipse.gmf.codegen.xtend.ui.handlers;
-import org.eclipse.gmf.internal.common.codegen.TextEmitter;
-
/**
- * FIXME: [MG] Merging artifact, allows to merge {@link CodegenEmittersWithXtend2} without introducing breaking changes
- * to gmf.common
+ * Use {@link org.eclipse.gmf.codegen.util.GeneratorTextEmitter}
*/
-public interface GeneratorTextEmitter extends TextEmitter {
+@Deprecated
+public interface GeneratorTextEmitter extends org.eclipse.gmf.codegen.util.GeneratorTextEmitter {
}
diff --git a/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/GeneratorWithXtend2.java b/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/GeneratorWithXtend2.java
index de4877ae5..60ee9a5ef 100644
--- a/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/GeneratorWithXtend2.java
+++ b/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/GeneratorWithXtend2.java
@@ -1,41 +1,24 @@
package org.eclipse.gmf.codegen.xtend.ui.handlers;
import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.gmf.codegen.util.Generator;
-import org.eclipse.gmf.common.UnexpectedBehaviourException;
import org.eclipse.gmf.internal.common.codegen.CodeFormatterFactory;
-public class GeneratorWithXtend2 extends Generator {
-
- private CodegenEmittersWithXtend2 myEmitters;
+/**
+ * Use {@link org.eclipse.gmf.codegen.util.GeneratorWithXtend2}
+ */
+@Deprecated
+public class GeneratorWithXtend2 extends org.eclipse.gmf.codegen.util.GeneratorWithXtend2 {
public GeneratorWithXtend2(GenEditorGenerator genModel) {
- this(genModel, new CodegenEmittersWithXtend2(genModel));
+ super(genModel, new CodegenEmittersWithXtend2(genModel));
}
public GeneratorWithXtend2(GenEditorGenerator genModel, CodegenEmittersWithXtend2 codegenEmitters) {
- this(genModel, codegenEmitters, CodeFormatterFactory.DEFAULT);
+ super(genModel, codegenEmitters, CodeFormatterFactory.DEFAULT);
}
public GeneratorWithXtend2(GenEditorGenerator genModel, CodegenEmittersWithXtend2 codegenEmitters, CodeFormatterFactory codeFormatterFactory) {
super(genModel, codegenEmitters, codeFormatterFactory);
- myEmitters = codegenEmitters;
- }
-
- protected void customRun() throws InterruptedException, UnexpectedBehaviourException {
- try {
- super.customRun();
- } finally {
- hookGenerationCompleted();
- }
- }
-
- protected CodegenEmittersWithXtend2 getEmitters() {
- return myEmitters;
- }
-
- protected void hookGenerationCompleted() {
- myEmitters.disposeEmitters();
}
}
diff --git a/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/Xtend2ClassEmitter.java b/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/Xtend2ClassEmitter.java
index dc4bcb5a9..334ff6795 100644
--- a/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/Xtend2ClassEmitter.java
+++ b/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/Xtend2ClassEmitter.java
@@ -1,37 +1,13 @@
package org.eclipse.gmf.codegen.xtend.ui.handlers;
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.gmf.common.UnexpectedBehaviourException;
-import org.eclipse.gmf.internal.common.codegen.JavaClassEmitter;
-
import com.google.inject.Injector;
-
-public class Xtend2ClassEmitter extends Xtend2Emitter implements JavaClassEmitter {
+/**
+ * Use {@link org.eclipse.gmf.codegen.util.Xtend2ClassEmitter}
+ */
+public class Xtend2ClassEmitter extends org.eclipse.gmf.codegen.util.Xtend2ClassEmitter {
public Xtend2ClassEmitter(Injector injector, Class<?> clazz, String methodName) {
super(injector, clazz, methodName);
}
-
- @Override
- public String getQualifiedClassName(Object... input) throws UnexpectedBehaviourException {
- return getQualifiedClassName("qualifiedClassName", input);
- }
-
- @Override
- public String getQualifiedClassName(String FQNMethodName, Object... input) throws UnexpectedBehaviourException {
- return getText(FQNMethodName, input);
- }
-
- private String getText(String method, Object... input) throws UnexpectedBehaviourException {
- try {
- return this.generate(new NullProgressMonitor(), method, input);
- } catch (InvocationTargetException e) {
- throw new UnexpectedBehaviourException("Invocation method exception "+ method + " on class " + getTemplateClass().getName(), e);
- } catch (InterruptedException e) {
- throw new UnexpectedBehaviourException("Execute method exception "+ method + " on class " + getTemplateClass().getName(), e);
- }
- }
}
diff --git a/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/Xtend2Emitter.java b/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/Xtend2Emitter.java
index 48e8dd823..19841b5a5 100644
--- a/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/Xtend2Emitter.java
+++ b/plugins/org.eclipse.gmf.codegen.xtend.ui/src/org/eclipse/gmf/codegen/xtend/ui/handlers/Xtend2Emitter.java
@@ -1,110 +1,10 @@
package org.eclipse.gmf.codegen.xtend.ui.handlers;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gmf.common.UnexpectedBehaviourException;
-import org.eclipse.gmf.internal.common.codegen.TextEmitter;
-
import com.google.inject.Injector;
-public class Xtend2Emitter implements TextEmitter {
-
- private final Class<?> myXtendGenerator;
-
- private final String myMethodName;
-
- private final Injector myInjector;
+public class Xtend2Emitter extends org.eclipse.gmf.codegen.util.Xtend2Emitter {
public Xtend2Emitter(Injector injector, Class<?> clazz, String methodName) {
- myInjector = injector;
- myXtendGenerator = clazz;
- myMethodName = methodName;
- }
-
- @Override
- public String generate(IProgressMonitor monitor, Object[] arguments) throws InterruptedException, InvocationTargetException, UnexpectedBehaviourException {
- return generate(monitor, myMethodName, arguments);
- }
-
- protected String generate(IProgressMonitor monitor, String methodName, Object[] arguments) throws InterruptedException, InvocationTargetException, UnexpectedBehaviourException {
- if (monitor != null && monitor.isCanceled()) {
- throw new InterruptedException();
- }
- if (arguments.length > 1) {
- List<Object> fixedArgs = new LinkedList<Object>();
- fixedArgs.add(arguments[0]);
- for (int i = 1; i < arguments.length; i++) {
- fixedArgs.add(arguments[i]);
- }
- arguments = fixedArgs.toArray();
- }
- Object generator = instantiateGenerator();
- Method method = getGeneratorMethod(arguments.length, methodName);
- Object result;
- try {
- result = method.invoke(generator, arguments);
- } catch (IllegalArgumentException e) {
- throw new UnexpectedBehaviourException("Invocation failed for: " + this, e);
- } catch (IllegalAccessException e) {
- throw new UnexpectedBehaviourException("Invocation failed for: " + this, e);
- }
-
- if (result == null) {
- throw new UnexpectedBehaviourException("Xtend generator returned null for " + this);
- }
- return String.valueOf(result);
- }
-
- private Object instantiateGenerator() throws UnexpectedBehaviourException {
- Object instance = myInjector.getInstance(myXtendGenerator);
- if (instance == null) {
- throw new UnexpectedBehaviourException("Can't instantiate Xtend generator object " + this);
- }
- return instance;
- }
-
- private Method getGeneratorMethod(int paramsCount, String methodName) throws UnexpectedBehaviourException {
- Method[] allMethods;
- try {
- allMethods = myXtendGenerator.getDeclaredMethods();
- } catch (SecurityException e) {
- throw new UnexpectedBehaviourException("For : " + this, e);
- }
- Method candidate = null;
- for (Method next : allMethods) {
- if (methodName.equals(next.getName()) && next.getParameterTypes().length == paramsCount) {
- if (candidate != null) {
- throw new UnexpectedBehaviourException("More than 1 method found for " + this + ", " + candidate + " vs " + next);
- }
- candidate = next;
- }
- }
- if (candidate == null) {
- throw new UnexpectedBehaviourException("No such method (with params count = " + paramsCount + ") for : " + this);
- }
- return candidate;
- }
-
- @Override
- public String toString() {
- return "xtend2:[" + myXtendGenerator.getSimpleName() + "#" + myMethodName + "]";
+ super(injector, clazz, methodName);
}
-
- protected Object extractTarget(Object[] arguments) {
- assert arguments != null && arguments.length > 0;
- return arguments[0];
- }
-
- protected Injector getInjector() {
- return myInjector;
- }
-
- protected Class<?> getTemplateClass() {
- return myXtendGenerator;
- }
-
} \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen.xtend/src/org/eclipse/gmf/codegen/util/CodegenEmittersWithXtend2.java b/plugins/org.eclipse.gmf.codegen.xtend/src/org/eclipse/gmf/codegen/util/CodegenEmittersWithXtend2.java
new file mode 100644
index 000000000..dd643d8c2
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen.xtend/src/org/eclipse/gmf/codegen/util/CodegenEmittersWithXtend2.java
@@ -0,0 +1,97 @@
+package org.eclipse.gmf.codegen.util;
+
+import java.util.List;
+
+import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
+import org.eclipse.gmf.codegen.util.CodegenEmitters;
+import org.eclipse.gmf.common.UnexpectedBehaviourException;
+import org.eclipse.gmf.internal.common.codegen.JavaClassEmitter;
+
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+public class CodegenEmittersWithXtend2 extends CodegenEmitters {
+
+ private final Injector myInjector;
+
+ private IExtensionTemplatesProvider myExtensionTemplateProvider = null;
+
+ public CodegenEmittersWithXtend2(GenEditorGenerator genModel) {
+ this(!genModel.isDynamicTemplates(), genModel.getTemplateDirectory(), genModel.getModelAccess() != null);
+ }
+
+ public CodegenEmittersWithXtend2(boolean useBaseTemplatesOnly, String templateDirectory, boolean includeDynamicModelTemplates) {
+ super(useBaseTemplatesOnly, templateDirectory, includeDynamicModelTemplates);
+ if (templateDirectory != null && !templateDirectory.isEmpty()) {
+ myExtensionTemplateProvider = new ExtensionTemplatesProviderImpl(templateDirectory,!useBaseTemplatesOnly);
+ }
+ myInjector = Guice.createInjector(new GMFGeneratorModule(myExtensionTemplateProvider));
+ }
+
+ //-----------------------------------------------------------------------------------------
+
+ /**
+ * FIXME: [MG] make separate xtend templates calling shared code, not vise versa
+ */
+ @Override
+ public JavaClassEmitter getTextNonResizableEditPolicyEmitter() throws UnexpectedBehaviourException {
+ return getXtendEmitter("xpt::diagram::editpolicies::TextNonResizableEditPolicy", "TextNonResizableEditPolicy"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * FIXME: [MG] make separate xtend templates calling shared code, not vise versa
+ */
+ @Override
+ public JavaClassEmitter getTextSelectionEditPolicyEmitter() throws UnexpectedBehaviourException {
+ return getXtendEmitter("xpt::diagram::editpolicies::TextSelectionEditPolicy", "TextSelectionEditPolicy"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Override
+ public JavaClassEmitter getPropertySheetLabelProviderEmitter() throws UnexpectedBehaviourException {
+ return getXtendEmitter("xpt::propsheet::LabelProvider", "LabelProvider"); //$NON-NLS-1$
+ }
+
+ @Override
+ public JavaClassEmitter getPropertySectionEmitter() throws UnexpectedBehaviourException {
+ return getXtendEmitter("xpt::propsheet::PropertySection", "PropertySection"); //$NON-NLS-1$
+ }
+
+ @Override
+ public JavaClassEmitter getModelAccessFacilityEmitter() {
+ return getXtendEmitter("metamodel::Facility", "Main");
+ }
+
+ private JavaClassEmitter getXtendEmitter(String templateFqn, String mainMethod) {
+ String classFqn = templateFqn.replace("::", ".");
+ Class<?> clazz = null;
+ try {
+ clazz = Class.forName(classFqn);
+ } catch (ClassNotFoundException e) {
+ if (myExtensionTemplateProvider != null) {
+ List<Class<?>> customClasses = myExtensionTemplateProvider.getCustomTemplateClasses();
+ for (Class<?> _class : customClasses) {
+ String name = _class.getName();
+ if (name.equals(classFqn)) {
+ clazz = _class;
+ break;
+ }
+ }
+ }
+ if (clazz == null) {
+ throw new IllegalStateException("Can't load: " + classFqn, e);
+ }
+ }
+ return new Xtend2ClassEmitter(myInjector, clazz, mainMethod);
+ }
+
+ public void disposeEmitters() {
+ if (myExtensionTemplateProvider != null) {
+ myExtensionTemplateProvider.dispose();
+ }
+ }
+
+ @Override
+ protected JavaClassEmitter createJavaClassEmitter(String templateName, String mainMethod) {
+ return getXtendEmitter(templateName, mainMethod);
+ }
+}
diff --git a/plugins/org.eclipse.gmf.codegen.xtend/src/org/eclipse/gmf/codegen/util/GMFGeneratorUIModule.java b/plugins/org.eclipse.gmf.codegen.xtend/src/org/eclipse/gmf/codegen/util/GMFGeneratorUIModule.java
new file mode 100644
index 000000000..8d3c2c20f
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen.xtend/src/org/eclipse/gmf/codegen/util/GMFGeneratorUIModule.java
@@ -0,0 +1,7 @@
+package org.eclipse.gmf.codegen.util;
+
+import org.eclipse.xtext.service.AbstractGenericModule;
+
+public class GMFGeneratorUIModule extends AbstractGenericModule {
+
+}
diff --git a/plugins/org.eclipse.gmf.codegen.xtend/src/org/eclipse/gmf/codegen/util/GeneratorTextEmitter.java b/plugins/org.eclipse.gmf.codegen.xtend/src/org/eclipse/gmf/codegen/util/GeneratorTextEmitter.java
new file mode 100644
index 000000000..92100b0d3
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen.xtend/src/org/eclipse/gmf/codegen/util/GeneratorTextEmitter.java
@@ -0,0 +1,11 @@
+package org.eclipse.gmf.codegen.util;
+
+import org.eclipse.gmf.internal.common.codegen.TextEmitter;
+
+/**
+ * FIXME: [MG] Merging artifact, allows to merge {@link CodegenEmittersWithXtend2} without introducing breaking changes
+ * to gmf.common
+ */
+public interface GeneratorTextEmitter extends TextEmitter {
+
+}
diff --git a/plugins/org.eclipse.gmf.codegen.xtend/src/org/eclipse/gmf/codegen/util/GeneratorWithXtend2.java b/plugins/org.eclipse.gmf.codegen.xtend/src/org/eclipse/gmf/codegen/util/GeneratorWithXtend2.java
new file mode 100644
index 000000000..ac49ab39c
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen.xtend/src/org/eclipse/gmf/codegen/util/GeneratorWithXtend2.java
@@ -0,0 +1,41 @@
+package org.eclipse.gmf.codegen.util;
+
+import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
+import org.eclipse.gmf.codegen.util.Generator;
+import org.eclipse.gmf.common.UnexpectedBehaviourException;
+import org.eclipse.gmf.internal.common.codegen.CodeFormatterFactory;
+
+public class GeneratorWithXtend2 extends Generator {
+
+ private CodegenEmittersWithXtend2 myEmitters;
+
+ public GeneratorWithXtend2(GenEditorGenerator genModel) {
+ this(genModel, new CodegenEmittersWithXtend2(genModel));
+ }
+
+ public GeneratorWithXtend2(GenEditorGenerator genModel, CodegenEmittersWithXtend2 codegenEmitters) {
+ this(genModel, codegenEmitters, CodeFormatterFactory.DEFAULT);
+ }
+
+ public GeneratorWithXtend2(GenEditorGenerator genModel, CodegenEmittersWithXtend2 codegenEmitters, CodeFormatterFactory codeFormatterFactory) {
+ super(genModel, codegenEmitters, codeFormatterFactory);
+ myEmitters = codegenEmitters;
+ }
+
+ protected void customRun() throws InterruptedException, UnexpectedBehaviourException {
+ try {
+ super.customRun();
+ } finally {
+ hookGenerationCompleted();
+ }
+ }
+
+ protected CodegenEmittersWithXtend2 getEmitters() {
+ return myEmitters;
+ }
+
+ protected void hookGenerationCompleted() {
+ myEmitters.disposeEmitters();
+ }
+
+}
diff --git a/plugins/org.eclipse.gmf.codegen.xtend/src/org/eclipse/gmf/codegen/util/Xtend2ClassEmitter.java b/plugins/org.eclipse.gmf.codegen.xtend/src/org/eclipse/gmf/codegen/util/Xtend2ClassEmitter.java
new file mode 100644
index 000000000..1ecbd3d6f
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen.xtend/src/org/eclipse/gmf/codegen/util/Xtend2ClassEmitter.java
@@ -0,0 +1,37 @@
+package org.eclipse.gmf.codegen.util;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.gmf.common.UnexpectedBehaviourException;
+import org.eclipse.gmf.internal.common.codegen.JavaClassEmitter;
+
+import com.google.inject.Injector;
+
+
+public class Xtend2ClassEmitter extends Xtend2Emitter implements JavaClassEmitter {
+
+ public Xtend2ClassEmitter(Injector injector, Class<?> clazz, String methodName) {
+ super(injector, clazz, methodName);
+ }
+
+ @Override
+ public String getQualifiedClassName(Object... input) throws UnexpectedBehaviourException {
+ return getQualifiedClassName("qualifiedClassName", input);
+ }
+
+ @Override
+ public String getQualifiedClassName(String FQNMethodName, Object... input) throws UnexpectedBehaviourException {
+ return getText(FQNMethodName, input);
+ }
+
+ private String getText(String method, Object... input) throws UnexpectedBehaviourException {
+ try {
+ return this.generate(new NullProgressMonitor(), method, input);
+ } catch (InvocationTargetException e) {
+ throw new UnexpectedBehaviourException("Invocation method exception "+ method + " on class " + getTemplateClass().getName(), e);
+ } catch (InterruptedException e) {
+ throw new UnexpectedBehaviourException("Execute method exception "+ method + " on class " + getTemplateClass().getName(), e);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.gmf.codegen.xtend/src/org/eclipse/gmf/codegen/util/Xtend2Emitter.java b/plugins/org.eclipse.gmf.codegen.xtend/src/org/eclipse/gmf/codegen/util/Xtend2Emitter.java
new file mode 100644
index 000000000..fca3b7d18
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen.xtend/src/org/eclipse/gmf/codegen/util/Xtend2Emitter.java
@@ -0,0 +1,110 @@
+package org.eclipse.gmf.codegen.util;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.gmf.common.UnexpectedBehaviourException;
+import org.eclipse.gmf.internal.common.codegen.TextEmitter;
+
+import com.google.inject.Injector;
+
+public class Xtend2Emitter implements TextEmitter {
+
+ private final Class<?> myXtendGenerator;
+
+ private final String myMethodName;
+
+ private final Injector myInjector;
+
+ public Xtend2Emitter(Injector injector, Class<?> clazz, String methodName) {
+ myInjector = injector;
+ myXtendGenerator = clazz;
+ myMethodName = methodName;
+ }
+
+ @Override
+ public String generate(IProgressMonitor monitor, Object[] arguments) throws InterruptedException, InvocationTargetException, UnexpectedBehaviourException {
+ return generate(monitor, myMethodName, arguments);
+ }
+
+ protected String generate(IProgressMonitor monitor, String methodName, Object[] arguments) throws InterruptedException, InvocationTargetException, UnexpectedBehaviourException {
+ if (monitor != null && monitor.isCanceled()) {
+ throw new InterruptedException();
+ }
+ if (arguments.length > 1) {
+ List<Object> fixedArgs = new LinkedList<Object>();
+ fixedArgs.add(arguments[0]);
+ for (int i = 1; i < arguments.length; i++) {
+ fixedArgs.add(arguments[i]);
+ }
+ arguments = fixedArgs.toArray();
+ }
+ Object generator = instantiateGenerator();
+ Method method = getGeneratorMethod(arguments.length, methodName);
+ Object result;
+ try {
+ result = method.invoke(generator, arguments);
+ } catch (IllegalArgumentException e) {
+ throw new UnexpectedBehaviourException("Invocation failed for: " + this, e);
+ } catch (IllegalAccessException e) {
+ throw new UnexpectedBehaviourException("Invocation failed for: " + this, e);
+ }
+
+ if (result == null) {
+ throw new UnexpectedBehaviourException("Xtend generator returned null for " + this);
+ }
+ return String.valueOf(result);
+ }
+
+ private Object instantiateGenerator() throws UnexpectedBehaviourException {
+ Object instance = myInjector.getInstance(myXtendGenerator);
+ if (instance == null) {
+ throw new UnexpectedBehaviourException("Can't instantiate Xtend generator object " + this);
+ }
+ return instance;
+ }
+
+ private Method getGeneratorMethod(int paramsCount, String methodName) throws UnexpectedBehaviourException {
+ Method[] allMethods;
+ try {
+ allMethods = myXtendGenerator.getDeclaredMethods();
+ } catch (SecurityException e) {
+ throw new UnexpectedBehaviourException("For : " + this, e);
+ }
+ Method candidate = null;
+ for (Method next : allMethods) {
+ if (methodName.equals(next.getName()) && next.getParameterTypes().length == paramsCount) {
+ if (candidate != null) {
+ throw new UnexpectedBehaviourException("More than 1 method found for " + this + ", " + candidate + " vs " + next);
+ }
+ candidate = next;
+ }
+ }
+ if (candidate == null) {
+ throw new UnexpectedBehaviourException("No such method (with params count = " + paramsCount + ") for : " + this);
+ }
+ return candidate;
+ }
+
+ @Override
+ public String toString() {
+ return "xtend2:[" + myXtendGenerator.getSimpleName() + "#" + myMethodName + "]";
+ }
+
+ protected Object extractTarget(Object[] arguments) {
+ assert arguments != null && arguments.length > 0;
+ return arguments[0];
+ }
+
+ protected Injector getInjector() {
+ return myInjector;
+ }
+
+ protected Class<?> getTemplateClass() {
+ return myXtendGenerator;
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.common/META-INF/MANIFEST.MF b/plugins/org.eclipse.gmf.common/META-INF/MANIFEST.MF
index ce72d7c0d..63fef645c 100644
--- a/plugins/org.eclipse.gmf.common/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.gmf.common/META-INF/MANIFEST.MF
@@ -8,7 +8,7 @@ Export-Package: org.eclipse.gmf.common,
org.eclipse.gmf.common.codegen,
org.eclipse.gmf.internal.codegen.dispatch;x-friends:="org.eclipse.gmf.codegen,org.eclipse.gmf.graphdef.codegen,org.eclipse.gmf.codegen.lite",
org.eclipse.gmf.internal.common;x-friends:="org.eclipse.gmf.codegen.edit,org.eclipse.gmf.graphdef.edit,org.eclipse.gmf.map.edit,org.eclipse.gmf.tooldef.edit,org.eclipse.gmf.bridge.trace,org.eclipse.gmf.bridge.ui,org.eclipse.gmf.bridge,org.eclipse.gmf.tests,org.eclipse.gmf.bridge.ui.dashboard,org.eclipse.gmf.codegen.ui,org.eclipse.gmf.codegen.lite.ui,org.eclipse.gmf.codegen,org.eclipse.gmf.map,org.eclipse.gmf.graphdef,org.eclipse.gmf.tooldef",
- org.eclipse.gmf.internal.common.codegen;x-friends:="org.eclipse.gmf.codegen,org.eclipse.gmf.graphdef.codegen,org.eclipse.gmf.bridge,org.eclipse.gmf.codegen.lite,org.eclipse.gmf.tests,org.eclipse.gmf.codegen.ui,org.eclipse.gmf.codegen.lite.ui,org.eclipse.gmf.tests.lite,org.eclipse.gmf.graphdef.codegen.ui,org.eclipse.gmf.codegen.xtend.ui, org.eclipse.gmf.tooling.codegen.launcher",
+ org.eclipse.gmf.internal.common.codegen;x-friends:="org.eclipse.gmf.codegen,org.eclipse.gmf.graphdef.codegen,org.eclipse.gmf.bridge,org.eclipse.gmf.codegen.lite,org.eclipse.gmf.tests,org.eclipse.gmf.codegen.ui,org.eclipse.gmf.codegen.lite.ui,org.eclipse.gmf.tests.lite,org.eclipse.gmf.graphdef.codegen.ui,org.eclipse.gmf.codegen.xtend.ui, org.eclipse.gmf.codegen.xtend, org.eclipse.gmf.tooling.codegen.launcher",
org.eclipse.gmf.internal.common.migrate;x-friends:="org.eclipse.gmf.codegen.ui,org.eclipse.gmf.tests,org.eclipse.gmf.codegen,org.eclipse.gmf.map,org.eclipse.gmf.bridge.ui,org.eclipse.gmf.graphdef",
org.eclipse.gmf.internal.common.reconcile;x-friends:="org.eclipse.gmf.tests,org.eclipse.gmf.codegen,org.eclipse.gmf.bridge.ui",
org.eclipse.gmf.internal.common.ui
@@ -24,7 +24,6 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.3.0,4.0.0)",
org.eclipse.jdt.core;bundle-version="[3.3.0,4.0.0)",
org.eclipse.jface.text;bundle-version="[3.3.0,4.0.0)",
org.eclipse.jface;bundle-version="[3.3.0,4.0.0)",
- org.eclipse.jdt.ui;bundle-version="[3.3.0,4.0.0)",
org.eclipse.gmf.xpand;bundle-version="[2.1.0,3.0.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Activator: org.eclipse.gmf.internal.common.Activator
diff --git a/plugins/org.eclipse.gmf.common/src/org/eclipse/gmf/internal/common/codegen/OrganizeImportsPostprocessor.java b/plugins/org.eclipse.gmf.common/src/org/eclipse/gmf/internal/common/codegen/OrganizeImportsPostprocessor.java
index 8277118ff..6b28bdd9e 100644
--- a/plugins/org.eclipse.gmf.common/src/org/eclipse/gmf/internal/common/codegen/OrganizeImportsPostprocessor.java
+++ b/plugins/org.eclipse.gmf.common/src/org/eclipse/gmf/internal/common/codegen/OrganizeImportsPostprocessor.java
@@ -20,11 +20,14 @@ import java.util.Iterator;
import java.util.List;
import java.util.Set;
+import org.eclipse.core.resources.ProjectScope;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.gmf.internal.common.Activator;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaProject;
@@ -38,7 +41,6 @@ import org.eclipse.jdt.core.dom.Name;
import org.eclipse.jdt.core.dom.QualifiedName;
import org.eclipse.jdt.core.dom.SimpleName;
import org.eclipse.jdt.core.dom.rewrite.ImportRewrite;
-import org.eclipse.jdt.ui.PreferenceConstants;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.IDocument;
@@ -387,4 +389,32 @@ public class OrganizeImportsPostprocessor {
return result;
}
+ /**
+ * org.eclipse.gmf.common should not depend on org.eclipse.jdt.ui
+ */
+ private static class PreferenceConstants {
+
+ public static final String JDT_UI = "org.eclipse.jdt.ui"; //$NON-NLS-1$
+
+ public static final String ORGIMPORTS_IMPORTORDER= "org.eclipse.jdt.ui.importorder"; //$NON-NLS-1$
+
+ public static final String ORGIMPORTS_ONDEMANDTHRESHOLD= "org.eclipse.jdt.ui.ondemandthreshold"; //$NON-NLS-1$
+
+ public static final String ORGIMPORTS_STATIC_ONDEMANDTHRESHOLD= "org.eclipse.jdt.ui.staticondemandthreshold"; //$NON-NLS-1$
+
+ public static String getPreference(String key, IJavaProject project) {
+ String val;
+ if (project != null) {
+ val= new ProjectScope(project.getProject()).getNode(JDT_UI).get(key, null);
+ if (val != null) {
+ return val;
+ }
+ }
+ val= InstanceScope.INSTANCE.getNode(JDT_UI).get(key, null);
+ if (val != null) {
+ return val;
+ }
+ return DefaultScope.INSTANCE.getNode(JDT_UI).get(key, null);
+ }
+ }
}
diff --git a/plugins/org.eclipse.gmf.tooling.codegen.launcher/META-INF/MANIFEST.MF b/plugins/org.eclipse.gmf.tooling.codegen.launcher/META-INF/MANIFEST.MF
index f740d99bc..e8da1488b 100644
--- a/plugins/org.eclipse.gmf.tooling.codegen.launcher/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.gmf.tooling.codegen.launcher/META-INF/MANIFEST.MF
@@ -6,13 +6,12 @@ Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: %providerName
Bundle-Activator: org.eclipse.gmf.tooling.codegen.launcher.Activator
Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.ui.workbench,
org.eclipse.pde.launching,
org.eclipse.debug.core,
org.eclipse.gmf.common,
org.eclipse.gmf.codegen,
org.eclipse.jdt.core,
- org.eclipse.gmf.codegen.xtend.ui
+ org.eclipse.gmf.codegen.xtend
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.gmf.tooling.codegen.launcher/src/org/eclipse/gmf/tooling/codegen/launcher/Activator.java b/plugins/org.eclipse.gmf.tooling.codegen.launcher/src/org/eclipse/gmf/tooling/codegen/launcher/Activator.java
index 9ea6b65a5..0506d8d8a 100644
--- a/plugins/org.eclipse.gmf.tooling.codegen.launcher/src/org/eclipse/gmf/tooling/codegen/launcher/Activator.java
+++ b/plugins/org.eclipse.gmf.tooling.codegen.launcher/src/org/eclipse/gmf/tooling/codegen/launcher/Activator.java
@@ -1,14 +1,14 @@
package org.eclipse.gmf.tooling.codegen.launcher;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
-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 {
+public class Activator extends Plugin {
// The plug-in ID
public static final String PLUGIN_ID = "org.eclipse.gmf.tooling.launcher"; //$NON-NLS-1$
diff --git a/plugins/org.eclipse.gmf.tooling.codegen.launcher/src/org/eclipse/gmf/tooling/codegen/launcher/GMFGenerateApplication.java b/plugins/org.eclipse.gmf.tooling.codegen.launcher/src/org/eclipse/gmf/tooling/codegen/launcher/GMFGenerateApplication.java
index 793a4d23a..887d461c7 100644
--- a/plugins/org.eclipse.gmf.tooling.codegen.launcher/src/org/eclipse/gmf/tooling/codegen/launcher/GMFGenerateApplication.java
+++ b/plugins/org.eclipse.gmf.tooling.codegen.launcher/src/org/eclipse/gmf/tooling/codegen/launcher/GMFGenerateApplication.java
@@ -12,8 +12,8 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.gmf.codegen.xtend.ui.handlers.CodegenEmittersWithXtend2;
-import org.eclipse.gmf.codegen.xtend.ui.handlers.GeneratorWithXtend2;
+import org.eclipse.gmf.codegen.util.CodegenEmittersWithXtend2;
+import org.eclipse.gmf.codegen.util.GeneratorWithXtend2;
import org.eclipse.gmf.internal.common.codegen.CodeFormatterFactory;
import org.eclipse.gmf.internal.common.codegen.GeneratorBase;
import org.eclipse.gmf.tooling.codegen.launcher.utils.GMFGeneratorUtil;
diff --git a/plugins/pom.xml b/plugins/pom.xml
index a55680f84..6f0d68293 100644
--- a/plugins/pom.xml
+++ b/plugins/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.eclipse.gmf-tooling</groupId>
- <artifactId>parent</artifactId>
+ <artifactId>eclipse</artifactId>
<version>3.0.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
diff --git a/pom.xml b/pom.xml
index f32fb7cfa..68675af83 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,12 +13,19 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.gmf-tooling</groupId>
- <artifactId>parent</artifactId>
+ <artifactId>eclipse</artifactId>
<version>3.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Parent project for GMF Tooling build</name>
<description>Parent project for GMF Tooling build</description>
+ <parent>
+ <groupId>org.eclipse.gmf-tooling</groupId>
+ <artifactId>parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>build</relativePath>
+ </parent>
+
<prerequisites>
<maven>3.0</maven>
</prerequisites>
@@ -36,7 +43,6 @@
<module>plugins</module>
<!-- <module>gwt-plugins</module> -->
<module>examples</module>
- <module>extra</module>
<module>doc</module>
<module>features</module>
<module>tests</module>
@@ -44,35 +50,6 @@
<module>test-examples</module>
</modules>
- <mailingLists>
- <mailingList>
- <name>GMF-dev Mailing List</name>
- <post>gmf-dev@eclipse.org</post>
- <subscribe>https://dev.eclipse.org/mailman/listinfo/gmf-dev</subscribe>
- <unsubscribe>https://dev.eclipse.org/mailman/listinfo/gmf-dev</unsubscribe>
- <archive>http://dev.eclipse.org/mhonarc/lists/gmf-dev</archive>
- </mailingList>
- </mailingLists>
-
- <issueManagement>
- <url>https://bugs.eclipse.org/bugs/buglist.cgi?classification=Modeling;query_format=advanced;component=GMF-tooling;product=GMP</url>
- <system>Bugzilla</system>
- </issueManagement>
-
- <licenses>
- <license>
- <name>Eclipse Public License v1.0</name>
- <comments>
- 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.htm
- </comments>
- </license>
- </licenses>
-
<build>
<plugins>
<plugin>
diff --git a/repository/pom.xml b/repository/pom.xml
index 744413ca0..639c04da5 100644
--- a/repository/pom.xml
+++ b/repository/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.eclipse.gmf-tooling</groupId>
- <artifactId>parent</artifactId>
+ <artifactId>eclipse</artifactId>
<version>3.0.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
diff --git a/test-examples/pom.xml b/test-examples/pom.xml
index aa1711a30..a00818cf8 100644
--- a/test-examples/pom.xml
+++ b/test-examples/pom.xml
@@ -16,7 +16,7 @@
<parent>
<groupId>org.eclipse.gmf-tooling</groupId>
- <artifactId>parent</artifactId>
+ <artifactId>eclipse</artifactId>
<version>3.0.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
diff --git a/tests/org.eclipse.gmf.tooling.tests.xtend/src/org/eclipse/gmf/tooling/tests/xtend/rt/EditHelpersTestXtend.java b/tests/org.eclipse.gmf.tooling.tests.xtend/src/org/eclipse/gmf/tooling/tests/xtend/rt/EditHelpersTestXtend.java
index ef057eccd..ac4a7c8f0 100644
--- a/tests/org.eclipse.gmf.tooling.tests.xtend/src/org/eclipse/gmf/tooling/tests/xtend/rt/EditHelpersTestXtend.java
+++ b/tests/org.eclipse.gmf.tooling.tests.xtend/src/org/eclipse/gmf/tooling/tests/xtend/rt/EditHelpersTestXtend.java
@@ -40,7 +40,7 @@ import org.eclipse.gmf.codegen.gmfgen.GenTopLevelNode;
import org.eclipse.gmf.codegen.gmfgen.MetamodelType;
import org.eclipse.gmf.codegen.gmfgen.SpecializationType;
import org.eclipse.gmf.codegen.util.GMFGeneratorModule;
-import org.eclipse.gmf.codegen.xtend.ui.handlers.Xtend2Emitter;
+import org.eclipse.gmf.codegen.util.Xtend2Emitter;
import org.eclipse.gmf.common.UnexpectedBehaviourException;
import org.eclipse.gmf.internal.common.codegen.TextEmitter;
import org.eclipse.gmf.mappings.Constraint;
diff --git a/tests/org.eclipse.gmf.tooling.tests.xtend/src/org/eclipse/gmf/tooling/tests/xtend/setup/RuntimeBasedGeneratorConfigurationXtend.java b/tests/org.eclipse.gmf.tooling.tests.xtend/src/org/eclipse/gmf/tooling/tests/xtend/setup/RuntimeBasedGeneratorConfigurationXtend.java
index 4cd9cfafa..ce2b76e7e 100644
--- a/tests/org.eclipse.gmf.tooling.tests.xtend/src/org/eclipse/gmf/tooling/tests/xtend/setup/RuntimeBasedGeneratorConfigurationXtend.java
+++ b/tests/org.eclipse.gmf.tooling.tests.xtend/src/org/eclipse/gmf/tooling/tests/xtend/setup/RuntimeBasedGeneratorConfigurationXtend.java
@@ -13,8 +13,8 @@ package org.eclipse.gmf.tooling.tests.xtend.setup;
import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.gmf.codegen.xtend.ui.handlers.CodegenEmittersWithXtend2;
-import org.eclipse.gmf.codegen.xtend.ui.handlers.GeneratorWithXtend2;
+import org.eclipse.gmf.codegen.util.CodegenEmittersWithXtend2;
+import org.eclipse.gmf.codegen.util.GeneratorWithXtend2;
import org.eclipse.gmf.internal.common.codegen.GeneratorBase;
public class RuntimeBasedGeneratorConfigurationXtend extends org.eclipse.gmf.tests.setup.RuntimeBasedGeneratorConfiguration {
diff --git a/tests/pom.xml b/tests/pom.xml
index fe08bfd73..3d436b9ee 100644
--- a/tests/pom.xml
+++ b/tests/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.eclipse.gmf-tooling</groupId>
- <artifactId>parent</artifactId>
+ <artifactId>eclipse</artifactId>
<version>3.0.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

Back to the top