Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/IsEditPartConstraint.java')
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/IsEditPartConstraint.java40
1 files changed, 40 insertions, 0 deletions
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
new file mode 100644
index 00000000000..5e7c0c6435c
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/IsEditPartConstraint.java
@@ -0,0 +1,40 @@
+/*****************************************************************************
+ * Copyright (c) 2011 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+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;
+
+/**
+ * Tests if the selection is an EditPart
+ *
+ * @author Camille Letavernier
+ */
+public class IsEditPartConstraint extends AbstractConstraint {
+
+ public boolean match(Object selection) {
+ return selection instanceof EditPart;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean equivalent(Constraint constraint) {
+ //TODO : This should probably not always be false
+ //Potential issue : the CompositeConstraint won't be able to
+ //automatically find the overriding constraints
+ return false;
+ }
+
+}

Back to the top