Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2020-02-18 05:34:51 -0500
committervincent lorenzo2020-02-18 10:04:12 -0500
commit652770afc708e7707473f510f468e15858ee8c18 (patch)
treea3df48f3f49f2dbe76c5c2035da25ad820ba5974
parent4cf5c84c37db98911868313e7d15db0abe82f580 (diff)
downloadorg.eclipse.papyrus-652770afc708e7707473f510f468e15858ee8c18.tar.gz
org.eclipse.papyrus-652770afc708e7707473f510f468e15858ee8c18.tar.xz
org.eclipse.papyrus-652770afc708e7707473f510f468e15858ee8c18.zip
Bug 560219: [Diagram][Table][AF] The abstract class ViewPrototype must allow to instanciate a view without open it
Change-Id: I5da6139c1a60fcb1eb5be3eec57b9cab76767e64 Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
-rwxr-xr-xplugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/plugin.xml3
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/pom.xml2
-rwxr-xr-xplugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DiagramPrototype.java22
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/plugin.xml3
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/pom.xml7
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/schema/viewType.exsd2
-rw-r--r--plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/ViewPrototype.java18
-rwxr-xr-xplugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/usecases.md5
10 files changed, 52 insertions, 14 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF
index 8a58dfa4f0d..bfc6e721921 100755
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF
@@ -82,7 +82,7 @@ Bundle-Activator: org.eclipse.papyrus.infra.gmfdiag.common.Activator
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
-Bundle-Version: 3.103.0.qualifier
+Bundle-Version: 3.103.100.qualifier
Bundle-Localization: plugin
Bundle-Name: %pluginName
Bundle-ManifestVersion: 2
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/plugin.xml b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/plugin.xml
index 60026473a38..fd848859279 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/plugin.xml
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/plugin.xml
@@ -288,7 +288,8 @@
<extension
point="org.eclipse.papyrus.infra.viewpoints.policy.viewType">
<helper
- class="org.eclipse.papyrus.infra.gmfdiag.common.helper.GMFDiagramViewTypeHelper">
+ class="org.eclipse.papyrus.infra.gmfdiag.common.helper.GMFDiagramViewTypeHelper"
+ priority="0">
</helper>
</extension>
<extension
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/pom.xml b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/pom.xml
index f6173572cc6..cbb555e7d3d 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/pom.xml
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/pom.xml
@@ -9,6 +9,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.infra.gmfdiag.common</artifactId>
- <version>3.103.0-SNAPSHOT</version>
+ <version>3.103.100-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DiagramPrototype.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DiagramPrototype.java
index cacfbe6a872..faa5bed78ab 100755
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DiagramPrototype.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DiagramPrototype.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
+ * Copyright (c) 2013, 2020 CEA LIST.
*
*
* All rights reserved. This program and the accompanying materials
@@ -11,7 +11,7 @@
*
* Contributors:
* Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
- *
+ * Vincent Lorenzo vincent.lorenzo@cea.fr - bug 560219
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.common.helper;
@@ -33,6 +33,7 @@ import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
* Represents a prototype of GMF diagram for the viewpoints infrastructure
*
* @author Laurent Wouters
+ *
*/
public class DiagramPrototype extends ViewPrototype {
protected final String category;
@@ -54,6 +55,19 @@ public class DiagramPrototype extends ViewPrototype {
@Override
public boolean instantiateOn(EObject owner, String name) {
+ return instantiateOn(owner, name, true);
+ }
+
+ /**
+ * @see org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype#instantiateOn(org.eclipse.emf.ecore.EObject, java.lang.String, boolean)
+ *
+ * @param owner
+ * @param name
+ * @param openCreatedView
+ * @return
+ */
+ @Override
+ public boolean instantiateOn(EObject owner, String name, boolean openCreatedView) {
ServicesRegistry registry;
try {
registry = ServiceUtilsForEObject.getInstance().getServiceRegistry(owner);
@@ -68,7 +82,7 @@ public class DiagramPrototype extends ViewPrototype {
Activator.log.error(ex);
return false;
}
- Object result = command.createDiagram(modelSet, owner, owner, this, name);
+ Object result = command.createDiagram(modelSet, owner, owner, this, name, openCreatedView);
return (result != null);
}
@@ -141,7 +155,7 @@ public class DiagramPrototype extends ViewPrototype {
public EObject getRootOf(EObject view) {
return ((Diagram) view).getElement();
}
-
+
/**
* @since 3.0
*/
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/plugin.xml b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/plugin.xml
index f46e2674c8d..78f2f483b53 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/plugin.xml
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/plugin.xml
@@ -223,7 +223,8 @@
<extension
point="org.eclipse.papyrus.infra.viewpoints.policy.viewType">
<helper
- class="org.eclipse.papyrus.infra.nattable.common.helper.TableCommandHelper">
+ class="org.eclipse.papyrus.infra.nattable.common.helper.TableCommandHelper"
+ priority="0">
</helper>
</extension>
<extension
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/META-INF/MANIFEST.MF b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/META-INF/MANIFEST.MF
index 53fb40a553e..d8f26be211d 100755
--- a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/META-INF/MANIFEST.MF
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/META-INF/MANIFEST.MF
@@ -30,7 +30,7 @@ Require-Bundle: org.eclipse.ui;bundle-version="[3.107.0,4.0.0)";visibility:=reex
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
-Bundle-Version: 3.1.0.qualifier
+Bundle-Version: 3.2.0.qualifier
Bundle-Localization: plugin
Bundle-Name: %pluginName
Bundle-ManifestVersion: 2
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/pom.xml b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/pom.xml
index 51007a33d01..e2472e45742 100644
--- a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/pom.xml
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/pom.xml
@@ -1,4 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?><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">
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
<parent>
<artifactId>org.eclipse.papyrus.infra-viewpoints</artifactId>
@@ -6,6 +9,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.infra.viewpoints.policy</artifactId>
- <version>3.1.0-SNAPSHOT</version>
+ <version>3.2.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/schema/viewType.exsd b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/schema/viewType.exsd
index 27436bd7770..59546cdac0f 100755
--- a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/schema/viewType.exsd
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/schema/viewType.exsd
@@ -64,7 +64,7 @@
<documentation>
The priority rank, as an integer, of the extension relative to others.
&lt;p&gt;
-The default priority is zero and higher priorities precede lower priorities in matching helpers against views in the notation model.
+The default priority is zero (lowest priority) and higher priorities precede lower priorities in matching helpers against views in the notation model.
&lt;/p&gt;&lt;p&gt;
Since version 2.1.
&lt;/p&gt;
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/ViewPrototype.java b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/ViewPrototype.java
index 5588656b539..07a0ab11bcd 100644
--- a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/ViewPrototype.java
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/src/org/eclipse/papyrus/infra/viewpoints/policy/ViewPrototype.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2013, 2017, 2019 CEA LIST, Christian W. Damus, and others.
+ * Copyright (c) 2013, 2017, 2019, 2020 CEA LIST, 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 2.0
@@ -12,7 +12,7 @@
* Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
* Christian W. Damus - bugs 474467, 493375, 527580
* Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Bug 550568
- *
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - bug 560219
*****************************************************************************/
package org.eclipse.papyrus.infra.viewpoints.policy;
@@ -365,6 +365,20 @@ public abstract class ViewPrototype {
public abstract boolean instantiateOn(EObject owner, String name);
/**
+ * Create a new view from this prototype with the given owner and name, and open it if required
+ *
+ * @param owner
+ * @param name
+ * @param openCreatedView
+ * @return
+ * <code>true</code> if the diagram creation succeed, <code>false</code> otherwise
+ * @since 3.2
+ */
+ public boolean instantiateOn(final EObject owner, final String name, final boolean openCreatedView) {
+ return instantiateOn(owner, name);
+ }
+
+ /**
* Gets the command for moving the given view to a new owner (target)
*
* @param view
diff --git a/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/usecases.md b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/usecases.md
new file mode 100755
index 00000000000..672c7e8d9b9
--- /dev/null
+++ b/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy/usecases.md
@@ -0,0 +1,5 @@
+**class ViewPrototype**
+This class provides method to create a view (editor) from an EObject using the method
+instantiateOn(final EObject owner, final String name, final boolean openCreatedView)
+This class provides the command to change the graphical owner and the semantic owner.
+

Back to the top