Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2016-02-24 12:14:47 +0000
committerCamille Letavernier2016-02-24 12:14:47 +0000
commit6a71160368d47c5769b2df817ddaa4d30a000a44 (patch)
treeb22f88b39243aabe27170ab0a89b96b122fe422e
parent535887b14f8d3b29a4c5c9a440a89ae0745c078a (diff)
downloadorg.eclipse.papyrus-6a71160368d47c5769b2df817ddaa4d30a000a44.tar.gz
org.eclipse.papyrus-6a71160368d47c5769b2df817ddaa4d30a000a44.tar.xz
org.eclipse.papyrus-6a71160368d47c5769b2df817ddaa4d30a000a44.zip
Bug 488378: Alt + moveMouseOver support for Connectors
https://bugs.eclipse.org/bugs/show_bug.cgi?id=488378 Change-Id: I32944a38e501996bb3037453569602a7b82aa45d Signed-off-by: Camille Letavernier <camille.letavernier@cea.fr>
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.navigation/src/org/eclipse/papyrus/uml/navigation/navigableElement/ConnectorTypeNavigableElement.java39
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.navigation/src/org/eclipse/papyrus/uml/navigation/navigableElement/OperationTypeNavigableElement.java4
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.navigation/src/org/eclipse/papyrus/uml/navigation/navigableElement/TypedElementNavigationContributor.java3
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.navigation/src/org/eclipse/papyrus/uml/navigation/navigableElement/TypedNavigableElement.java5
4 files changed, 48 insertions, 3 deletions
diff --git a/plugins/uml/org.eclipse.papyrus.uml.navigation/src/org/eclipse/papyrus/uml/navigation/navigableElement/ConnectorTypeNavigableElement.java b/plugins/uml/org.eclipse.papyrus.uml.navigation/src/org/eclipse/papyrus/uml/navigation/navigableElement/ConnectorTypeNavigableElement.java
new file mode 100644
index 00000000000..ef13e1c4b33
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.navigation/src/org/eclipse/papyrus/uml/navigation/navigableElement/ConnectorTypeNavigableElement.java
@@ -0,0 +1,39 @@
+/*****************************************************************************
+ * Copyright (c) 2016 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.navigation.navigableElement;
+
+import org.eclipse.uml2.uml.Connector;
+
+/**
+ * Navigate from a Connector to its type
+ *
+ * @author Camille Letavernier
+ *
+ */
+public class ConnectorTypeNavigableElement extends TypedNavigableElement {
+
+ /**
+ * Constructor.
+ *
+ * @param type
+ */
+ public ConnectorTypeNavigableElement(Connector connector) {
+ super(connector.getType());
+ }
+
+ @Override
+ public String getDescription() {
+ return "Go to the type declaration of this Connector: " + getTypeLabel();
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.navigation/src/org/eclipse/papyrus/uml/navigation/navigableElement/OperationTypeNavigableElement.java b/plugins/uml/org.eclipse.papyrus.uml.navigation/src/org/eclipse/papyrus/uml/navigation/navigableElement/OperationTypeNavigableElement.java
index 037a21614fe..5930fb5f483 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.navigation/src/org/eclipse/papyrus/uml/navigation/navigableElement/OperationTypeNavigableElement.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.navigation/src/org/eclipse/papyrus/uml/navigation/navigableElement/OperationTypeNavigableElement.java
@@ -16,7 +16,7 @@ import org.eclipse.uml2.uml.Operation;
/**
* Navigates from an Operation to it's return type declaration
*
- * @author CL228098
+ * @author Camille Letavernier
*
*/
public class OperationTypeNavigableElement extends TypedNavigableElement {
@@ -32,6 +32,6 @@ public class OperationTypeNavigableElement extends TypedNavigableElement {
@Override
public String getDescription() {
- return "Go to the return type declaration of this Operation" + getTypeLabel();
+ return "Go to the return type declaration of this Operation:" + getTypeLabel();
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.navigation/src/org/eclipse/papyrus/uml/navigation/navigableElement/TypedElementNavigationContributor.java b/plugins/uml/org.eclipse.papyrus.uml.navigation/src/org/eclipse/papyrus/uml/navigation/navigableElement/TypedElementNavigationContributor.java
index 0ae43d449ca..a2dbe5b9e39 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.navigation/src/org/eclipse/papyrus/uml/navigation/navigableElement/TypedElementNavigationContributor.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.navigation/src/org/eclipse/papyrus/uml/navigation/navigableElement/TypedElementNavigationContributor.java
@@ -17,6 +17,7 @@ import java.util.List;
import org.eclipse.papyrus.infra.services.navigation.service.NavigableElement;
import org.eclipse.papyrus.infra.services.navigation.service.NavigationContributor;
import org.eclipse.papyrus.uml.tools.utils.UMLUtil;
+import org.eclipse.uml2.uml.Connector;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Operation;
import org.eclipse.uml2.uml.TypedElement;
@@ -37,6 +38,8 @@ public class TypedElementNavigationContributor implements NavigationContributor
result.add(new TypedNavigableElement(((TypedElement) element).getType()));
} else if (element instanceof Operation && ((Operation) element).getType() != null) {
result.add(new OperationTypeNavigableElement((Operation) element));
+ } else if (element instanceof Connector && ((Connector) element).getType() != null) {
+ result.add(new ConnectorTypeNavigableElement((Connector) element));
}
return result;
diff --git a/plugins/uml/org.eclipse.papyrus.uml.navigation/src/org/eclipse/papyrus/uml/navigation/navigableElement/TypedNavigableElement.java b/plugins/uml/org.eclipse.papyrus.uml.navigation/src/org/eclipse/papyrus/uml/navigation/navigableElement/TypedNavigableElement.java
index 3e856a98319..eae2b3f8c94 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.navigation/src/org/eclipse/papyrus/uml/navigation/navigableElement/TypedNavigableElement.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.navigation/src/org/eclipse/papyrus/uml/navigation/navigableElement/TypedNavigableElement.java
@@ -46,12 +46,14 @@ public class TypedNavigableElement implements ExtendedNavigableElement {
}
public String getDescription() {
- return "Go to the type declaration of this TypedElement" + getTypeLabel();
+ return "Go to the type declaration of this TypedElement: " + getTypeLabel();
}
protected String getTypeLabel() {
if (type == null) {
return " (Undefined)";
+ } else if (type.getName() == null) {
+ return " (Unnamed)"; // Often happens for Associations, as their name is derived in the UI
} else {
return " (" + type.getName() + ")";
}
@@ -97,6 +99,7 @@ public class TypedNavigableElement implements ExtendedNavigableElement {
/**
* Returns the type (UML Element) of the TypedNavigableElement
+ *
* @return type
*/
public Element getType() {

Back to the top