summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorskovalsky2012-03-18 18:46:39 (EDT)
committer mgolubev2012-03-18 18:46:39 (EDT)
commit10c1162368c285cd3d7ae8d83a8ebccf517763e5 (patch)
treeeeec7f98f927769e1b377959c32d6523c6ad4deb
parentc97d2aca67e41e94ab325a2dce2a78cac8cd8a46 (diff)
downloadorg.eclipse.gmf-tooling-10c1162368c285cd3d7ae8d83a8ebccf517763e5.zip
org.eclipse.gmf-tooling-10c1162368c285cd3d7ae8d83a8ebccf517763e5.tar.gz
org.eclipse.gmf-tooling-10c1162368c285cd3d7ae8d83a8ebccf517763e5.tar.bz2
[161545] - OclTracker API -- component that gets notified when a result
of OCL expression has changed
-rw-r--r--plugins/org.eclipse.gmf.tooling.runtime/META-INF/MANIFEST.MF6
-rw-r--r--plugins/org.eclipse.gmf.tooling.runtime/src/org/eclipse/gmf/tooling/runtime/ocl/tracker/HasOclTracker.java6
-rw-r--r--plugins/org.eclipse.gmf.tooling.runtime/src/org/eclipse/gmf/tooling/runtime/ocl/tracker/OclTracker.java29
-rw-r--r--plugins/org.eclipse.gmf.tooling.runtime/src/org/eclipse/gmf/tooling/runtime/ocl/tracker/OclTrackerBase.java34
-rw-r--r--plugins/org.eclipse.gmf.tooling.runtime/src/org/eclipse/gmf/tooling/runtime/ocl/tracker/OclTrackerFactory.java14
5 files changed, 87 insertions, 2 deletions
diff --git a/plugins/org.eclipse.gmf.tooling.runtime/META-INF/MANIFEST.MF b/plugins/org.eclipse.gmf.tooling.runtime/META-INF/MANIFEST.MF
index 6b088cc..7615c43 100644
--- a/plugins/org.eclipse.gmf.tooling.runtime/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.gmf.tooling.runtime/META-INF/MANIFEST.MF
@@ -12,9 +12,11 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.gef;visibility:=reexport,
org.eclipse.gmf.runtime.emf.commands.core,
org.eclipse.gmf.runtime.common.ui.services,
- org.eclipse.gmf.runtime.emf.type.core
+ org.eclipse.gmf.runtime.emf.type.core,
+ org.eclipse.gmf.runtime.diagram.core
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Activator: org.eclipse.gmf.tooling.runtime.GMFToolingRuntimePlugin
-Export-Package: org.eclipse.gmf.tooling.runtime.parsers
+Export-Package: org.eclipse.gmf.tooling.runtime.ocl.tracker,
+ org.eclipse.gmf.tooling.runtime.parsers
diff --git a/plugins/org.eclipse.gmf.tooling.runtime/src/org/eclipse/gmf/tooling/runtime/ocl/tracker/HasOclTracker.java b/plugins/org.eclipse.gmf.tooling.runtime/src/org/eclipse/gmf/tooling/runtime/ocl/tracker/HasOclTracker.java
new file mode 100644
index 0000000..d547945
--- /dev/null
+++ b/plugins/org.eclipse.gmf.tooling.runtime/src/org/eclipse/gmf/tooling/runtime/ocl/tracker/HasOclTracker.java
@@ -0,0 +1,6 @@
+package org.eclipse.gmf.tooling.runtime.ocl.tracker;
+
+public interface HasOclTracker {
+
+ public OclTracker getOclTracker();
+}
diff --git a/plugins/org.eclipse.gmf.tooling.runtime/src/org/eclipse/gmf/tooling/runtime/ocl/tracker/OclTracker.java b/plugins/org.eclipse.gmf.tooling.runtime/src/org/eclipse/gmf/tooling/runtime/ocl/tracker/OclTracker.java
new file mode 100644
index 0000000..8f2a9db
--- /dev/null
+++ b/plugins/org.eclipse.gmf.tooling.runtime/src/org/eclipse/gmf/tooling/runtime/ocl/tracker/OclTracker.java
@@ -0,0 +1,29 @@
+package org.eclipse.gmf.tooling.runtime.ocl.tracker;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener;
+
+public interface OclTracker {
+
+ public void initialize(EObject context);
+
+ public void installListeners(TransactionalEditingDomain domain, NotificationListener listener, Registrator registrator);
+
+ public void uninstallListeners();
+
+ public Object getValue();
+
+ public boolean handleNotification(Notification notification);
+
+ public String getExpressionBody();
+
+ public interface Registrator {
+
+ public void registerListener(String filterId, NotificationListener listener, EObject element);
+
+ public void unregisterListener(String filterId);
+ }
+
+}
diff --git a/plugins/org.eclipse.gmf.tooling.runtime/src/org/eclipse/gmf/tooling/runtime/ocl/tracker/OclTrackerBase.java b/plugins/org.eclipse.gmf.tooling.runtime/src/org/eclipse/gmf/tooling/runtime/ocl/tracker/OclTrackerBase.java
new file mode 100644
index 0000000..76bbadc
--- /dev/null
+++ b/plugins/org.eclipse.gmf.tooling.runtime/src/org/eclipse/gmf/tooling/runtime/ocl/tracker/OclTrackerBase.java
@@ -0,0 +1,34 @@
+package org.eclipse.gmf.tooling.runtime.ocl.tracker;
+
+import org.eclipse.emf.ecore.EObject;
+
+public abstract class OclTrackerBase implements OclTracker {
+
+ private EObject myContext;
+
+ private final String myExpressionBody;
+
+ protected OclTrackerBase(String expressionBody) {
+ myExpressionBody = expressionBody;
+ }
+
+ @Override
+ public final String getExpressionBody() {
+ return myExpressionBody;
+ }
+
+ @Override
+ public final void initialize(EObject context) {
+ if (myContext == context) {
+ return;
+ }
+ myContext = context;
+ doInitialize();
+ }
+
+ protected final EObject getContext() {
+ return myContext;
+ }
+
+ protected abstract void doInitialize();
+}
diff --git a/plugins/org.eclipse.gmf.tooling.runtime/src/org/eclipse/gmf/tooling/runtime/ocl/tracker/OclTrackerFactory.java b/plugins/org.eclipse.gmf.tooling.runtime/src/org/eclipse/gmf/tooling/runtime/ocl/tracker/OclTrackerFactory.java
new file mode 100644
index 0000000..27eac53
--- /dev/null
+++ b/plugins/org.eclipse.gmf.tooling.runtime/src/org/eclipse/gmf/tooling/runtime/ocl/tracker/OclTrackerFactory.java
@@ -0,0 +1,14 @@
+package org.eclipse.gmf.tooling.runtime.ocl.tracker;
+
+
+public interface OclTrackerFactory {
+
+ public OclTracker createOclTracker(String expressionBody, boolean cached);
+
+ public Type getImplementationType();
+
+ public static enum Type {
+ ANY, DEFAULT_GMFT, IMPACT_ANALYZER
+ }
+
+}