Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorashatalin2007-06-05 12:03:16 +0000
committerashatalin2007-06-05 12:03:16 +0000
commit6d71512a73a0e2c69620c622825229ae6b66afb1 (patch)
treea2c370d70c27d48e7e1cfbd4ffd921ba284f6a71 /plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal
parentf0b9bb93f98b8fd49e1a46b54610d58af4ebe2b4 (diff)
downloadorg.eclipse.gmf-tooling-6d71512a73a0e2c69620c622825229ae6b66afb1.tar.gz
org.eclipse.gmf-tooling-6d71512a73a0e2c69620c622825229ae6b66afb1.tar.xz
org.eclipse.gmf-tooling-6d71512a73a0e2c69620c622825229ae6b66afb1.zip
[190990] - Do not use deprecated org.eclipse.emf.ocl.query API in .bridge.trace plugin
Diffstat (limited to 'plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal')
-rw-r--r--plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/GmfTracePlugin.java4
-rw-r--r--plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/MatchingTrace.java22
-rw-r--r--plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/MergingIdentifierDispenser.java13
-rw-r--r--plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/TracePackage.java93
-rw-r--r--plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/GenCompartmentTraceImpl.java8
-rw-r--r--plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/GenLinkLabelTraceImpl.java6
-rw-r--r--plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/GenLinkTraceImpl.java8
-rw-r--r--plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/GenNodeLabelTraceImpl.java8
-rw-r--r--plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/GenNodeTraceImpl.java8
-rw-r--r--plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/MatchingTraceImpl.java63
-rw-r--r--plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/ToolGroupTraceImpl.java8
-rw-r--r--plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/TraceModelImpl.java1
-rw-r--r--plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/TracePackageImpl.java72
13 files changed, 71 insertions, 243 deletions
diff --git a/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/GmfTracePlugin.java b/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/GmfTracePlugin.java
index 23d7c57b4..a7120be12 100644
--- a/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/GmfTracePlugin.java
+++ b/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/GmfTracePlugin.java
@@ -1,7 +1,5 @@
package org.eclipse.gmf.internal.bridge.trace;
-import java.io.IOException;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
@@ -25,7 +23,7 @@ public class GmfTracePlugin extends Plugin {
return myInstance;
}
- public void logError(String message, IOException exception) {
+ public void logError(String message, Throwable exception) {
getLog().log(new Status(IStatus.ERROR, getBundle().getSymbolicName(), 0, message, exception));
}
diff --git a/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/MatchingTrace.java b/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/MatchingTrace.java
index 0b1840883..57546088c 100644
--- a/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/MatchingTrace.java
+++ b/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/MatchingTrace.java
@@ -8,8 +8,8 @@ package org.eclipse.gmf.internal.bridge.trace;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ocl.query.Query;
+import org.eclipse.ocl.ParserException;
+import org.eclipse.ocl.ecore.OCL.Query;
/**
* <!-- begin-user-doc -->
@@ -20,7 +20,6 @@ import org.eclipse.emf.ocl.query.Query;
* The following features are supported:
* <ul>
* <li>{@link org.eclipse.gmf.internal.bridge.trace.MatchingTrace#getQueryText <em>Query Text</em>}</li>
- * <li>{@link org.eclipse.gmf.internal.bridge.trace.MatchingTrace#getQuery <em>Query</em>}</li>
* </ul>
* </p>
*
@@ -56,27 +55,18 @@ public interface MatchingTrace extends AbstractTrace {
void setQueryText(String value);
/**
- * Returns the value of the '<em><b>Query</b></em>' containment reference.
* <!-- begin-user-doc -->
* <p>
- * If the meaning of the '<em>Query</em>' containment reference isn't clear,
+ * If the meaning of the '<em>Query Context</em>' reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
- * @return the value of the '<em>Query</em>' containment reference.
- * @see org.eclipse.gmf.internal.bridge.trace.TracePackage#getMatchingTrace_Query()
- * @model containment="true" transient="true" changeable="false" derived="true"
+ * @model kind="operation"
* @generated
*/
- Query getQuery();
+ EClass getQueryContext();
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @model
- * @generated
- */
- Query createQuery();
+ Query getQuery() throws ParserException;
/**
* <!-- begin-user-doc -->
diff --git a/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/MergingIdentifierDispenser.java b/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/MergingIdentifierDispenser.java
index f6a6d7c03..0d8a55415 100644
--- a/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/MergingIdentifierDispenser.java
+++ b/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/MergingIdentifierDispenser.java
@@ -30,6 +30,7 @@ import org.eclipse.gmf.codegen.gmfgen.GenNodeLabel;
import org.eclipse.gmf.codegen.gmfgen.GenTopLevelNode;
import org.eclipse.gmf.codegen.gmfgen.ToolGroup;
import org.eclipse.gmf.internal.bridge.StatefulVisualIdentifierDispencer;
+import org.eclipse.ocl.ParserException;
public class MergingIdentifierDispenser implements StatefulVisualIdentifierDispencer {
@@ -246,10 +247,14 @@ public class MergingIdentifierDispenser implements StatefulVisualIdentifierDispe
if (trace.isProcessed()) {
continue;
}
- Object result = trace.getQuery().evaluate(context);
- if (result instanceof Boolean && ((Boolean) result).booleanValue()) {
- trace.setProcessed(true);
- return trace.getVisualID();
+ try {
+ Object result = trace.getQuery().evaluate(context);
+ if (result instanceof Boolean && ((Boolean) result).booleanValue()) {
+ trace.setProcessed(true);
+ return trace.getVisualID();
+ }
+ } catch (ParserException e) {
+ GmfTracePlugin.getInstance().logError("Error while parcing expression body from trace", e);
}
}
return -1;
diff --git a/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/TracePackage.java b/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/TracePackage.java
index 3588c27ef..ee19a1bc3 100644
--- a/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/TracePackage.java
+++ b/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/TracePackage.java
@@ -189,22 +189,13 @@ public interface TracePackage extends EPackage {
int MATCHING_TRACE__QUERY_TEXT = ABSTRACT_TRACE_FEATURE_COUNT + 0;
/**
- * The feature id for the '<em><b>Query</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int MATCHING_TRACE__QUERY = ABSTRACT_TRACE_FEATURE_COUNT + 1;
-
- /**
* The number of structural features of the '<em>Matching Trace</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int MATCHING_TRACE_FEATURE_COUNT = ABSTRACT_TRACE_FEATURE_COUNT + 2;
+ int MATCHING_TRACE_FEATURE_COUNT = ABSTRACT_TRACE_FEATURE_COUNT + 1;
/**
* The meta object id for the '{@link org.eclipse.gmf.internal.bridge.trace.impl.GenNodeTraceImpl <em>Gen Node Trace</em>}' class.
@@ -244,15 +235,6 @@ public interface TracePackage extends EPackage {
int GEN_NODE_TRACE__QUERY_TEXT = MATCHING_TRACE__QUERY_TEXT;
/**
- * The feature id for the '<em><b>Query</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int GEN_NODE_TRACE__QUERY = MATCHING_TRACE__QUERY;
-
- /**
* The feature id for the '<em><b>Node Label Traces</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -317,15 +299,6 @@ public interface TracePackage extends EPackage {
int GEN_CHILD_NODE_TRACE__QUERY_TEXT = GEN_NODE_TRACE__QUERY_TEXT;
/**
- * The feature id for the '<em><b>Query</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int GEN_CHILD_NODE_TRACE__QUERY = GEN_NODE_TRACE__QUERY;
-
- /**
* The feature id for the '<em><b>Node Label Traces</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -390,15 +363,6 @@ public interface TracePackage extends EPackage {
int GEN_NODE_LABEL_TRACE__QUERY_TEXT = MATCHING_TRACE__QUERY_TEXT;
/**
- * The feature id for the '<em><b>Query</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int GEN_NODE_LABEL_TRACE__QUERY = MATCHING_TRACE__QUERY;
-
- /**
* The number of structural features of the '<em>Gen Node Label Trace</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -445,15 +409,6 @@ public interface TracePackage extends EPackage {
int GEN_LINK_TRACE__QUERY_TEXT = MATCHING_TRACE__QUERY_TEXT;
/**
- * The feature id for the '<em><b>Query</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int GEN_LINK_TRACE__QUERY = MATCHING_TRACE__QUERY;
-
- /**
* The feature id for the '<em><b>Link Label Traces</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -509,15 +464,6 @@ public interface TracePackage extends EPackage {
int GEN_COMPARTMENT_TRACE__QUERY_TEXT = MATCHING_TRACE__QUERY_TEXT;
/**
- * The feature id for the '<em><b>Query</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int GEN_COMPARTMENT_TRACE__QUERY = MATCHING_TRACE__QUERY;
-
- /**
* The number of structural features of the '<em>Gen Compartment Trace</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -564,15 +510,6 @@ public interface TracePackage extends EPackage {
int GEN_LINK_LABEL_TRACE__QUERY_TEXT = MATCHING_TRACE__QUERY_TEXT;
/**
- * The feature id for the '<em><b>Query</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int GEN_LINK_LABEL_TRACE__QUERY = MATCHING_TRACE__QUERY;
-
- /**
* The number of structural features of the '<em>Gen Link Label Trace</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -619,15 +556,6 @@ public interface TracePackage extends EPackage {
int TOOL_GROUP_TRACE__QUERY_TEXT = MATCHING_TRACE__QUERY_TEXT;
/**
- * The feature id for the '<em><b>Query</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TOOL_GROUP_TRACE__QUERY = MATCHING_TRACE__QUERY;
-
- /**
* The number of structural features of the '<em>Tool Group Trace</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -745,17 +673,6 @@ public interface TracePackage extends EPackage {
EAttribute getMatchingTrace_QueryText();
/**
- * Returns the meta object for the containment reference '{@link org.eclipse.gmf.internal.bridge.trace.MatchingTrace#getQuery <em>Query</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Query</em>'.
- * @see org.eclipse.gmf.internal.bridge.trace.MatchingTrace#getQuery()
- * @see #getMatchingTrace()
- * @generated
- */
- EReference getMatchingTrace_Query();
-
- /**
* Returns the meta object for class '{@link org.eclipse.gmf.internal.bridge.trace.GenNodeTrace <em>Gen Node Trace</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -967,14 +884,6 @@ public interface TracePackage extends EPackage {
EAttribute MATCHING_TRACE__QUERY_TEXT = eINSTANCE.getMatchingTrace_QueryText();
/**
- * The meta object literal for the '<em><b>Query</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference MATCHING_TRACE__QUERY = eINSTANCE.getMatchingTrace_Query();
-
- /**
* The meta object literal for the '{@link org.eclipse.gmf.internal.bridge.trace.impl.GenNodeTraceImpl <em>Gen Node Trace</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/GenCompartmentTraceImpl.java b/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/GenCompartmentTraceImpl.java
index 973698d94..d18c7ad5b 100644
--- a/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/GenCompartmentTraceImpl.java
+++ b/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/GenCompartmentTraceImpl.java
@@ -7,8 +7,6 @@
package org.eclipse.gmf.internal.bridge.trace.impl;
import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ocl.query.Query;
-import org.eclipse.emf.ocl.query.QueryFactory;
import org.eclipse.gmf.codegen.gmfgen.GMFGenPackage;
import org.eclipse.gmf.codegen.gmfgen.GenCompartment;
import org.eclipse.gmf.internal.bridge.trace.GenCompartmentTrace;
@@ -51,9 +49,9 @@ public class GenCompartmentTraceImpl extends MatchingTraceImpl implements GenCom
public void setContext(GenCompartment genCompartment) {
setQueryText("true");
}
-
- public Query createQuery() {
- return QueryFactory.eINSTANCE.createQuery(getQueryText(), GMFGenPackage.eINSTANCE.getGenCompartment());
+
+ public EClass getQueryContext() {
+ return GMFGenPackage.eINSTANCE.getGenCompartment();
}
} //GenCompartmentTraceImpl \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/GenLinkLabelTraceImpl.java b/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/GenLinkLabelTraceImpl.java
index b62b70805..2b039a655 100644
--- a/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/GenLinkLabelTraceImpl.java
+++ b/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/GenLinkLabelTraceImpl.java
@@ -7,8 +7,6 @@
package org.eclipse.gmf.internal.bridge.trace.impl;
import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ocl.query.Query;
-import org.eclipse.emf.ocl.query.QueryFactory;
import org.eclipse.gmf.codegen.gmfgen.GMFGenPackage;
import org.eclipse.gmf.codegen.gmfgen.GenLinkLabel;
import org.eclipse.gmf.internal.bridge.trace.GenLinkLabelTrace;
@@ -52,8 +50,8 @@ public class GenLinkLabelTraceImpl extends MatchingTraceImpl implements GenLinkL
setQueryText("true");
}
- public Query createQuery() {
- return QueryFactory.eINSTANCE.createQuery(getQueryText(), GMFGenPackage.eINSTANCE.getGenLinkLabel());
+ public EClass getQueryContext() {
+ return GMFGenPackage.eINSTANCE.getGenLinkLabel();
}
} //GenLinkLabelTraceImpl \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/GenLinkTraceImpl.java b/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/GenLinkTraceImpl.java
index c55532207..61a2d66da 100644
--- a/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/GenLinkTraceImpl.java
+++ b/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/GenLinkTraceImpl.java
@@ -15,8 +15,6 @@ import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.emf.ocl.query.Query;
-import org.eclipse.emf.ocl.query.QueryFactory;
import org.eclipse.gmf.codegen.gmfgen.FeatureLinkModelFacet;
import org.eclipse.gmf.codegen.gmfgen.GMFGenPackage;
import org.eclipse.gmf.codegen.gmfgen.GenLink;
@@ -180,9 +178,9 @@ public class GenLinkTraceImpl extends MatchingTraceImpl implements GenLinkTrace
}
return super.eIsSet(featureID);
}
-
- public Query createQuery() {
- return QueryFactory.eINSTANCE.createQuery(getQueryText(), GMFGenPackage.eINSTANCE.getGenLink());
+
+ public EClass getQueryContext() {
+ return GMFGenPackage.eINSTANCE.getGenLink();
}
} //GenLinkTraceImpl \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/GenNodeLabelTraceImpl.java b/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/GenNodeLabelTraceImpl.java
index 35d0ae72e..15a6177bf 100644
--- a/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/GenNodeLabelTraceImpl.java
+++ b/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/GenNodeLabelTraceImpl.java
@@ -7,8 +7,6 @@
package org.eclipse.gmf.internal.bridge.trace.impl;
import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ocl.query.Query;
-import org.eclipse.emf.ocl.query.QueryFactory;
import org.eclipse.gmf.codegen.gmfgen.GMFGenPackage;
import org.eclipse.gmf.codegen.gmfgen.GenNodeLabel;
import org.eclipse.gmf.internal.bridge.trace.GenNodeLabelTrace;
@@ -51,9 +49,9 @@ public class GenNodeLabelTraceImpl extends MatchingTraceImpl implements GenNodeL
public void setContext(GenNodeLabel genNodeLabel) {
setQueryText("true");
}
-
- public Query createQuery() {
- return QueryFactory.eINSTANCE.createQuery(getQueryText(), GMFGenPackage.eINSTANCE.getGenNodeLabel());
+
+ public EClass getQueryContext() {
+ return GMFGenPackage.eINSTANCE.getGenNodeLabel();
}
} //GenNodeLabelTraceImpl \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/GenNodeTraceImpl.java b/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/GenNodeTraceImpl.java
index f7216dfb8..ed196db79 100644
--- a/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/GenNodeTraceImpl.java
+++ b/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/GenNodeTraceImpl.java
@@ -14,8 +14,6 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.emf.ocl.query.Query;
-import org.eclipse.emf.ocl.query.QueryFactory;
import org.eclipse.gmf.codegen.gmfgen.GMFGenPackage;
import org.eclipse.gmf.codegen.gmfgen.GenNode;
import org.eclipse.gmf.codegen.gmfgen.TypeModelFacet;
@@ -216,9 +214,9 @@ public class GenNodeTraceImpl extends MatchingTraceImpl implements GenNodeTrace
}
return super.eIsSet(featureID);
}
-
- public Query createQuery() {
- return QueryFactory.eINSTANCE.createQuery(getQueryText(), GMFGenPackage.eINSTANCE.getGenTopLevelNode());
+
+ public EClass getQueryContext() {
+ return GMFGenPackage.eINSTANCE.getGenTopLevelNode();
}
} //GenNodeTraceImpl \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/MatchingTraceImpl.java b/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/MatchingTraceImpl.java
index 6b2e40d10..78d008e43 100644
--- a/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/MatchingTraceImpl.java
+++ b/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/MatchingTraceImpl.java
@@ -7,14 +7,15 @@
package org.eclipse.gmf.internal.bridge.trace.impl;
import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ocl.query.Query;
import org.eclipse.gmf.internal.bridge.trace.MatchingTrace;
import org.eclipse.gmf.internal.bridge.trace.TracePackage;
+import org.eclipse.ocl.ParserException;
+import org.eclipse.ocl.ecore.OCL;
+import org.eclipse.ocl.ecore.OCL.Helper;
+import org.eclipse.ocl.ecore.OCL.Query;
/**
* <!-- begin-user-doc -->
@@ -24,7 +25,6 @@ import org.eclipse.gmf.internal.bridge.trace.TracePackage;
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.gmf.internal.bridge.trace.impl.MatchingTraceImpl#getQueryText <em>Query Text</em>}</li>
- * <li>{@link org.eclipse.gmf.internal.bridge.trace.impl.MatchingTraceImpl#getQuery <em>Query</em>}</li>
* </ul>
* </p>
*
@@ -51,14 +51,6 @@ public abstract class MatchingTraceImpl extends AbstractTraceImpl implements Mat
*/
protected String queryText = QUERY_TEXT_EDEFAULT;
- /**
- * The cached value of the '{@link #getQuery() <em>Query</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getQuery()
- * @generated
- * @ordered
- */
protected Query query;
/**
@@ -106,26 +98,20 @@ public abstract class MatchingTraceImpl extends AbstractTraceImpl implements Mat
* <!-- end-user-doc -->
* @generated NOT
*/
- public Query getQuery() {
+ public abstract EClass getQueryContext();
+
+ public Query getQuery() throws ParserException {
if (query == null) {
query = createQuery();
}
return query;
}
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetQuery(Query newQuery, NotificationChain msgs) {
- Query oldQuery = query;
- query = newQuery;
- if (eNotificationRequired()) {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TracePackage.MATCHING_TRACE__QUERY, oldQuery, newQuery);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
+ private Query createQuery() throws ParserException {
+ OCL ocl = OCL.newInstance();
+ Helper oclHelper = ocl.createOCLHelper();
+ oclHelper.setContext(getQueryContext());
+ return ocl.createQuery(oclHelper.createQuery(getQueryText()));
}
/**
@@ -133,13 +119,6 @@ public abstract class MatchingTraceImpl extends AbstractTraceImpl implements Mat
* <!-- end-user-doc -->
* @generated NOT
*/
- public abstract Query createQuery();
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
public String getEClassComparision(String varName, EClass eClass) {
StringBuffer result = new StringBuffer();
result.append(varName);
@@ -178,26 +157,10 @@ public abstract class MatchingTraceImpl extends AbstractTraceImpl implements Mat
* @generated
*/
@Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case TracePackage.MATCHING_TRACE__QUERY:
- return basicSetQuery(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case TracePackage.MATCHING_TRACE__QUERY_TEXT:
return getQueryText();
- case TracePackage.MATCHING_TRACE__QUERY:
- return getQuery();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -242,8 +205,6 @@ public abstract class MatchingTraceImpl extends AbstractTraceImpl implements Mat
switch (featureID) {
case TracePackage.MATCHING_TRACE__QUERY_TEXT:
return QUERY_TEXT_EDEFAULT == null ? queryText != null : !QUERY_TEXT_EDEFAULT.equals(queryText);
- case TracePackage.MATCHING_TRACE__QUERY:
- return query != null;
}
return super.eIsSet(featureID);
}
diff --git a/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/ToolGroupTraceImpl.java b/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/ToolGroupTraceImpl.java
index df7ff2cac..af6641c3a 100644
--- a/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/ToolGroupTraceImpl.java
+++ b/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/ToolGroupTraceImpl.java
@@ -7,8 +7,6 @@
package org.eclipse.gmf.internal.bridge.trace.impl;
import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ocl.query.Query;
-import org.eclipse.emf.ocl.query.QueryFactory;
import org.eclipse.gmf.codegen.gmfgen.GMFGenPackage;
import org.eclipse.gmf.codegen.gmfgen.ToolGroup;
import org.eclipse.gmf.internal.bridge.trace.ToolGroupTrace;
@@ -53,9 +51,9 @@ public class ToolGroupTraceImpl extends MatchingTraceImpl implements ToolGroupTr
// Ensure that you remove @generated or mark it @generated NOT
throw new UnsupportedOperationException();
}
-
- public Query createQuery() {
- return QueryFactory.eINSTANCE.createQuery(getQueryText(), GMFGenPackage.eINSTANCE.getToolGroup());
+
+ public EClass getQueryContext() {
+ return GMFGenPackage.eINSTANCE.getToolGroup();
}
} //ToolGroupTraceImpl \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/TraceModelImpl.java b/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/TraceModelImpl.java
index 289ab8442..92fd2cbf8 100644
--- a/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/TraceModelImpl.java
+++ b/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/TraceModelImpl.java
@@ -8,7 +8,6 @@ package org.eclipse.gmf.internal.bridge.trace.impl;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Iterator;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.BasicEList;
diff --git a/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/TracePackageImpl.java b/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/TracePackageImpl.java
index 188446812..56d5e87b5 100644
--- a/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/TracePackageImpl.java
+++ b/plugins/org.eclipse.gmf.bridge.trace/src/org/eclipse/gmf/internal/bridge/trace/impl/TracePackageImpl.java
@@ -14,11 +14,6 @@ import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.emf.ocl.expressions.ExpressionsPackage;
-import org.eclipse.emf.ocl.query.QueryPackage;
-import org.eclipse.emf.ocl.types.TypesPackage;
-import org.eclipse.emf.ocl.uml.UMLPackage;
-import org.eclipse.emf.ocl.utilities.UtilitiesPackage;
import org.eclipse.gmf.codegen.gmfgen.GMFGenPackage;
import org.eclipse.gmf.internal.bridge.trace.AbstractTrace;
import org.eclipse.gmf.internal.bridge.trace.GenChildNodeTrace;
@@ -170,11 +165,6 @@ public class TracePackageImpl extends EPackageImpl implements TracePackage {
EcorePackage.eINSTANCE.eClass();
GenModelPackage.eINSTANCE.eClass();
GMFGenPackage.eINSTANCE.eClass();
- TypesPackage.eINSTANCE.eClass();
- ExpressionsPackage.eINSTANCE.eClass();
- UMLPackage.eINSTANCE.eClass();
- UtilitiesPackage.eINSTANCE.eClass();
- QueryPackage.eINSTANCE.eClass();
// Create package meta-data objects
theTracePackage.createPackageContents();
@@ -283,15 +273,6 @@ public class TracePackageImpl extends EPackageImpl implements TracePackage {
* <!-- end-user-doc -->
* @generated
*/
- public EReference getMatchingTrace_Query() {
- return (EReference)matchingTraceEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
public EClass getGenNodeTrace() {
return genNodeTraceEClass;
}
@@ -417,7 +398,6 @@ public class TracePackageImpl extends EPackageImpl implements TracePackage {
matchingTraceEClass = createEClass(MATCHING_TRACE);
createEAttribute(matchingTraceEClass, MATCHING_TRACE__QUERY_TEXT);
- createEReference(matchingTraceEClass, MATCHING_TRACE__QUERY);
genNodeTraceEClass = createEClass(GEN_NODE_TRACE);
createEReference(genNodeTraceEClass, GEN_NODE_TRACE__NODE_LABEL_TRACES);
@@ -461,7 +441,6 @@ public class TracePackageImpl extends EPackageImpl implements TracePackage {
setNsURI(eNS_URI);
// Obtain other dependent packages
- QueryPackage theQueryPackage = (QueryPackage)EPackage.Registry.INSTANCE.getEPackage(QueryPackage.eNS_URI);
GMFGenPackage theGMFGenPackage = (GMFGenPackage)EPackage.Registry.INSTANCE.getEPackage(GMFGenPackage.eNS_URI);
// Create type parameters
@@ -485,15 +464,15 @@ public class TracePackageImpl extends EPackageImpl implements TracePackage {
initEReference(getTraceModel_LinkTraces(), this.getGenLinkTrace(), null, "linkTraces", null, 0, -1, TraceModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getTraceModel_ToolGroupTraces(), this.getToolGroupTrace(), null, "toolGroupTraces", null, 0, -1, TraceModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- EOperation op = addEOperation(traceModelEClass, this.getGenNodeTrace(), "getNodeTrace", 0, 1);
- addEParameter(op, ecorePackage.getEInt(), "visualID", 0, 1);
+ EOperation op = addEOperation(traceModelEClass, this.getGenNodeTrace(), "getNodeTrace", 0, 1, IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, ecorePackage.getEInt(), "visualID", 0, 1, IS_UNIQUE, IS_ORDERED);
- op = addEOperation(traceModelEClass, this.getGenLinkTrace(), "getLinkTrace", 0, 1);
- addEParameter(op, ecorePackage.getEInt(), "visualID", 0, 1);
+ op = addEOperation(traceModelEClass, this.getGenLinkTrace(), "getLinkTrace", 0, 1, IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, ecorePackage.getEInt(), "visualID", 0, 1, IS_UNIQUE, IS_ORDERED);
- addEOperation(traceModelEClass, this.getAbstractTrace(), "getAllAbstractTraces", 0, -1);
+ addEOperation(traceModelEClass, this.getAbstractTrace(), "getAllAbstractTraces", 0, -1, IS_UNIQUE, IS_ORDERED);
- addEOperation(traceModelEClass, null, "purgeUnprocessedTraces");
+ addEOperation(traceModelEClass, null, "purgeUnprocessedTraces", 0, 1, IS_UNIQUE, IS_ORDERED);
initEClass(abstractTraceEClass, AbstractTrace.class, "AbstractTrace", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getAbstractTrace_VisualID(), ecorePackage.getEInt(), "visualID", null, 0, 1, AbstractTrace.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -501,52 +480,51 @@ public class TracePackageImpl extends EPackageImpl implements TracePackage {
initEClass(matchingTraceEClass, MatchingTrace.class, "MatchingTrace", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getMatchingTrace_QueryText(), ecorePackage.getEString(), "queryText", null, 0, 1, MatchingTrace.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
- initEReference(getMatchingTrace_Query(), theQueryPackage.getQuery(), null, "query", null, 0, 1, MatchingTrace.class, IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
- addEOperation(matchingTraceEClass, theQueryPackage.getQuery(), "createQuery", 0, 1);
+ addEOperation(matchingTraceEClass, ecorePackage.getEClass(), "getQueryContext", 0, 1, IS_UNIQUE, IS_ORDERED);
- op = addEOperation(matchingTraceEClass, ecorePackage.getEString(), "getEClassComparision", 0, 1);
- addEParameter(op, ecorePackage.getEString(), "varName", 0, 1);
- addEParameter(op, ecorePackage.getEClass(), "eClass", 0, 1);
+ op = addEOperation(matchingTraceEClass, ecorePackage.getEString(), "getEClassComparision", 0, 1, IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, ecorePackage.getEString(), "varName", 0, 1, IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, ecorePackage.getEClass(), "eClass", 0, 1, IS_UNIQUE, IS_ORDERED);
- op = addEOperation(matchingTraceEClass, ecorePackage.getEString(), "getEStructuralFeatureComparison", 0, 1);
- addEParameter(op, ecorePackage.getEString(), "varName", 0, 1);
- addEParameter(op, ecorePackage.getEStructuralFeature(), "feature", 0, 1);
+ op = addEOperation(matchingTraceEClass, ecorePackage.getEString(), "getEStructuralFeatureComparison", 0, 1, IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, ecorePackage.getEString(), "varName", 0, 1, IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, ecorePackage.getEStructuralFeature(), "feature", 0, 1, IS_UNIQUE, IS_ORDERED);
initEClass(genNodeTraceEClass, GenNodeTrace.class, "GenNodeTrace", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getGenNodeTrace_NodeLabelTraces(), this.getGenNodeLabelTrace(), null, "nodeLabelTraces", null, 0, -1, GenNodeTrace.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getGenNodeTrace_CompartmentTraces(), this.getGenCompartmentTrace(), null, "compartmentTraces", null, 0, -1, GenNodeTrace.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- op = addEOperation(genNodeTraceEClass, null, "setContext");
- addEParameter(op, theGMFGenPackage.getGenNode(), "genNode", 0, 1);
+ op = addEOperation(genNodeTraceEClass, null, "setContext", 0, 1, IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, theGMFGenPackage.getGenNode(), "genNode", 0, 1, IS_UNIQUE, IS_ORDERED);
initEClass(genChildNodeTraceEClass, GenChildNodeTrace.class, "GenChildNodeTrace", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(genNodeLabelTraceEClass, GenNodeLabelTrace.class, "GenNodeLabelTrace", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- op = addEOperation(genNodeLabelTraceEClass, null, "setContext");
- addEParameter(op, theGMFGenPackage.getGenNodeLabel(), "genNodeLabel", 0, 1);
+ op = addEOperation(genNodeLabelTraceEClass, null, "setContext", 0, 1, IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, theGMFGenPackage.getGenNodeLabel(), "genNodeLabel", 0, 1, IS_UNIQUE, IS_ORDERED);
initEClass(genLinkTraceEClass, GenLinkTrace.class, "GenLinkTrace", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getGenLinkTrace_LinkLabelTraces(), this.getGenLinkLabelTrace(), null, "linkLabelTraces", null, 0, -1, GenLinkTrace.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- op = addEOperation(genLinkTraceEClass, null, "setContext");
- addEParameter(op, theGMFGenPackage.getGenLink(), "genLink", 0, 1);
+ op = addEOperation(genLinkTraceEClass, null, "setContext", 0, 1, IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, theGMFGenPackage.getGenLink(), "genLink", 0, 1, IS_UNIQUE, IS_ORDERED);
initEClass(genCompartmentTraceEClass, GenCompartmentTrace.class, "GenCompartmentTrace", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- op = addEOperation(genCompartmentTraceEClass, null, "setContext");
- addEParameter(op, theGMFGenPackage.getGenCompartment(), "genCompartment", 0, 1);
+ op = addEOperation(genCompartmentTraceEClass, null, "setContext", 0, 1, IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, theGMFGenPackage.getGenCompartment(), "genCompartment", 0, 1, IS_UNIQUE, IS_ORDERED);
initEClass(genLinkLabelTraceEClass, GenLinkLabelTrace.class, "GenLinkLabelTrace", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- op = addEOperation(genLinkLabelTraceEClass, null, "setContext");
- addEParameter(op, theGMFGenPackage.getGenLinkLabel(), "genLinkLabel", 0, 1);
+ op = addEOperation(genLinkLabelTraceEClass, null, "setContext", 0, 1, IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, theGMFGenPackage.getGenLinkLabel(), "genLinkLabel", 0, 1, IS_UNIQUE, IS_ORDERED);
initEClass(toolGroupTraceEClass, ToolGroupTrace.class, "ToolGroupTrace", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- op = addEOperation(toolGroupTraceEClass, null, "setContext");
- addEParameter(op, theGMFGenPackage.getToolGroup(), "toolGroup", 0, 1);
+ op = addEOperation(toolGroupTraceEClass, null, "setContext", 0, 1, IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, theGMFGenPackage.getToolGroup(), "toolGroup", 0, 1, IS_UNIQUE, IS_ORDERED);
// Create resource
createResource(eNS_URI);

Back to the top