Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratischenko2015-12-14 12:12:35 +0000
committerGerrit Code Review @ Eclipse.org2015-12-14 14:38:36 +0000
commit4e5d60fe35f36400265700b7cdf50494c6065849 (patch)
tree4d3ae954662ea9911618ae6b4cc89fb9f0f58b54 /plugins/developer
parent5056e895d4a5efc0e7ad2981ac1c635f21d91ff7 (diff)
downloadorg.eclipse.papyrus-4e5d60fe35f36400265700b7cdf50494c6065849.tar.gz
org.eclipse.papyrus-4e5d60fe35f36400265700b7cdf50494c6065849.tar.xz
org.eclipse.papyrus-4e5d60fe35f36400265700b7cdf50494c6065849.zip
Bug 484308 - A custom templates invocation should be registered in a
gmfgen Change-Id: I71f27f405f12907d8ba708ee0029fb53f3305297 Signed-off-by: atischenko <tischenko@montages.com>
Diffstat (limited to 'plugins/developer')
-rw-r--r--plugins/developer/org.eclipse.papyrus.codegen/src/org/eclipse/papyrus/codegen/PapyrusCodegenEmitters.java4
-rw-r--r--plugins/developer/org.eclipse.papyrus.codegen/src/org/eclipse/papyrus/codegen/PapyrusExecuteTemplatesOperation.java3
-rw-r--r--plugins/developer/org.eclipse.papyrus.codegen/src/org/eclipse/papyrus/codegen/PapyrusGenerator.java48
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/VisualTypeProvider.xtend10
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/extensions.xtend2
5 files changed, 8 insertions, 59 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.codegen/src/org/eclipse/papyrus/codegen/PapyrusCodegenEmitters.java b/plugins/developer/org.eclipse.papyrus.codegen/src/org/eclipse/papyrus/codegen/PapyrusCodegenEmitters.java
index dd92268d5f5..fa080f800e6 100644
--- a/plugins/developer/org.eclipse.papyrus.codegen/src/org/eclipse/papyrus/codegen/PapyrusCodegenEmitters.java
+++ b/plugins/developer/org.eclipse.papyrus.codegen/src/org/eclipse/papyrus/codegen/PapyrusCodegenEmitters.java
@@ -23,10 +23,6 @@ public class PapyrusCodegenEmitters extends CodegenEmittersWithXtend2 {
super(useBaseTemplatesOnly, templateDirectory, includeDynamicModelTemplates);
}
- public JavaClassEmitter getVisualTypeProviderEmitter() {
- return createPrimaryJavaClassEmitter("aspects::xpt::providers::VisualTypeProvider"); //$NON-NLS-1$
- }
-
@Override
public JavaClassEmitter getDiagramCanonicalEditPolicyEmitter() {
return null;
diff --git a/plugins/developer/org.eclipse.papyrus.codegen/src/org/eclipse/papyrus/codegen/PapyrusExecuteTemplatesOperation.java b/plugins/developer/org.eclipse.papyrus.codegen/src/org/eclipse/papyrus/codegen/PapyrusExecuteTemplatesOperation.java
index ac61e949ea7..de6a145fcdd 100644
--- a/plugins/developer/org.eclipse.papyrus.codegen/src/org/eclipse/papyrus/codegen/PapyrusExecuteTemplatesOperation.java
+++ b/plugins/developer/org.eclipse.papyrus.codegen/src/org/eclipse/papyrus/codegen/PapyrusExecuteTemplatesOperation.java
@@ -14,6 +14,7 @@ package org.eclipse.papyrus.codegen;
import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
import org.eclipse.gmf.codegen.util.Generator;
+import org.eclipse.gmf.codegen.xtend.ui.handlers.GeneratorWithXtend2;
import org.eclipse.gmf.internal.codegen.popup.actions.ExecuteTemplatesOperation;
/**
@@ -30,7 +31,7 @@ public class PapyrusExecuteTemplatesOperation extends ExecuteTemplatesOperation
@Override
protected Generator createGenerator() {
GenEditorGenerator genModel = getGenModel();
- return new PapyrusGenerator(genModel, new PapyrusCodegenEmitters(!genModel.isDynamicTemplates(), genModel.getTemplateDirectory(), genModel.getModelAccess() != null));
+ return new GeneratorWithXtend2(genModel, new PapyrusCodegenEmitters(!genModel.isDynamicTemplates(), genModel.getTemplateDirectory(), genModel.getModelAccess() != null));
}
}
diff --git a/plugins/developer/org.eclipse.papyrus.codegen/src/org/eclipse/papyrus/codegen/PapyrusGenerator.java b/plugins/developer/org.eclipse.papyrus.codegen/src/org/eclipse/papyrus/codegen/PapyrusGenerator.java
deleted file mode 100644
index 53e5adf7f6c..00000000000
--- a/plugins/developer/org.eclipse.papyrus.codegen/src/org/eclipse/papyrus/codegen/PapyrusGenerator.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/****************************************************************************
- * Copyright (c) 2008 Atos Origin.
- *
- * 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:
- * Thibault Landre (Atos Origin) - Initial API and implementation
- * Vincent Lorenzo (CEA - LIST) - minor change
- *****************************************************************************/
-package org.eclipse.papyrus.codegen;
-
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.gmf.codegen.xtend.ui.handlers.GeneratorWithXtend2;
-import org.eclipse.gmf.common.UnexpectedBehaviourException;
-import org.eclipse.papyrus.papyrusgmfgenextension.GenVisualTypeProvider;
-
-@SuppressWarnings("restriction")
-public class PapyrusGenerator extends GeneratorWithXtend2 {
-
- private final PapyrusCodegenEmitters myEmitters;
- private GenDiagram myDiagram;
-
- public PapyrusGenerator(GenEditorGenerator genModel, PapyrusCodegenEmitters emitters) {
- super(genModel, emitters);
-
- this.myEmitters = emitters;
- this.myDiagram = genModel.getDiagram();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void customRun() throws InterruptedException, UnexpectedBehaviourException {
- super.customRun();
-
- generateVisualTypeProvider();
- }
-
- private void generateVisualTypeProvider() throws InterruptedException, UnexpectedBehaviourException {
- String providerClassName = GenVisualTypeProvider.getQualifiedClassName(myDiagram);
- doGenerateJavaClass(myEmitters.getVisualTypeProviderEmitter(), providerClassName, myDiagram);
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/VisualTypeProvider.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/VisualTypeProvider.xtend
index a8597c8c102..28a4a965ccd 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/VisualTypeProvider.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/VisualTypeProvider.xtend
@@ -33,11 +33,11 @@ import xpt.providers.ElementTypes
@Inject VisualIDRegistry visualIDs
@Inject ElementTypes elementTypes
- def getPackageName(GenDiagram it) '''«it.providersPackageName»'''
+ def packageName(GenDiagram it) '''«it.providersPackageName»'''
- def getClassName(GenDiagram it) '''«GenVisualTypeProvider.getClassName(it)»'''
+ def className(GenDiagram it) '''«GenVisualTypeProvider.getClassName(it)»'''
- def getQualifiedClassName(GenDiagram it) '''«packageName».«className»'''
+ def qualifiedClassName(GenDiagram it) '''«packageName(it)».«className(it)»'''
protected def constructor(GenDiagram it) '''
«generatedMemberComment»
@@ -65,7 +65,7 @@ import xpt.providers.ElementTypes
protected def getNodeType(GenDiagram it) '''
«generatedMemberComment»
«overrideI»
- public String getNodeType(View parentView, EObject element) {
+ public String getNodeType(org.eclipse.gmf.runtime.notation.View parentView, org.eclipse.emf.ecore.EObject element) {
int result = «visualIDs.getNodeVisualIDMethodCall(it)»(parentView, element);
return (result < 0) ? null : Integer.toString(result);
}
@@ -74,7 +74,7 @@ import xpt.providers.ElementTypes
protected def getLinkType(GenDiagram it) '''
«generatedMemberComment»
«overrideI»
- public String getLinkType(Diagram diagram, EObject element) {
+ public String getLinkType(org.eclipse.gmf.runtime.notation.Diagram diagram, org.eclipse.emf.ecore.EObject element) {
int result = «visualIDs.getLinkWithClassVisualIDMethodCall(it)»(element);
return (result < 0) ? null : Integer.toString(result);
}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/extensions.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/extensions.xtend
index f77c1431b5f..49363c3f751 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/extensions.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/extensions.xtend
@@ -144,7 +144,7 @@ import xpt.providers.ShortcutsDecoratorProvider
«tripleSpace(1)»<extension point="org.eclipse.papyrus.infra.gmfdiag.common.visualTypeProviders">
«tripleSpace(2)»«xmlGeneratedTag»
«tripleSpace(2)»<visualTypeProvider
- «tripleSpace(4)»class="«visualTypeProvider.getQualifiedClassName(it)»"
+ «tripleSpace(4)»class="«visualTypeProvider.qualifiedClassName(it)»"
«tripleSpace(4)»diagramType="«editorGen.modelID»">
«tripleSpace(3)»</visualTypeProvider>
«tripleSpace(1)»</extension>

Back to the top