Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2011-12-21 15:34:25 +0000
committercletavernie2011-12-21 15:34:25 +0000
commit95805bac8c9093e325014c4295fafd1fa66e29f7 (patch)
treebc5b9498d170ebf2ac6b0dc450fe2ae759691dc6 /plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org
parent78f4e594778246a9621821023ee6fa09b044299e (diff)
downloadorg.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')
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/GMFNotationConstraint.java2
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/HasEditPolicy.java6
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/IsEditPartConstraint.java4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/GradientObservableValue.java2
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/GMFModelElement.java4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/providers/GMFLabelProvider.java4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/NotationUtil.java28
7 files changed, 39 insertions, 11 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/GMFNotationConstraint.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/GMFNotationConstraint.java
index a04f65a82da..6b78eb9fe03 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/GMFNotationConstraint.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/GMFNotationConstraint.java
@@ -14,8 +14,8 @@ package org.eclipse.papyrus.infra.gmfdiag.properties.constraint;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gef.EditPart;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.constraints.constraints.EMFInstanceOfConstraint;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
-import org.eclipse.papyrus.views.properties.constraints.EMFInstanceOfConstraint;
/**
* A constraint for the GMF Notation metamodel
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/HasEditPolicy.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/HasEditPolicy.java
index cbbdcc02b85..25d03b481c4 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/HasEditPolicy.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/HasEditPolicy.java
@@ -12,9 +12,9 @@
package org.eclipse.papyrus.infra.gmfdiag.properties.constraint;
import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.papyrus.views.properties.constraints.AbstractConstraint;
-import org.eclipse.papyrus.views.properties.constraints.Constraint;
-import org.eclipse.papyrus.views.properties.contexts.SimpleConstraint;
+import org.eclipse.papyrus.infra.constraints.SimpleConstraint;
+import org.eclipse.papyrus.infra.constraints.constraints.AbstractConstraint;
+import org.eclipse.papyrus.infra.constraints.constraints.Constraint;
/**
*
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/IsEditPartConstraint.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/IsEditPartConstraint.java
index 5e7c0c6435c..a44467b4f65 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/IsEditPartConstraint.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/IsEditPartConstraint.java
@@ -12,8 +12,8 @@
package org.eclipse.papyrus.infra.gmfdiag.properties.constraint;
import org.eclipse.gef.EditPart;
-import org.eclipse.papyrus.views.properties.constraints.AbstractConstraint;
-import org.eclipse.papyrus.views.properties.constraints.Constraint;
+import org.eclipse.papyrus.infra.constraints.constraints.AbstractConstraint;
+import org.eclipse.papyrus.infra.constraints.constraints.Constraint;
/**
* Tests if the selection is an EditPart
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/GradientObservableValue.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/GradientObservableValue.java
index 743a4421e52..11cdef4f794 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/GradientObservableValue.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/GradientObservableValue.java
@@ -15,7 +15,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.gmf.runtime.notation.datatype.GradientData;
-import org.eclipse.papyrus.uml.properties.databinding.PapyrusObservableValue;
+import org.eclipse.papyrus.uml.tools.databinding.PapyrusObservableValue;
/**
* An IObservableValue for a Gradient
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/GMFModelElement.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/GMFModelElement.java
index 2ecfa0dc03e..c83369ed04d 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/GMFModelElement.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/GMFModelElement.java
@@ -23,8 +23,8 @@ import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.papyrus.infra.gmfdiag.properties.databinding.GradientObservableValue;
import org.eclipse.papyrus.infra.gmfdiag.properties.providers.GMFLabelProvider;
-import org.eclipse.papyrus.uml.properties.databinding.PapyrusObservableList;
-import org.eclipse.papyrus.uml.properties.databinding.PapyrusObservableValue;
+import org.eclipse.papyrus.uml.tools.databinding.PapyrusObservableList;
+import org.eclipse.papyrus.uml.tools.databinding.PapyrusObservableValue;
import org.eclipse.papyrus.views.properties.modelelement.EMFModelElement;
/**
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/providers/GMFLabelProvider.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/providers/GMFLabelProvider.java
index 2a046a03c43..f0334d597a4 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/providers/GMFLabelProvider.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/providers/GMFLabelProvider.java
@@ -16,7 +16,7 @@ import org.eclipse.papyrus.infra.core.editorsfactory.IPageIconsRegistry;
import org.eclipse.papyrus.infra.core.editorsfactory.PageIconsRegistry;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.utils.EditorUtils;
-import org.eclipse.papyrus.views.properties.providers.EMFObjectLabelProvider;
+import org.eclipse.papyrus.infra.emf.providers.EMFLabelProvider;
import org.eclipse.swt.graphics.Image;
/**
@@ -25,7 +25,7 @@ import org.eclipse.swt.graphics.Image;
* @author Camille Letavernier
*
*/
-public class GMFLabelProvider extends EMFObjectLabelProvider {
+public class GMFLabelProvider extends EMFLabelProvider {
protected IPageIconsRegistry editorRegistry;
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;
+ }
+}

Back to the top