Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Schnekenburger2014-11-05 13:30:31 +0000
committerGerrit Code Review @ Eclipse.org2014-11-05 13:30:31 +0000
commitc6f71ae2ea23d4f1218fb823ec9ab0db7fbb4ede (patch)
tree28d0da4657293f173d1bc78c60ee82ca10f73a00 /tests/junit/plugins/junit
parentcbee16c31630c064c1d2a2654f2b973c4ac5ee34 (diff)
parente9b00f28edc9969d536a557fe5298328e94cec65 (diff)
downloadorg.eclipse.papyrus-c6f71ae2ea23d4f1218fb823ec9ab0db7fbb4ede.tar.gz
org.eclipse.papyrus-c6f71ae2ea23d4f1218fb823ec9ab0db7fbb4ede.tar.xz
org.eclipse.papyrus-c6f71ae2ea23d4f1218fb823ec9ab0db7fbb4ede.zip
Merge "446668: [BDD] Redirecting Associations does not move association end properties owned by block https://bugs.eclipse.org/bugs/show_bug.cgi?id=446668"
Diffstat (limited to 'tests/junit/plugins/junit')
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/DiagramUtils.java34
1 files changed, 33 insertions, 1 deletions
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/DiagramUtils.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/DiagramUtils.java
index 3d69d785068..c50389d043b 100644
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/DiagramUtils.java
+++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/DiagramUtils.java
@@ -19,6 +19,7 @@ import org.eclipse.gef.EditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.Edge;
import org.eclipse.gmf.runtime.notation.Shape;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
@@ -69,10 +70,41 @@ public class DiagramUtils {
}
}
+
// Assert.fail("Cannot find the view associated to " + elementName);
return null;
}
+
+
+ /**
+ * Search and returns the first view in the specified container view with the given name
+ *
+ * @param container
+ * the container
+ * @param elementName
+ * the element name
+ * @return the edge
+ */
+ public static Edge findEdge(View container, String elementName) {
+ for (Object viewObject : container.eContents()) {
+ if (viewObject instanceof View) {
+ View view = (View) viewObject;
+ if (view instanceof Edge && view.getElement() instanceof NamedElement) {
+ NamedElement element = (NamedElement) view.getElement();
+ if (elementName.equals(element.getName())) {
+ return (Edge) view;
+ }
+ }
+ }
+ }
+
+
+ // Assert.fail("Cannot find the view associated to " + elementName);
+ return null;
+ }
+
+
/**
* Returns the int corresponding to the given tuple
*
@@ -91,7 +123,7 @@ public class DiagramUtils {
int red = (value >> 16) & 255;
return new RGB(red, green, blue);
}
-
+
public static String integerToRGBString(int value) {
RGB rgb = integerToRGB(value);
return rgb.toString();

Back to the top