Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/EditorPropertyTester.java')
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/EditorPropertyTester.java53
1 files changed, 53 insertions, 0 deletions
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/EditorPropertyTester.java b/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/EditorPropertyTester.java
new file mode 100644
index 00000000000..de93a9a9e54
--- /dev/null
+++ b/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/EditorPropertyTester.java
@@ -0,0 +1,53 @@
+/*****************************************************************************
+ * Copyright (c) 2009 Atos Origin.
+ *
+ *
+ * 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:
+ * Alexia Allanic (Atos Origin) alexia.allanic@atosorigin.com - EditorPropertyTester Implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.layout;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.ui.IWorkbenchPart;
+
+/**
+ * The Class EditorPropertyTester.
+ */
+public class EditorPropertyTester extends PropertyTester {
+
+ /**
+ * Instantiates a new editor property tester.
+ */
+ public EditorPropertyTester() {
+ }
+
+ /**
+ * Test if the current editor is a registered editor.
+ *
+ * @param receiver
+ * the receiver
+ * @param property
+ * the property
+ * @param args
+ * the args
+ * @param expectedValue
+ * the expected value
+ *
+ * @return true, if test
+ */
+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+ if(receiver instanceof IWorkbenchPart && "isCorrectEditor".equals(property)) {
+ IWorkbenchPart part = (IWorkbenchPart)receiver;
+ return LayoutToolExtensionPointManager.getInstance().getSubEditor(part) != null;
+ }
+ return false;
+ }
+
+}

Back to the top