Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Le Fevre - CEA2015-04-03 14:15:37 +0000
committervincent lorenzo2015-04-17 11:06:09 +0000
commite6a37aa591119f8f80a868864d828f49c0d3e4ee (patch)
tree44c0c0493071719a3ac0ad06a32f6b4d0cc80bcd
parent85de07c60ac8997ab4d7a5f8c566d9fe90e9714c (diff)
downloadorg.eclipse.papyrus-e6a37aa591119f8f80a868864d828f49c0d3e4ee.tar.gz
org.eclipse.papyrus-e6a37aa591119f8f80a868864d828f49c0d3e4ee.tar.xz
org.eclipse.papyrus-e6a37aa591119f8f80a868864d828f49c0d3e4ee.zip
Bug 463294 : [drag and drop] develop a dnd for signal
prototype for drag and drop for signal to class with creation of reception adding automatically download of the uml.graph library with the reference to the papyrus eclipse repository modifications in regards of Vincent's review Change-Id: Ia1a4c853e0d3d1687392172203cef9d0b9dee5ae Signed-off-by: Francois Le Fevre - CEA <francois.le-fevre@cea.fr> Reviewed-on: https://git.eclipse.org/r/45235 Tested-by: Hudson CI Reviewed-by: vincent lorenzo <vincent.lorenzo@cea.fr>
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.dnd/META-INF/MANIFEST.MF7
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.dnd/OSGI-INF/l10n/bundle.properties3
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.dnd/build.properties3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/.classpath15
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/.settings/org.eclipse.m2e.core.prefs4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/META-INF/MANIFEST.MF13
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/OSGI-INF/l10n/bundle.properties3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/build.properties4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/lib/uml.graph.uml2pseudograph-0.0.1-20150415.134006-2-jar-with-dependencies.jarbin0 -> 5353976 bytes
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/lib/uml.graph.uml2pseudograph-0.0.1-SNAPSHOT-jar-with-dependencies.jarbin0 -> 5353345 bytes
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/plugin.xml5
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/pom.xml36
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/src/org/eclipse/papyrus/uml/diagram/dnd/messages/Messages.java33
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/src/org/eclipse/papyrus/uml/diagram/dnd/messages/messages.properties2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/src/org/eclipse/papyrus/uml/diagram/dnd/signal2reception/SignalToReceptionDropStrategy.java180
-rw-r--r--releng/top-pom-main.xml35
16 files changed, 325 insertions, 18 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.dnd/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.dnd/META-INF/MANIFEST.MF
index 6b309a0e10a..ced4bb99389 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.dnd/META-INF/MANIFEST.MF
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.dnd/META-INF/MANIFEST.MF
@@ -13,14 +13,15 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.widgets;bundle-version="1.1.0",
org.eclipse.core.databinding;bundle-version="1.4.1",
org.eclipse.papyrus.infra.core;bundle-version="1.1.0",
- org.eclipse.papyrus.infra.viewpoints.policy
-Bundle-Vendor: Eclipse Modeling Project
+ org.eclipse.papyrus.infra.viewpoints.policy;bundle-version="1.1.0"
+Bundle-Vendor: %Bundle-Vendor
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.1.0.qualifier
-Bundle-Name: Customizable Drag and Drop
+Bundle-Name: %Bundle-Name
Bundle-Activator: org.eclipse.papyrus.infra.gmfdiag.dnd.Activator
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.papyrus.infra.gmfdiag.dnd;singleton:=
true
Bundle-RequiredExecutionEnvironment: J2SE-1.5
+
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.dnd/OSGI-INF/l10n/bundle.properties b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.dnd/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 00000000000..8d21130b7c7
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.dnd/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.papyrus.infra.gmfdiag.dnd
+Bundle-Vendor = Eclipse Modeling Project
+Bundle-Name = Customizable Drag and Drop \ No newline at end of file
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.dnd/build.properties b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.dnd/build.properties
index 4ec4ed9fddd..ac1e3ed58e0 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.dnd/build.properties
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.dnd/build.properties
@@ -4,5 +4,6 @@ bin.includes = META-INF/,\
.,\
about.html,\
plugin.xml,\
- schema/
+ schema/,\
+ OSGI-INF/l10n/bundle.properties
src.includes = about.html
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/.classpath b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/.classpath
index 2d1a4302f04..3c80dc1a21e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/.classpath
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/.classpath
@@ -1,7 +1,8 @@
-<?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/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry exported="true" kind="lib" path="lib/uml.graph.uml2pseudograph-0.0.1-SNAPSHOT-jar-with-dependencies.jar"/>
+ <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="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/.settings/org.eclipse.m2e.core.prefs b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 00000000000..f897a7f1cb2
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/META-INF/MANIFEST.MF b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/META-INF/MANIFEST.MF
index 394133c7927..ee05997ab2d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/META-INF/MANIFEST.MF
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/META-INF/MANIFEST.MF
@@ -14,15 +14,20 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.uml.tools;bundle-version="1.1.0",
org.eclipse.papyrus.uml.diagram.clazz;bundle-version="1.1.0",
org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.1.0",
+ org.eclipse.papyrus.infra.services.edit;bundle-version="1.1.0",
+ org.eclipse.papyrus.uml.service.types;bundle-version="1.1.0",
org.eclipse.papyrus.uml.diagram.composite;bundle-version="1.1.0",
- org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="1.1.0"
-Bundle-Vendor: Eclipse Modeling Project
+ org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="1.1.0",
+ org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.1.0"
+Bundle-Vendor: %Bundle-Vendor
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.1.0.qualifier
-Bundle-Name: UML Drag and Drop
+Bundle-Name: %Bundle-Name
Bundle-Activator: org.eclipse.papyrus.uml.diagram.dnd.Activator
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.dnd;singleton:=tr
ue
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-ClassPath: .,
+ lib/uml.graph.uml2pseudograph-0.0.1-SNAPSHOT-jar-with-dependencies.jar
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/OSGI-INF/l10n/bundle.properties b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 00000000000..c5ebdaa08cc
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.papyrus.uml.diagram.dnd
+Bundle-Vendor = Eclipse Modeling Project
+Bundle-Name = UML Drag and Drop \ No newline at end of file
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/build.properties b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/build.properties
index e3693a3b66e..aadafaa1e76 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/build.properties
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/build.properties
@@ -3,5 +3,7 @@ output.. = bin/
bin.includes = META-INF/,\
.,\
about.html,\
- plugin.xml
+ plugin.xml,\
+ lib/,\
+ OSGI-INF/l10n/bundle.properties
src.includes = about.html
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/lib/uml.graph.uml2pseudograph-0.0.1-20150415.134006-2-jar-with-dependencies.jar b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/lib/uml.graph.uml2pseudograph-0.0.1-20150415.134006-2-jar-with-dependencies.jar
new file mode 100644
index 00000000000..4314d64243e
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/lib/uml.graph.uml2pseudograph-0.0.1-20150415.134006-2-jar-with-dependencies.jar
Binary files differ
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/lib/uml.graph.uml2pseudograph-0.0.1-SNAPSHOT-jar-with-dependencies.jar b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/lib/uml.graph.uml2pseudograph-0.0.1-SNAPSHOT-jar-with-dependencies.jar
new file mode 100644
index 00000000000..4c19f7d314c
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/lib/uml.graph.uml2pseudograph-0.0.1-SNAPSHOT-jar-with-dependencies.jar
Binary files differ
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/plugin.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/plugin.xml
index 93bc2c875ab..707a9e5960e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/plugin.xml
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/plugin.xml
@@ -18,5 +18,8 @@
<strategy
strategy="org.eclipse.papyrus.uml.diagram.dnd.strategy.constraint.NamespaceToConstraintDropStrategy">
</strategy>
- </extension>
+ <strategy
+ strategy="org.eclipse.papyrus.uml.diagram.dnd.signal2reception.SignalToReceptionDropStrategy">
+ </strategy>
+ </extension>
</plugin>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/pom.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/pom.xml
index ba9f376edc4..b0cdbb3a516 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/pom.xml
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/pom.xml
@@ -11,4 +11,40 @@
<groupId>org.eclipse.papyrus</groupId>
<version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
+
+ <build>
+ <plugins>
+ <!-- All to retrieve automatically the uml.graph.uml2pseudograph dependency -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.10</version>
+ <executions>
+ <execution>
+ <id>copy</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.eclipse.papyrus.tools.uml.graph</groupId>
+ <artifactId>uml.graph.uml2pseudograph</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <type>jar</type>
+ <classifier>jar-with-dependencies</classifier>
+ <overWrite>true</overWrite>
+ <outputDirectory>lib</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ <outputDirectory>lib</outputDirectory>
+ <overWriteReleases>false</overWriteReleases>
+ <overWriteSnapshots>true</overWriteSnapshots>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project> \ No newline at end of file
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/src/org/eclipse/papyrus/uml/diagram/dnd/messages/Messages.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/src/org/eclipse/papyrus/uml/diagram/dnd/messages/Messages.java
new file mode 100644
index 00000000000..74b40540b40
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/src/org/eclipse/papyrus/uml/diagram/dnd/messages/Messages.java
@@ -0,0 +1,33 @@
+/*****************************************************************************
+ * Copyright (c) 2015 CEA LIST 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:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.dnd.messages;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author flefevre
+ *
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.papyrus.uml.diagram.dnd.signal2reception.messages"; //$NON-NLS-1$
+ public static String SignalToReceptionDropStrategy_Label;
+ public static String SignalToReceptionDropStrategy_Description;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/src/org/eclipse/papyrus/uml/diagram/dnd/messages/messages.properties b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/src/org/eclipse/papyrus/uml/diagram/dnd/messages/messages.properties
new file mode 100644
index 00000000000..81367df59e6
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/src/org/eclipse/papyrus/uml/diagram/dnd/messages/messages.properties
@@ -0,0 +1,2 @@
+SignalToReceptionDropStrategy_0=Drop a signal on a Class
+SignalToReceptionDropStrategy_1=Drop a signal on a Class: This will create a new Reception in the Class linking to this signal.
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/src/org/eclipse/papyrus/uml/diagram/dnd/signal2reception/SignalToReceptionDropStrategy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/src/org/eclipse/papyrus/uml/diagram/dnd/signal2reception/SignalToReceptionDropStrategy.java
new file mode 100644
index 00000000000..280bad654e6
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd/src/org/eclipse/papyrus/uml/diagram/dnd/signal2reception/SignalToReceptionDropStrategy.java
@@ -0,0 +1,180 @@
+/*****************************************************************************
+ * Copyright (c) 2015 CEA LIST 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:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.dnd.signal2reception;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.papyrus.infra.gmfdiag.dnd.strategy.TransactionalDropStrategy;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
+import org.eclipse.papyrus.tools.uml.graph.uml2pseudograph.api.Uml2GraphServices;
+import org.eclipse.papyrus.uml.diagram.dnd.Activator;
+import org.eclipse.papyrus.uml.diagram.dnd.messages.Messages;
+//import org.eclipse.papyrus.tools.uml.graph.uml2pseudograph.api.Uml2GraphServices;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.uml2.uml.Reception;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * A DropStrategy to "Signal" a Class.
+ * Drop a signal on a Class operation section to type it.
+ * This will create a new Reception operation in the interaction, typed by the dropped classifier.
+ *
+ * @author Francois Le Fevre
+ *
+ */
+public class SignalToReceptionDropStrategy extends TransactionalDropStrategy {
+
+ public String getLabel() {
+ return Messages.SignalToReceptionDropStrategy_Label;
+ }
+
+ public String getDescription() {
+ return Messages.SignalToReceptionDropStrategy_Description;
+ }
+
+ public Image getImage() {
+ return null;
+ }
+
+ public String getID() {
+ return Activator.PLUGIN_ID + ".signal.represents"; //$NON-NLS-1$
+ }
+
+ @Override
+ protected Command doGetCommand(Request request, EditPart targetEditPart) {
+ final UMLFactory umlFactory = UMLFactory.eINSTANCE;
+
+ List<EObject> sourceElements = getSourceEObjects(request);
+ // The only supported case is "Drop a single signal on a single Operation of a Classifier"
+ if (sourceElements.size() != 1) {
+ return null;
+ }
+ final EObject sourceElement = sourceElements.get(0);
+
+ final String sourceClassPackaged = sourceElement.eClass().getInstanceTypeName();
+ final String sourceClass = sourceClassPackaged.substring(sourceClassPackaged.lastIndexOf(".")+1);
+
+ final EObject targetElement = getTargetSemanticElement(targetEditPart);
+
+ final String targetClassPackaged = targetElement.eClass().getInstanceTypeName();
+ if(Activator.log.isDebugEnabled()){
+ Activator.log.debug("targetelement="+targetElement);//$NON-NLS-1$
+ }
+
+ List<String> potentialActions = Uml2GraphServices.guessMyPotentialDirectActions(sourceClassPackaged, targetClassPackaged);
+ if(potentialActions.size()!=1){
+ if(Activator.log.isDebugEnabled()){
+ Activator.log.debug("multiple actions are not take into account="+potentialActions);//$NON-NLS-1$
+ }
+ return null;
+ }
+ else{
+ if(Activator.log.isDebugEnabled()){
+ Activator.log.debug("potentialActions "+potentialActions);//$NON-NLS-1$
+ }
+ String eclass2Create = potentialActions.get(0);
+
+ //Extracting class short name to create
+ final String todo = new String(eclass2Create.substring(eclass2Create.lastIndexOf(".")+1));
+
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(sourceElement);
+ if(provider == null) {
+ return null;
+ }
+
+ Command resultCommand = new Command(getLabel()) {
+ @SuppressWarnings("unchecked")
+ @Override
+ public void execute() {
+
+ Method m;
+ try {
+
+ //Creation of new Object that respects Source x Target
+ m = umlFactory.getClass().getMethod("create"+todo);//$NON-NLS-1$
+ Object myTodo = m.invoke(umlFactory, null);
+
+ //Association of the new Object with the Source
+ Method m2;
+ Class[] parameterTypes2 = new Class[1];
+
+ parameterTypes2[0] = Class.forName(sourceClassPackaged);
+ m2 = myTodo.getClass().getMethod("set"+sourceClass, parameterTypes2);//$NON-NLS-1$
+ m2.invoke(myTodo, new Object[] {sourceElement});
+
+ //TRACE
+ if(Activator.log.isDebugEnabled()){
+ Activator.log.debug(("((Reception)myTodo).getSignal()="+((Reception)myTodo).getSignal().getName()));//$NON-NLS-1$
+ Activator.log.debug("targetElement="+((org.eclipse.uml2.uml.Class)targetElement).getOwnedReceptions());//$NON-NLS-1$
+ }
+
+ //Setting the name of the new Object
+ parameterTypes2[0] = Class.forName("java.lang.String");//$NON-NLS-1$
+ m2 = myTodo.getClass().getMethod("setName", parameterTypes2);//$NON-NLS-1$
+ if(m2!=null){
+ String name = todo+"From"+sourceClass;
+ m2.invoke(myTodo, new Object[] {name});
+ }
+
+ //Adding the new Object to the Target
+ EStructuralFeature esfOwned = targetElement.eClass().getEStructuralFeature("owned"+todo);//$NON-NLS-1$
+ if(esfOwned.getUpperBound()==-1){
+ if ( targetElement.eGet(esfOwned) instanceof Collection){
+ ((Collection<Object>)targetElement.eGet(esfOwned)).add(myTodo);
+ }
+ else{
+ targetElement.eSet(esfOwned, myTodo);
+ }
+ }
+
+
+ } catch (NoSuchMethodException e) {
+ e.printStackTrace();
+ } catch (SecurityException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+
+ }
+ };
+ return resultCommand;
+ }
+ }
+
+ /**
+ * @see org.eclipse.papyrus.infra.gmfdiag.dnd.strategy.DropStrategy#getPriority()
+ *
+ * @return
+ * @deprecated
+ */
+ public int getPriority() {
+ return 0;
+ }
+
+}
diff --git a/releng/top-pom-main.xml b/releng/top-pom-main.xml
index b12b4e23713..c43fc715f19 100644
--- a/releng/top-pom-main.xml
+++ b/releng/top-pom-main.xml
@@ -490,7 +490,40 @@
<layout>p2</layout>
<!-- updateFrom("Subversive",0) -->
<url>http://download.eclipse.org/technology/subversive/3.0/mars-site/</url>
- </repository>
+ </repository>
+ <repository>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>daily</updatePolicy>
+ <checksumPolicy>warn</checksumPolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ <checksumPolicy>fail</checksumPolicy>
+ </snapshots>
+ <id>papyrus.repo.eclipse.org</id>
+ <name>Papyrus Repository - Releases</name>
+ <url>https://repo.eclipse.org/content/repositories/papyrus-releases/</url>
+ <layout>default</layout>
+ </repository>
+ <!--Papyrus Eclipse Offcial Nexus Reposiotry-->
+ <repository>
+ <releases>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ <checksumPolicy>failed</checksumPolicy>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ <updatePolicy>always</updatePolicy>
+ <checksumPolicy>fail</checksumPolicy>
+ </snapshots>
+ <id>papyrus.snap.repo.eclipse.org</id>
+ <name>Papyrus Repository - Snapshots</name>
+ <url>https://repo.eclipse.org/content/repositories/papyrus-snapshots/</url>
+ <layout>default</layout>
+ </repository>
</repositories>
<pluginRepositories>
<pluginRepository>

Back to the top