Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2015-12-02 14:45:38 +0000
committerGerrit Code Review @ Eclipse.org2015-12-04 12:59:05 +0000
commitf8dedc59a0e9bc39beaa61b7a8c2cad1252c9438 (patch)
tree0e03fa04aaa10fd1c0c48028dec5a61b64bd06c9 /plugins/developer/org.eclipse.papyrus.def
parent1f171bd0213d10d1d791f622e7ebf0b6484c40c5 (diff)
downloadorg.eclipse.papyrus-f8dedc59a0e9bc39beaa61b7a8c2cad1252c9438.tar.gz
org.eclipse.papyrus-f8dedc59a0e9bc39beaa61b7a8c2cad1252c9438.tar.xz
org.eclipse.papyrus-f8dedc59a0e9bc39beaa61b7a8c2cad1252c9438.zip
Bug 477384: [Canonical] Should not use drop requests to create views
https://bugs.eclipse.org/bugs/show_bug.cgi?id=477384 Changes to core APIs to remove PapyrusCanonicalEditPolicy's dependence on the generated diagram drag-and-drop behavior: * extract the CommonDiagramDragDropEditPolicy's abstract API for information about diagram-specific view types into a new service * update the canonical edit-policy and diagram-to-diagram synchronization infrastructure to use the new VisualTypeService to obtain information about the diagram's specific view types to then let the view service create views without resorting to drop commands * update extensions of various canonical strategies in the UML diagrams to adapt to the new drop-free synchronization mechanism Update the Papyrus Diagram GMFGen extensions and code generation templates to add generation of the IVisualTypeProvider that plugs into the new VisualTypeService to support canonical synchronization and drag-and-drop. Includes regeneration of the GMFGen extension model using EMF's most recent templates, which result in minor changes to most model source files. Regenerate all UML diagrams to create and register the visual type provider extensions. Also update the BREE for diagrams to 1.8 because at least one of them requires Java 8 to compile properly. * Note that the interaction overview diagram uses a code generator that is not published on Eclipse.org, so I had to emulate the code generation step for this one * Note also that the SysML 1.1 diagrams likewise cannot be re-generated but, moreover, they do not implement the common pattern for Visual ID Registry, so they are also updated "by hand" for parity with the Mars implementation of drag-and-drop (which had gaps) Deprecate the ICreationTargetStrategy extension API which was only needed to redirect drag-and-drop requests, but these are no longer employed in the canonical synchronization. Also some fixes for region layout problems in the State Machine Diagram: * update custom creation edit policies to re-use the commands used by drag-and-drop and untargeted creation that perform initial placement of new regions * fix the GMFGen to register the custom creation edit policy for the state machine compartment Change-Id: I3afc68d6f0f1bfe05e336c9138a7f1acbc8f643b
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.def')
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/.classpath16
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/.settings/org.eclipse.jdt.core.prefs6
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/META-INF/MANIFEST.MF32
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/build.properties4
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/plugin/manifest.xtend7
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/VisualTypeProvider.xtend100
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/extensions.xtend10
7 files changed, 139 insertions, 36 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.def/.classpath b/plugins/developer/org.eclipse.papyrus.def/.classpath
index 4c65bf49a0c..2b33b90779b 100644
--- a/plugins/developer/org.eclipse.papyrus.def/.classpath
+++ b/plugins/developer/org.eclipse.papyrus.def/.classpath
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="xtend"/>
- <classpathentry kind="src" path="xtend-gen"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?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.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="xtend"/>
+ <classpathentry kind="src" path="xtend-gen"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/developer/org.eclipse.papyrus.def/.settings/org.eclipse.jdt.core.prefs b/plugins/developer/org.eclipse.papyrus.def/.settings/org.eclipse.jdt.core.prefs
index 4759947300a..62a08f4494d 100644
--- a/plugins/developer/org.eclipse.papyrus.def/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/developer/org.eclipse.papyrus.def/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/plugins/developer/org.eclipse.papyrus.def/META-INF/MANIFEST.MF b/plugins/developer/org.eclipse.papyrus.def/META-INF/MANIFEST.MF
index af6175e6524..7841b77e423 100644
--- a/plugins/developer/org.eclipse.papyrus.def/META-INF/MANIFEST.MF
+++ b/plugins/developer/org.eclipse.papyrus.def/META-INF/MANIFEST.MF
@@ -1,23 +1,14 @@
Manifest-Version: 1.0
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,
- 4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.2.0,
- 4.0.0)",
- org.eclipse.emf.ecore;bundle-version="[2.4.0,
- 3.0.0)";visibility:=reexport,
- org.eclipse.emf.codegen.ecore;bundle-version="[2.4.0,
- 3.0.0)";visibility:=reexport,
- org.eclipse.draw2d;bundle-version="[3.2.0,
- 4.0.0)",
+Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.emf.ecore;bundle-version="[2.4.0,3.0.0)";visibility:=reexport,
+ org.eclipse.emf.codegen.ecore;bundle-version="[2.4.0,3.0.0)";visibility:=reexport,
+ org.eclipse.draw2d;bundle-version="[3.2.0,4.0.0)",
org.eclipse.gmf.runtime.notation,
- org.eclipse.gmf.common;bundle-version="[1.2.0,
- 2.0.0)";visibility:=reexport,
- org.eclipse.gmf.validate;bundle-version="[1.1.0,
- 2.0.0)",
- org.eclipse.gmf.codegen;bundle-version="[2.0.0,
- 3.1.0)",
- org.eclipse.gmf.graphdef;bundle-version="[2.0.0,
- 3.0.0)",
+ org.eclipse.gmf.common;bundle-version="[1.2.0,2.0.0)";visibility:=reexport,
+ org.eclipse.gmf.validate;bundle-version="[1.1.0,2.0.0)",
+ org.eclipse.gmf.codegen;bundle-version="[2.0.0,3.1.0)",
+ org.eclipse.gmf.graphdef;bundle-version="[2.0.0,3.0.0)",
org.eclipse.xtext;bundle-version="2.3.1",
org.eclipse.xtext.builder;bundle-version="2.3.1",
org.eclipse.xtend.lib,
@@ -25,8 +16,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,
com.google.guava;bundle-version="11.0.0",
org.eclipse.xtext.xbase.lib,
org.eclipse.gmf.codegen.xtend;bundle-version="1.0.0",
- org.eclipse.papyrus.gmfgenextension;bundle-version="1.2.0",
- org.eclipse.papyrus.codegen;bundle-version="1.2.0"
+ org.eclipse.papyrus.gmfgenextension;bundle-version="1.2.0"
Bundle-Vendor: %providerName
Bundle-ClassPath: .,
bin/
@@ -36,4 +26,4 @@ Bundle-Localization: plugin
Bundle-Activator: org.eclipse.gmf.codegen.util.DefaultActivator
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.papyrus.def;singleton:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/plugins/developer/org.eclipse.papyrus.def/build.properties b/plugins/developer/org.eclipse.papyrus.def/build.properties
index 7a449d629c2..843e1a7d8bb 100644
--- a/plugins/developer/org.eclipse.papyrus.def/build.properties
+++ b/plugins/developer/org.eclipse.papyrus.def/build.properties
@@ -1,3 +1,7 @@
+jars.compile.order=.
+source.. = xtend/,\
+ xtend-gen/
+output.. = bin/
bin.includes = META-INF/,\
.,\
about.html,\
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/plugin/manifest.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/plugin/manifest.xtend
index 71c62ab4d52..47cf84a0fcd 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/plugin/manifest.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/plugin/manifest.xtend
@@ -1,7 +1,5 @@
-
/*
- * Copyright (c) 2007, 2009 Borland Software Corporation
-
+ * Copyright (c) 2007, 2015 Borland Software Corporation, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -12,6 +10,7 @@
* Dmitry Stadnik (Borland) - initial API and implementation
* Thibault Landre (Atos Origin) - add Papyrus dependencies to Papyrus GMF diagram*
* Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr : add the dependencyorg.eclipse.papyrus.infra.services.edit
+ * Christian W. Damus - bug 477384
*/
package aspects.xpt.plugin
@@ -73,7 +72,7 @@ Require-Bundle: org.eclipse.core.runtime,
'''
override def executionEnvironment(GenPlugin it) '''
- Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
'''
} \ No newline at end of file
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
new file mode 100644
index 00000000000..a8597c8c102
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/VisualTypeProvider.xtend
@@ -0,0 +1,100 @@
+/*****************************************************************************
+ * Copyright (c) 2015 Christian W. Damus and others.
+ *
+ * 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:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package aspects.xpt.providers
+
+import javax.inject.Inject
+import javax.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenDiagram
+import org.eclipse.papyrus.papyrusgmfgenextension.GenVisualTypeProvider
+import xpt.CodeStyle
+import xpt.Common
+import xpt.editor.VisualIDRegistry
+import xpt.providers.ElementTypes
+
+/**
+ * Template for the class that plugs in knowledge of the Visual IDs of this diagram
+ * into the {@code VisualTypeService}.
+ */
+@Singleton class VisualTypeProvider {
+
+ @Inject extension Common
+ @Inject extension CodeStyle
+ @Inject VisualIDRegistry visualIDs
+ @Inject ElementTypes elementTypes
+
+ def getPackageName(GenDiagram it) '''«it.providersPackageName»'''
+
+ def getClassName(GenDiagram it) '''«GenVisualTypeProvider.getClassName(it)»'''
+
+ def getQualifiedClassName(GenDiagram it) '''«packageName».«className»'''
+
+ protected def constructor(GenDiagram it) '''
+ «generatedMemberComment»
+ public «it.className»() {
+ super();
+ }
+ '''
+
+ protected def getElementType_(GenDiagram it) '''
+ «generatedMemberComment»
+ «overrideI»
+ public org.eclipse.gmf.runtime.emf.type.core.IElementType getElementType(org.eclipse.gmf.runtime.notation.Diagram diagram, String viewType) {
+ org.eclipse.gmf.runtime.emf.type.core.IElementType result = null;
+
+ try {
+ result = «elementTypes.qualifiedClassName(it)».getElementType(Integer.parseInt(viewType));
+ } catch (NumberFormatException e) {
+ // Not supported by this diagram
+ }
+
+ return result;
+ }
+ '''
+
+ protected def getNodeType(GenDiagram it) '''
+ «generatedMemberComment»
+ «overrideI»
+ public String getNodeType(View parentView, EObject element) {
+ int result = «visualIDs.getNodeVisualIDMethodCall(it)»(parentView, element);
+ return (result < 0) ? null : Integer.toString(result);
+ }
+ '''
+
+ protected def getLinkType(GenDiagram it) '''
+ «generatedMemberComment»
+ «overrideI»
+ public String getLinkType(Diagram diagram, EObject element) {
+ int result = «visualIDs.getLinkWithClassVisualIDMethodCall(it)»(element);
+ return (result < 0) ? null : Integer.toString(result);
+ }
+ '''
+
+ public def VisualTypeProvider(GenDiagram it) '''
+ «editorGen.copyright»
+ package «packageName»;
+
+ «generatedClassComment»
+ public class «className» extends org.eclipse.papyrus.infra.gmfdiag.common.service.visualtype.AbstractVisualTypeProvider {
+
+ «constructor»
+
+ «getElementType_»
+
+ «getNodeType»
+
+ «getLinkType»
+
+ }
+ '''
+} \ No newline at end of file
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 e4f07ae0307..f77c1431b5f 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
@@ -32,6 +32,7 @@ import xpt.providers.ShortcutsDecoratorProvider
@Inject EditPartProvider editPartProvider;
@Inject ParserProvider labelParsers;
@Inject ShortcutsDecoratorProvider shorcutProvider;
+ @Inject VisualTypeProvider visualTypeProvider;
override extensions(GenDiagram it) '''
«extraLineBreak»
@@ -138,6 +139,15 @@ import xpt.providers.ShortcutsDecoratorProvider
«tripleSpace(3)»<advice ref="org.eclipse.gmf.runtime.diagram.core.advice.notationDepdendents"/>
«tripleSpace(2)»</binding>
«tripleSpace(1)»</extension>
+
+ «extraLineBreak»
+ «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)»diagramType="«editorGen.modelID»">
+ «tripleSpace(3)»</visualTypeProvider>
+ «tripleSpace(1)»</extension>
'''
def getLocalDefineTypedElements(GenDiagram it) {

Back to the top