Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Tessier2015-01-21 04:50:14 -0500
committerGerrit Code Review @ Eclipse.org2015-01-21 04:50:14 -0500
commit7369ae5c58c501e7e6509ee571b157e6bb396dda (patch)
treeefbcb446b39dc377dc3682571f3643ce94aedb35 /plugins
parentaa8eb21473291d598baf87a2d2ccec62f01aa69e (diff)
parente56d4dbd25ab1ce600cb5d11923d25a8bad207cb (diff)
downloadorg.eclipse.papyrus-7369ae5c58c501e7e6509ee571b157e6bb396dda.tar.gz
org.eclipse.papyrus-7369ae5c58c501e7e6509ee571b157e6bb396dda.tar.xz
org.eclipse.papyrus-7369ae5c58c501e7e6509ee571b157e6bb396dda.zip
Merge "Bug 445892 [Sequence Diagram] NPE when Double Clicking on Links tool"
Diffstat (limited to 'plugins')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/LayoutUtils.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectUnspecifiedTypeConnectionTool.java6
2 files changed, 8 insertions, 1 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/LayoutUtils.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/LayoutUtils.java
index 782e0f00a21..3085d107af4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/LayoutUtils.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/LayoutUtils.java
@@ -30,6 +30,7 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeEditPart;
import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
import org.eclipse.gmf.runtime.draw2d.ui.figures.IOvalAnchorableFigure;
+import org.eclipse.gmf.runtime.notation.Edge;
import org.eclipse.papyrus.extensionpoints.editors.Activator;
import org.eclipse.papyrus.uml.diagram.common.util.Util;
@@ -237,7 +238,7 @@ public class LayoutUtils {
* an Affixed Child Node
*
* @param sourceEditPart
- * he source EditPart
+ * the source EditPart
* @param targetEditPart
* the targetEditPart
* @return <ul>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectUnspecifiedTypeConnectionTool.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectUnspecifiedTypeConnectionTool.java
index a183c9ef425..d38e70a2e75 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectUnspecifiedTypeConnectionTool.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectUnspecifiedTypeConnectionTool.java
@@ -58,6 +58,7 @@ import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.NodeEditPart;
import org.eclipse.papyrus.infra.gmfdiag.common.preferences.ConnectionToolPreferences;
import org.eclipse.papyrus.uml.diagram.common.layout.LayoutUtils;
import org.eclipse.papyrus.uml.diagram.common.part.PaletteUtil;
@@ -180,6 +181,11 @@ public class AspectUnspecifiedTypeConnectionTool extends UnspecifiedTypeConnecti
break;
}
}
+
+ // do nothing if you have at least one edge element
+ if( !(sourceEditPart instanceof NodeEditPart) || !(targetEditPart instanceof NodeEditPart)){
+ break;
+ }
CreateConnectionRequest connectionRequest = createTargetRequest();
// get the anchors locations

Back to the top