diff options
author | cletavernie | 2011-12-21 15:34:25 +0000 |
---|---|---|
committer | cletavernie | 2011-12-21 15:34:25 +0000 |
commit | 95805bac8c9093e325014c4295fafd1fa66e29f7 (patch) | |
tree | bc5b9498d170ebf2ac6b0dc450fe2ae759691dc6 /plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util | |
parent | 78f4e594778246a9621821023ee6fa09b044299e (diff) | |
download | org.eclipse.papyrus-95805bac8c9093e325014c4295fafd1fa66e29f7.tar.gz org.eclipse.papyrus-95805bac8c9093e325014c4295fafd1fa66e29f7.tar.xz org.eclipse.papyrus-95805bac8c9093e325014c4295fafd1fa66e29f7.zip |
359794: [UML - Tools] Content/Label providers
https://bugs.eclipse.org/bugs/show_bug.cgi?id=359794
367066: [Refactoring] There should be a central generic plug-in for pure EMF-based tools
https://bugs.eclipse.org/bugs/show_bug.cgi?id=367066
351802: [Constraints] The Property View constraints model should be more generic
https://bugs.eclipse.org/bugs/show_bug.cgi?id=351802
Diffstat (limited to 'plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util')
-rw-r--r-- | plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/NotationUtil.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/NotationUtil.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/NotationUtil.java new file mode 100644 index 00000000000..18ca429fd7e --- /dev/null +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/NotationUtil.java @@ -0,0 +1,28 @@ +package org.eclipse.papyrus.infra.gmfdiag.properties.util;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+
+
+public class NotationUtil {
+
+ /**
+ * Retrieve the IGraphicalEditPart from the given Object
+ *
+ * @param source
+ * The object to resolve
+ * @return
+ * The IGraphicalEditPart, or null if it couldn't be resolved
+ */
+ public static IGraphicalEditPart resolveEditPart(Object source) {
+ if(source instanceof IGraphicalEditPart) {
+ return (IGraphicalEditPart)source;
+ }
+
+ if(source instanceof IAdaptable) {
+ return (IGraphicalEditPart)((IAdaptable)source).getAdapter(IGraphicalEditPart.class);
+ }
+
+ return null;
+ }
+}
|