Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/diagram/clazz/custom/policies/ISRoleTargetDisplayEditPolicy.java')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/diagram/clazz/custom/policies/ISRoleTargetDisplayEditPolicy.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/diagram/clazz/custom/policies/ISRoleTargetDisplayEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/diagram/clazz/custom/policies/ISRoleTargetDisplayEditPolicy.java
new file mode 100644
index 00000000000..70f75093815
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/custom-src/org/eclipse/papyrus/diagram/clazz/custom/policies/ISRoleTargetDisplayEditPolicy.java
@@ -0,0 +1,38 @@
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * 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:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ */
+package org.eclipse.papyrus.diagram.clazz.custom.policies;
+
+import java.util.ArrayList;
+
+import org.eclipse.gef.ConnectionEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.uml2.uml.InstanceSpecification;
+import org.eclipse.uml2.uml.Property;
+
+/**
+ * this a listener to refresh the target role of the instance specification
+ *
+ */
+public class ISRoleTargetDisplayEditPolicy extends InstanceSpecificationRoleDisplayEditPolicy {
+
+ @Override
+ public InstanceSpecification getEnd() {
+ return (InstanceSpecification)((GraphicalEditPart)((ConnectionEditPart)getHost().getParent()).getSource()).resolveSemanticElement();
+ }
+
+ @Override
+ protected Property getprefvalue(ArrayList<Property> array) {
+ return array.get(1);
+ }
+
+}

Back to the top