Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2008-04-14 08:38:02 +0000
committeratikhomirov2008-04-14 08:38:02 +0000
commite3b42828dfc836879ed3b1f19b30e11c7022375a (patch)
treecadd8ec07482e6c2b124f6cddbcb096dff1f1313 /plugins
parent78252a45863ccbf565402b3247a69bf2c3921230 (diff)
downloadorg.eclipse.gmf-tooling-e3b42828dfc836879ed3b1f19b30e11c7022375a.tar.gz
org.eclipse.gmf-tooling-e3b42828dfc836879ed3b1f19b30e11c7022375a.tar.xz
org.eclipse.gmf-tooling-e3b42828dfc836879ed3b1f19b30e11c7022375a.zip
[226149] Refactor Validation/Constraints: explicit context groupings instead of ID matching, unused IClientSelectors implementations are no longer generated, less custom code in the model, odd approach with map (semanticCtxIdMap) replaced with in-place VisualID check.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.gmf.codegen/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.gmf.codegen/models/gmfgen.ecore39
-rw-r--r--plugins/org.eclipse.gmf.codegen/models/gmfgen.genmodel13
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GMFGenFactory.java9
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GMFGenPackage.java318
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenAuditContext.java146
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenAuditRoot.java19
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenAuditRule.java39
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenAuditable.java28
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenFactoryImpl.java11
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenPackageImpl.java129
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenAuditContextImpl.java398
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenAuditRootImpl.java39
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenAuditRuleImpl.java94
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenAuditableImpl.java177
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenDiagramElementTargetImpl.java18
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/util/GMFGenAdapterFactory.java18
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/util/GMFGenSwitch.java21
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates-dynmodel/MetaModel.xpt11
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/MetaModel.xpt18
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/ConstraintProviders.xpt43
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/GenAuditRoot.ext37
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/GenModelUtils.ext9
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/editor/Utils.ext7
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/editor/ValidateAction.xpt18
-rwxr-xr-xplugins/org.eclipse.gmf.codegen/templates/xpt/providers/ValidationProvider.xpt242
26 files changed, 1472 insertions, 431 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/META-INF/MANIFEST.MF b/plugins/org.eclipse.gmf.codegen/META-INF/MANIFEST.MF
index 70f20b33c..02159d366 100644
--- a/plugins/org.eclipse.gmf.codegen/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.gmf.codegen/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.gmf.codegen; singleton:=true
-Bundle-Version: 2.0.100.qualifier
+Bundle-Version: 2.1.0.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.gmf.codegen.gmfgen,
diff --git a/plugins/org.eclipse.gmf.codegen/models/gmfgen.ecore b/plugins/org.eclipse.gmf.codegen/models/gmfgen.ecore
index 9f180e2ab..42e880665 100644
--- a/plugins/org.eclipse.gmf.codegen/models/gmfgen.ecore
+++ b/plugins/org.eclipse.gmf.codegen/models/gmfgen.ecore
@@ -1499,6 +1499,8 @@
eType="#//GenAuditContainer" containment="true" eOpposite="#//GenAuditContainer/root"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="rules" upperBound="-1"
eType="#//GenAuditRule" containment="true" eOpposite="#//GenAuditRule/root"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="clientContexts" upperBound="-1"
+ eType="#//GenAuditContext" containment="true" eOpposite="#//GenAuditContext/root"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="GenAuditContainer">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
@@ -1553,8 +1555,6 @@
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Auditing rule in the form of a constraint evaluated against its target"/>
</eAnnotations>
- <eOperations name="getContextSelectorClassName" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eOperations name="getContextSelectorQualifiedClassName" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eOperations name="getConstraintAdapterQualifiedClassName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eOperations name="getConstraintAdapterLocalClassName" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="root" lowerBound="1" eType="#//GenAuditRoot"
@@ -1563,8 +1563,6 @@
<details key="suppressedSetVisibility" value="true"/>
</eAnnotations>
</eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="contextSelectorLocalClassName"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="id" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Unique identifier of this audit rule"/>
@@ -1756,11 +1754,6 @@
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Target suitable for auditing"/>
</eAnnotations>
- <eOperations name="getClientContextID" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
- <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
- <details key="documentation" value="Gets identifier of the validation client context for this target. It's guaranteed as a valid java identifier."/>
- </eAnnotations>
- </eOperations>
<eOperations name="getTargetClass" eType="ecore:EClass platform:/plugin/org.eclipse.emf.codegen.ecore/model/GenModel.ecore#//GenClass">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Gets the validation target class in terms of EMFT validation framework."/>
@@ -1771,6 +1764,34 @@
<details key="documentation" value="Consists of ecore meta-model only package names and target class simple name"/>
</eAnnotations>
</eOperations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="contextSelector" eType="#//GenAuditContext"
+ eOpposite="#//GenAuditContext/ruleTargets">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="To apply audit to this target, we need to select appropriate input, and here's selector that helps with that"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="GenAuditContext">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value=""/>
+ </eAnnotations>
+ <eOperations name="getQualifiedClassName" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="root" lowerBound="1" eType="#//GenAuditRoot"
+ resolveProxies="false" eOpposite="#//GenAuditRoot/clientContexts"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
+ defaultValueLiteral="DefaultCtx">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="Identifier of the validation client context for this target. Should be a valid java identifier. Identifier will be qualified automatically (i.e. should be unique within this editor only)."/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="className" lowerBound="1"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="Unless explicitly set, equals to 'id'. Note, this class may get generated as inner class."/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="ruleTargets" upperBound="-1"
+ eType="#//GenAuditable" eOpposite="#//GenAuditable/contextSelector"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="GenMeasurable" abstract="true" interface="true"
eSuperTypes="#//GenRuleTarget">
diff --git a/plugins/org.eclipse.gmf.codegen/models/gmfgen.genmodel b/plugins/org.eclipse.gmf.codegen/models/gmfgen.genmodel
index 004feeb02..30d202c14 100644
--- a/plugins/org.eclipse.gmf.codegen/models/gmfgen.genmodel
+++ b/plugins/org.eclipse.gmf.codegen/models/gmfgen.genmodel
@@ -695,6 +695,7 @@
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference gmfgen.ecore#//GenAuditRoot/editorGen"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference gmfgen.ecore#//GenAuditRoot/categories"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference gmfgen.ecore#//GenAuditRoot/rules"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference gmfgen.ecore#//GenAuditRoot/clientContexts"/>
</genClasses>
<genClasses ecoreClass="gmfgen.ecore#//GenAuditContainer">
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference gmfgen.ecore#//GenAuditContainer/root"/>
@@ -710,7 +711,6 @@
</genClasses>
<genClasses ecoreClass="gmfgen.ecore#//GenAuditRule">
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference gmfgen.ecore#//GenAuditRule/root"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//GenAuditRule/contextSelectorLocalClassName"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//GenAuditRule/id"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference gmfgen.ecore#//GenAuditRule/rule"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference gmfgen.ecore#//GenAuditRule/target"/>
@@ -719,8 +719,6 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//GenAuditRule/useInLiveMode"/>
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//GenAuditRule/requiresConstraintAdapter"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference gmfgen.ecore#//GenAuditRule/category"/>
- <genOperations ecoreOperation="gmfgen.ecore#//GenAuditRule/getContextSelectorClassName"/>
- <genOperations ecoreOperation="gmfgen.ecore#//GenAuditRule/getContextSelectorQualifiedClassName"/>
<genOperations ecoreOperation="gmfgen.ecore#//GenAuditRule/getConstraintAdapterQualifiedClassName"/>
<genOperations ecoreOperation="gmfgen.ecore#//GenAuditRule/getConstraintAdapterLocalClassName"/>
</genClasses>
@@ -757,10 +755,17 @@
<genFeatures notify="false" createChild="false" ecoreFeature="ecore:EReference gmfgen.ecore#//GenAuditedMetricTarget/metricValueContext"/>
</genClasses>
<genClasses ecoreClass="gmfgen.ecore#//GenAuditable">
- <genOperations ecoreOperation="gmfgen.ecore#//GenAuditable/getClientContextID"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference gmfgen.ecore#//GenAuditable/contextSelector"/>
<genOperations ecoreOperation="gmfgen.ecore#//GenAuditable/getTargetClass"/>
<genOperations ecoreOperation="gmfgen.ecore#//GenAuditable/getTargetClassModelQualifiedName"/>
</genClasses>
+ <genClasses ecoreClass="gmfgen.ecore#//GenAuditContext">
+ <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference gmfgen.ecore#//GenAuditContext/root"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//GenAuditContext/id"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//GenAuditContext/className"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference gmfgen.ecore#//GenAuditContext/ruleTargets"/>
+ <genOperations ecoreOperation="gmfgen.ecore#//GenAuditContext/getQualifiedClassName"/>
+ </genClasses>
<genClasses ecoreClass="gmfgen.ecore#//GenMeasurable"/>
<genClasses ecoreClass="gmfgen.ecore#//GenExpressionProviderContainer">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//GenExpressionProviderContainer/expressionsPackageName"/>
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GMFGenFactory.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GMFGenFactory.java
index 3fae36737..331f43d53 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GMFGenFactory.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GMFGenFactory.java
@@ -575,6 +575,15 @@ public interface GMFGenFactory extends EFactory {
GenAuditedMetricTarget createGenAuditedMetricTarget();
/**
+ * Returns a new object of class '<em>Gen Audit Context</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Gen Audit Context</em>'.
+ * @generated
+ */
+ GenAuditContext createGenAuditContext();
+
+ /**
* Returns a new object of class '<em>Gen Expression Provider Container</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GMFGenPackage.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GMFGenPackage.java
index 9c0df1b1d..13620d308 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GMFGenPackage.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GMFGenPackage.java
@@ -7372,13 +7372,22 @@ public interface GMFGenPackage extends EPackage {
int GEN_AUDIT_ROOT__RULES = 2;
/**
+ * The feature id for the '<em><b>Client Contexts</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GEN_AUDIT_ROOT__CLIENT_CONTEXTS = 3;
+
+ /**
* The number of structural features of the '<em>Gen Audit Root</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int GEN_AUDIT_ROOT_FEATURE_COUNT = 3;
+ int GEN_AUDIT_ROOT_FEATURE_COUNT = 4;
/**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.impl.GenAuditContainerImpl <em>Gen Audit Container</em>}' class.
@@ -7528,22 +7537,13 @@ public interface GMFGenPackage extends EPackage {
int GEN_AUDIT_RULE__ROOT = GEN_RULE_BASE_FEATURE_COUNT + 0;
/**
- * The feature id for the '<em><b>Context Selector Local Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int GEN_AUDIT_RULE__CONTEXT_SELECTOR_LOCAL_CLASS_NAME = GEN_RULE_BASE_FEATURE_COUNT + 1;
-
- /**
* The feature id for the '<em><b>Id</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int GEN_AUDIT_RULE__ID = GEN_RULE_BASE_FEATURE_COUNT + 2;
+ int GEN_AUDIT_RULE__ID = GEN_RULE_BASE_FEATURE_COUNT + 1;
/**
* The feature id for the '<em><b>Rule</b></em>' containment reference.
@@ -7552,7 +7552,7 @@ public interface GMFGenPackage extends EPackage {
* @generated
* @ordered
*/
- int GEN_AUDIT_RULE__RULE = GEN_RULE_BASE_FEATURE_COUNT + 3;
+ int GEN_AUDIT_RULE__RULE = GEN_RULE_BASE_FEATURE_COUNT + 2;
/**
* The feature id for the '<em><b>Target</b></em>' containment reference.
@@ -7561,7 +7561,7 @@ public interface GMFGenPackage extends EPackage {
* @generated
* @ordered
*/
- int GEN_AUDIT_RULE__TARGET = GEN_RULE_BASE_FEATURE_COUNT + 4;
+ int GEN_AUDIT_RULE__TARGET = GEN_RULE_BASE_FEATURE_COUNT + 3;
/**
* The feature id for the '<em><b>Message</b></em>' attribute.
@@ -7570,7 +7570,7 @@ public interface GMFGenPackage extends EPackage {
* @generated
* @ordered
*/
- int GEN_AUDIT_RULE__MESSAGE = GEN_RULE_BASE_FEATURE_COUNT + 5;
+ int GEN_AUDIT_RULE__MESSAGE = GEN_RULE_BASE_FEATURE_COUNT + 4;
/**
* The feature id for the '<em><b>Severity</b></em>' attribute.
@@ -7579,7 +7579,7 @@ public interface GMFGenPackage extends EPackage {
* @generated
* @ordered
*/
- int GEN_AUDIT_RULE__SEVERITY = GEN_RULE_BASE_FEATURE_COUNT + 6;
+ int GEN_AUDIT_RULE__SEVERITY = GEN_RULE_BASE_FEATURE_COUNT + 5;
/**
* The feature id for the '<em><b>Use In Live Mode</b></em>' attribute.
@@ -7588,7 +7588,7 @@ public interface GMFGenPackage extends EPackage {
* @generated
* @ordered
*/
- int GEN_AUDIT_RULE__USE_IN_LIVE_MODE = GEN_RULE_BASE_FEATURE_COUNT + 7;
+ int GEN_AUDIT_RULE__USE_IN_LIVE_MODE = GEN_RULE_BASE_FEATURE_COUNT + 6;
/**
* The feature id for the '<em><b>Requires Constraint Adapter</b></em>' attribute.
@@ -7597,7 +7597,7 @@ public interface GMFGenPackage extends EPackage {
* @generated
* @ordered
*/
- int GEN_AUDIT_RULE__REQUIRES_CONSTRAINT_ADAPTER = GEN_RULE_BASE_FEATURE_COUNT + 8;
+ int GEN_AUDIT_RULE__REQUIRES_CONSTRAINT_ADAPTER = GEN_RULE_BASE_FEATURE_COUNT + 7;
/**
* The feature id for the '<em><b>Category</b></em>' reference.
@@ -7606,7 +7606,7 @@ public interface GMFGenPackage extends EPackage {
* @generated
* @ordered
*/
- int GEN_AUDIT_RULE__CATEGORY = GEN_RULE_BASE_FEATURE_COUNT + 9;
+ int GEN_AUDIT_RULE__CATEGORY = GEN_RULE_BASE_FEATURE_COUNT + 8;
/**
* The number of structural features of the '<em>Gen Audit Rule</em>' class.
@@ -7615,7 +7615,7 @@ public interface GMFGenPackage extends EPackage {
* @generated
* @ordered
*/
- int GEN_AUDIT_RULE_FEATURE_COUNT = GEN_RULE_BASE_FEATURE_COUNT + 10;
+ int GEN_AUDIT_RULE_FEATURE_COUNT = GEN_RULE_BASE_FEATURE_COUNT + 9;
/**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.GenRuleTarget <em>Gen Rule Target</em>}' class.
@@ -7647,13 +7647,22 @@ public interface GMFGenPackage extends EPackage {
int GEN_AUDITABLE = 93;
/**
+ * The feature id for the '<em><b>Context Selector</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GEN_AUDITABLE__CONTEXT_SELECTOR = GEN_RULE_TARGET_FEATURE_COUNT + 0;
+
+ /**
* The number of structural features of the '<em>Gen Auditable</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int GEN_AUDITABLE_FEATURE_COUNT = GEN_RULE_TARGET_FEATURE_COUNT + 0;
+ int GEN_AUDITABLE_FEATURE_COUNT = GEN_RULE_TARGET_FEATURE_COUNT + 1;
/**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.impl.GenDomainElementTargetImpl <em>Gen Domain Element Target</em>}' class.
@@ -7666,6 +7675,15 @@ public interface GMFGenPackage extends EPackage {
int GEN_DOMAIN_ELEMENT_TARGET = 86;
/**
+ * The feature id for the '<em><b>Context Selector</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GEN_DOMAIN_ELEMENT_TARGET__CONTEXT_SELECTOR = GEN_AUDITABLE__CONTEXT_SELECTOR;
+
+ /**
* The feature id for the '<em><b>Element</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -7694,6 +7712,15 @@ public interface GMFGenPackage extends EPackage {
int GEN_DIAGRAM_ELEMENT_TARGET = 87;
/**
+ * The feature id for the '<em><b>Context Selector</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GEN_DIAGRAM_ELEMENT_TARGET__CONTEXT_SELECTOR = GEN_AUDITABLE__CONTEXT_SELECTOR;
+
+ /**
* The feature id for the '<em><b>Element</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -7722,6 +7749,15 @@ public interface GMFGenPackage extends EPackage {
int GEN_DOMAIN_ATTRIBUTE_TARGET = 88;
/**
+ * The feature id for the '<em><b>Context Selector</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GEN_DOMAIN_ATTRIBUTE_TARGET__CONTEXT_SELECTOR = GEN_AUDITABLE__CONTEXT_SELECTOR;
+
+ /**
* The feature id for the '<em><b>Attribute</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -7759,6 +7795,15 @@ public interface GMFGenPackage extends EPackage {
int GEN_NOTATION_ELEMENT_TARGET = 89;
/**
+ * The feature id for the '<em><b>Context Selector</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GEN_NOTATION_ELEMENT_TARGET__CONTEXT_SELECTOR = GEN_AUDITABLE__CONTEXT_SELECTOR;
+
+ /**
* The feature id for the '<em><b>Element</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -7915,6 +7960,15 @@ public interface GMFGenPackage extends EPackage {
int GEN_AUDITED_METRIC_TARGET = 92;
/**
+ * The feature id for the '<em><b>Context Selector</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GEN_AUDITED_METRIC_TARGET__CONTEXT_SELECTOR = GEN_AUDITABLE__CONTEXT_SELECTOR;
+
+ /**
* The feature id for the '<em><b>Metric</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -7942,6 +7996,61 @@ public interface GMFGenPackage extends EPackage {
int GEN_AUDITED_METRIC_TARGET_FEATURE_COUNT = GEN_AUDITABLE_FEATURE_COUNT + 2;
/**
+ * The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.impl.GenAuditContextImpl <em>Gen Audit Context</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.gmf.codegen.gmfgen.impl.GenAuditContextImpl
+ * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenAuditContext()
+ * @generated
+ */
+ int GEN_AUDIT_CONTEXT = 94;
+
+ /**
+ * The feature id for the '<em><b>Root</b></em>' container reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GEN_AUDIT_CONTEXT__ROOT = 0;
+
+ /**
+ * The feature id for the '<em><b>Id</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GEN_AUDIT_CONTEXT__ID = 1;
+
+ /**
+ * The feature id for the '<em><b>Class Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GEN_AUDIT_CONTEXT__CLASS_NAME = 2;
+
+ /**
+ * The feature id for the '<em><b>Rule Targets</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GEN_AUDIT_CONTEXT__RULE_TARGETS = 3;
+
+ /**
+ * The number of structural features of the '<em>Gen Audit Context</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GEN_AUDIT_CONTEXT_FEATURE_COUNT = 4;
+
+ /**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.GenMeasurable <em>Gen Measurable</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -7949,7 +8058,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenMeasurable()
* @generated
*/
- int GEN_MEASURABLE = 94;
+ int GEN_MEASURABLE = 95;
/**
* The number of structural features of the '<em>Gen Measurable</em>' class.
@@ -7968,7 +8077,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenExpressionProviderContainer()
* @generated
*/
- int GEN_EXPRESSION_PROVIDER_CONTAINER = 95;
+ int GEN_EXPRESSION_PROVIDER_CONTAINER = 96;
/**
* The feature id for the '<em><b>Expressions Package Name</b></em>' attribute.
@@ -8023,7 +8132,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenExpressionProviderBase()
* @generated
*/
- int GEN_EXPRESSION_PROVIDER_BASE = 96;
+ int GEN_EXPRESSION_PROVIDER_BASE = 97;
/**
* The feature id for the '<em><b>Expressions</b></em>' reference list.
@@ -8060,7 +8169,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenJavaExpressionProvider()
* @generated
*/
- int GEN_JAVA_EXPRESSION_PROVIDER = 97;
+ int GEN_JAVA_EXPRESSION_PROVIDER = 98;
/**
* The feature id for the '<em><b>Expressions</b></em>' reference list.
@@ -8097,7 +8206,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenExpressionInterpreter()
* @generated
*/
- int GEN_EXPRESSION_INTERPRETER = 98;
+ int GEN_EXPRESSION_INTERPRETER = 99;
/**
* The feature id for the '<em><b>Expressions</b></em>' reference list.
@@ -8152,7 +8261,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenDomainModelNavigator()
* @generated
*/
- int GEN_DOMAIN_MODEL_NAVIGATOR = 99;
+ int GEN_DOMAIN_MODEL_NAVIGATOR = 100;
/**
* The feature id for the '<em><b>Generate Domain Model Navigator</b></em>' attribute.
@@ -8243,7 +8352,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenNavigator()
* @generated
*/
- int GEN_NAVIGATOR = 100;
+ int GEN_NAVIGATOR = 101;
/**
* The feature id for the '<em><b>Generate Domain Model Navigator</b></em>' attribute.
@@ -8496,7 +8605,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenNavigatorChildReference()
* @generated
*/
- int GEN_NAVIGATOR_CHILD_REFERENCE = 101;
+ int GEN_NAVIGATOR_CHILD_REFERENCE = 102;
/**
* The feature id for the '<em><b>Navigator</b></em>' container reference.
@@ -8578,7 +8687,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenNavigatorPath()
* @generated
*/
- int GEN_NAVIGATOR_PATH = 102;
+ int GEN_NAVIGATOR_PATH = 103;
/**
* The feature id for the '<em><b>Segments</b></em>' containment reference list.
@@ -8606,7 +8715,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenNavigatorPathSegment()
* @generated
*/
- int GEN_NAVIGATOR_PATH_SEGMENT = 103;
+ int GEN_NAVIGATOR_PATH_SEGMENT = 104;
/**
* The feature id for the '<em><b>Path</b></em>' container reference.
@@ -8652,7 +8761,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenPropertySheet()
* @generated
*/
- int GEN_PROPERTY_SHEET = 104;
+ int GEN_PROPERTY_SHEET = 105;
/**
* The feature id for the '<em><b>Editor Gen</b></em>' container reference.
@@ -8725,7 +8834,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenPropertyTab()
* @generated
*/
- int GEN_PROPERTY_TAB = 105;
+ int GEN_PROPERTY_TAB = 106;
/**
* The feature id for the '<em><b>Sheet</b></em>' container reference.
@@ -8771,7 +8880,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenStandardPropertyTab()
* @generated
*/
- int GEN_STANDARD_PROPERTY_TAB = 106;
+ int GEN_STANDARD_PROPERTY_TAB = 107;
/**
* The feature id for the '<em><b>Sheet</b></em>' container reference.
@@ -8817,7 +8926,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenCustomPropertyTab()
* @generated
*/
- int GEN_CUSTOM_PROPERTY_TAB = 107;
+ int GEN_CUSTOM_PROPERTY_TAB = 108;
/**
* The feature id for the '<em><b>Sheet</b></em>' container reference.
@@ -8881,7 +8990,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenPropertyTabFilter()
* @generated
*/
- int GEN_PROPERTY_TAB_FILTER = 108;
+ int GEN_PROPERTY_TAB_FILTER = 109;
/**
* The feature id for the '<em><b>Tab</b></em>' container reference.
@@ -8909,7 +9018,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getTypeTabFilter()
* @generated
*/
- int TYPE_TAB_FILTER = 109;
+ int TYPE_TAB_FILTER = 110;
/**
* The feature id for the '<em><b>Tab</b></em>' container reference.
@@ -8955,7 +9064,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getCustomTabFilter()
* @generated
*/
- int CUSTOM_TAB_FILTER = 110;
+ int CUSTOM_TAB_FILTER = 111;
/**
* The feature id for the '<em><b>Tab</b></em>' container reference.
@@ -8992,7 +9101,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenContributionItem()
* @generated
*/
- int GEN_CONTRIBUTION_ITEM = 111;
+ int GEN_CONTRIBUTION_ITEM = 112;
/**
* The feature id for the '<em><b>Owner</b></em>' container reference.
@@ -9029,7 +9138,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenSharedContributionItem()
* @generated
*/
- int GEN_SHARED_CONTRIBUTION_ITEM = 112;
+ int GEN_SHARED_CONTRIBUTION_ITEM = 113;
/**
* The feature id for the '<em><b>Owner</b></em>' container reference.
@@ -9075,7 +9184,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenGroupMarker()
* @generated
*/
- int GEN_GROUP_MARKER = 113;
+ int GEN_GROUP_MARKER = 114;
/**
* The feature id for the '<em><b>Owner</b></em>' container reference.
@@ -9121,7 +9230,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenSeparator()
* @generated
*/
- int GEN_SEPARATOR = 114;
+ int GEN_SEPARATOR = 115;
/**
* The feature id for the '<em><b>Owner</b></em>' container reference.
@@ -9167,7 +9276,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenActionFactoryContributionItem()
* @generated
*/
- int GEN_ACTION_FACTORY_CONTRIBUTION_ITEM = 115;
+ int GEN_ACTION_FACTORY_CONTRIBUTION_ITEM = 116;
/**
* The feature id for the '<em><b>Owner</b></em>' container reference.
@@ -9213,7 +9322,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenContributionManager()
* @generated
*/
- int GEN_CONTRIBUTION_MANAGER = 116;
+ int GEN_CONTRIBUTION_MANAGER = 117;
/**
* The feature id for the '<em><b>Owner</b></em>' container reference.
@@ -9268,7 +9377,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenMenuManager()
* @generated
*/
- int GEN_MENU_MANAGER = 117;
+ int GEN_MENU_MANAGER = 118;
/**
* The feature id for the '<em><b>Owner</b></em>' container reference.
@@ -9332,7 +9441,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenToolBarManager()
* @generated
*/
- int GEN_TOOL_BAR_MANAGER = 118;
+ int GEN_TOOL_BAR_MANAGER = 119;
/**
* The feature id for the '<em><b>Owner</b></em>' container reference.
@@ -9387,7 +9496,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenApplication()
* @generated
*/
- int GEN_APPLICATION = 119;
+ int GEN_APPLICATION = 120;
/**
* The feature id for the '<em><b>Editor Gen</b></em>' container reference.
@@ -9532,7 +9641,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getStandardPreferencePages()
* @generated
*/
- int STANDARD_PREFERENCE_PAGES = 120;
+ int STANDARD_PREFERENCE_PAGES = 121;
/**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.RulerUnits <em>Ruler Units</em>}' enum.
@@ -9542,7 +9651,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getRulerUnits()
* @generated
*/
- int RULER_UNITS = 121;
+ int RULER_UNITS = 122;
/**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.Routing <em>Routing</em>}' enum.
@@ -9552,7 +9661,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getRouting()
* @generated
*/
- int ROUTING = 122;
+ int ROUTING = 123;
/**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.JFaceFont <em>JFace Font</em>}' enum.
@@ -9562,7 +9671,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getJFaceFont()
* @generated
*/
- int JFACE_FONT = 123;
+ int JFACE_FONT = 124;
/**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.FontStyle <em>Font Style</em>}' enum.
@@ -9572,7 +9681,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getFontStyle()
* @generated
*/
- int FONT_STYLE = 124;
+ int FONT_STYLE = 125;
/**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.DiagramColors <em>Diagram Colors</em>}' enum.
@@ -9582,7 +9691,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getDiagramColors()
* @generated
*/
- int DIAGRAM_COLORS = 125;
+ int DIAGRAM_COLORS = 126;
/**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.ProviderPriority <em>Provider Priority</em>}' enum.
@@ -9592,7 +9701,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getProviderPriority()
* @generated
*/
- int PROVIDER_PRIORITY = 126;
+ int PROVIDER_PRIORITY = 127;
/**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.LinkLabelAlignment <em>Link Label Alignment</em>}' enum.
@@ -9602,7 +9711,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getLinkLabelAlignment()
* @generated
*/
- int LINK_LABEL_ALIGNMENT = 127;
+ int LINK_LABEL_ALIGNMENT = 128;
/**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.LabelTextAccessMethod <em>Label Text Access Method</em>}' enum.
@@ -9612,7 +9721,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getLabelTextAccessMethod()
* @generated
*/
- int LABEL_TEXT_ACCESS_METHOD = 128;
+ int LABEL_TEXT_ACCESS_METHOD = 129;
/**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.ViewmapLayoutType <em>Viewmap Layout Type</em>}' enum.
@@ -9622,7 +9731,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getViewmapLayoutType()
* @generated
*/
- int VIEWMAP_LAYOUT_TYPE = 129;
+ int VIEWMAP_LAYOUT_TYPE = 130;
/**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.StandardEntryKind <em>Standard Entry Kind</em>}' enum.
@@ -9632,7 +9741,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getStandardEntryKind()
* @generated
*/
- int STANDARD_ENTRY_KIND = 130;
+ int STANDARD_ENTRY_KIND = 131;
/**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.GenSeverity <em>Gen Severity</em>}' enum.
@@ -9642,7 +9751,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenSeverity()
* @generated
*/
- int GEN_SEVERITY = 131;
+ int GEN_SEVERITY = 132;
/**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.GenLanguage <em>Gen Language</em>}' enum.
@@ -9652,7 +9761,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenLanguage()
* @generated
*/
- int GEN_LANGUAGE = 132;
+ int GEN_LANGUAGE = 133;
/**
@@ -9663,7 +9772,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenNavigatorReferenceType()
* @generated
*/
- int GEN_NAVIGATOR_REFERENCE_TYPE = 133;
+ int GEN_NAVIGATOR_REFERENCE_TYPE = 134;
/**
@@ -9674,7 +9783,7 @@ public interface GMFGenPackage extends EPackage {
* @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGeneratedType()
* @generated
*/
- int GENERATED_TYPE = 134;
+ int GENERATED_TYPE = 135;
/**
@@ -13710,6 +13819,17 @@ public interface GMFGenPackage extends EPackage {
EReference getGenAuditRoot_Rules();
/**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.gmf.codegen.gmfgen.GenAuditRoot#getClientContexts <em>Client Contexts</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Client Contexts</em>'.
+ * @see org.eclipse.gmf.codegen.gmfgen.GenAuditRoot#getClientContexts()
+ * @see #getGenAuditRoot()
+ * @generated
+ */
+ EReference getGenAuditRoot_ClientContexts();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.gmf.codegen.gmfgen.GenAuditContainer <em>Gen Audit Container</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -13839,17 +13959,6 @@ public interface GMFGenPackage extends EPackage {
EReference getGenAuditRule_Root();
/**
- * Returns the meta object for the attribute '{@link org.eclipse.gmf.codegen.gmfgen.GenAuditRule#getContextSelectorLocalClassName <em>Context Selector Local Class Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Context Selector Local Class Name</em>'.
- * @see org.eclipse.gmf.codegen.gmfgen.GenAuditRule#getContextSelectorLocalClassName()
- * @see #getGenAuditRule()
- * @generated
- */
- EAttribute getGenAuditRule_ContextSelectorLocalClassName();
-
- /**
* Returns the meta object for the attribute '{@link org.eclipse.gmf.codegen.gmfgen.GenAuditRule#getId <em>Id</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -14193,6 +14302,71 @@ public interface GMFGenPackage extends EPackage {
EClass getGenAuditable();
/**
+ * Returns the meta object for the reference '{@link org.eclipse.gmf.codegen.gmfgen.GenAuditable#getContextSelector <em>Context Selector</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Context Selector</em>'.
+ * @see org.eclipse.gmf.codegen.gmfgen.GenAuditable#getContextSelector()
+ * @see #getGenAuditable()
+ * @generated
+ */
+ EReference getGenAuditable_ContextSelector();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.gmf.codegen.gmfgen.GenAuditContext <em>Gen Audit Context</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Gen Audit Context</em>'.
+ * @see org.eclipse.gmf.codegen.gmfgen.GenAuditContext
+ * @generated
+ */
+ EClass getGenAuditContext();
+
+ /**
+ * Returns the meta object for the container reference '{@link org.eclipse.gmf.codegen.gmfgen.GenAuditContext#getRoot <em>Root</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the container reference '<em>Root</em>'.
+ * @see org.eclipse.gmf.codegen.gmfgen.GenAuditContext#getRoot()
+ * @see #getGenAuditContext()
+ * @generated
+ */
+ EReference getGenAuditContext_Root();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.gmf.codegen.gmfgen.GenAuditContext#getId <em>Id</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Id</em>'.
+ * @see org.eclipse.gmf.codegen.gmfgen.GenAuditContext#getId()
+ * @see #getGenAuditContext()
+ * @generated
+ */
+ EAttribute getGenAuditContext_Id();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.gmf.codegen.gmfgen.GenAuditContext#getClassName <em>Class Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Class Name</em>'.
+ * @see org.eclipse.gmf.codegen.gmfgen.GenAuditContext#getClassName()
+ * @see #getGenAuditContext()
+ * @generated
+ */
+ EAttribute getGenAuditContext_ClassName();
+
+ /**
+ * Returns the meta object for the reference list '{@link org.eclipse.gmf.codegen.gmfgen.GenAuditContext#getRuleTargets <em>Rule Targets</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference list '<em>Rule Targets</em>'.
+ * @see org.eclipse.gmf.codegen.gmfgen.GenAuditContext#getRuleTargets()
+ * @see #getGenAuditContext()
+ * @generated
+ */
+ EReference getGenAuditContext_RuleTargets();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.gmf.codegen.gmfgen.GenMeasurable <em>Gen Measurable</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenAuditContext.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenAuditContext.java
new file mode 100644
index 000000000..d783c0eca
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenAuditContext.java
@@ -0,0 +1,146 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.codegen.gmfgen;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Gen Audit Context</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc -->
+ *
+ * <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.gmf.codegen.gmfgen.GenAuditContext#getRoot <em>Root</em>}</li>
+ * <li>{@link org.eclipse.gmf.codegen.gmfgen.GenAuditContext#getId <em>Id</em>}</li>
+ * <li>{@link org.eclipse.gmf.codegen.gmfgen.GenAuditContext#getClassName <em>Class Name</em>}</li>
+ * <li>{@link org.eclipse.gmf.codegen.gmfgen.GenAuditContext#getRuleTargets <em>Rule Targets</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenAuditContext()
+ * @model
+ * @generated
+ */
+public interface GenAuditContext extends EObject {
+ /**
+ * Returns the value of the '<em><b>Root</b></em>' container reference.
+ * It is bidirectional and its opposite is '{@link org.eclipse.gmf.codegen.gmfgen.GenAuditRoot#getClientContexts <em>Client Contexts</em>}'.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Root</em>' container reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Root</em>' container reference.
+ * @see #setRoot(GenAuditRoot)
+ * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenAuditContext_Root()
+ * @see org.eclipse.gmf.codegen.gmfgen.GenAuditRoot#getClientContexts
+ * @model opposite="clientContexts" resolveProxies="false" required="true" transient="false"
+ * @generated
+ */
+ GenAuditRoot getRoot();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.gmf.codegen.gmfgen.GenAuditContext#getRoot <em>Root</em>}' container reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Root</em>' container reference.
+ * @see #getRoot()
+ * @generated
+ */
+ void setRoot(GenAuditRoot value);
+
+ /**
+ * Returns the value of the '<em><b>Id</b></em>' attribute.
+ * The default value is <code>"DefaultCtx"</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * Identifier of the validation client context for this target. Should be a valid java identifier. Identifier will be qualified automatically (i.e. should be unique within this editor only).
+ * <!-- end-model-doc -->
+ * @return the value of the '<em>Id</em>' attribute.
+ * @see #setId(String)
+ * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenAuditContext_Id()
+ * @model default="DefaultCtx" required="true"
+ * @generated
+ */
+ String getId();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.gmf.codegen.gmfgen.GenAuditContext#getId <em>Id</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Id</em>' attribute.
+ * @see #getId()
+ * @generated
+ */
+ void setId(String value);
+
+ /**
+ * Returns the value of the '<em><b>Class Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Class Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * Unless explicitly set, equals to 'id'. Note, this class may get generated as inner class.
+ * <!-- end-model-doc -->
+ * @return the value of the '<em>Class Name</em>' attribute.
+ * @see #setClassName(String)
+ * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenAuditContext_ClassName()
+ * @model required="true"
+ * @generated
+ */
+ String getClassName();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.gmf.codegen.gmfgen.GenAuditContext#getClassName <em>Class Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Class Name</em>' attribute.
+ * @see #getClassName()
+ * @generated
+ */
+ void setClassName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Rule Targets</b></em>' reference list.
+ * The list contents are of type {@link org.eclipse.gmf.codegen.gmfgen.GenAuditable}.
+ * It is bidirectional and its opposite is '{@link org.eclipse.gmf.codegen.gmfgen.GenAuditable#getContextSelector <em>Context Selector</em>}'.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Rule Targets</em>' reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Rule Targets</em>' reference list.
+ * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenAuditContext_RuleTargets()
+ * @see org.eclipse.gmf.codegen.gmfgen.GenAuditable#getContextSelector
+ * @model opposite="contextSelector"
+ * @generated
+ */
+ EList<GenAuditable> getRuleTargets();
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @model kind="operation" required="true"
+ * @generated
+ */
+ String getQualifiedClassName();
+
+} // GenAuditContext
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenAuditRoot.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenAuditRoot.java
index 560d9e077..bbbf55e2e 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenAuditRoot.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenAuditRoot.java
@@ -24,6 +24,7 @@ import org.eclipse.emf.ecore.EObject;
* <li>{@link org.eclipse.gmf.codegen.gmfgen.GenAuditRoot#getEditorGen <em>Editor Gen</em>}</li>
* <li>{@link org.eclipse.gmf.codegen.gmfgen.GenAuditRoot#getCategories <em>Categories</em>}</li>
* <li>{@link org.eclipse.gmf.codegen.gmfgen.GenAuditRoot#getRules <em>Rules</em>}</li>
+ * <li>{@link org.eclipse.gmf.codegen.gmfgen.GenAuditRoot#getClientContexts <em>Client Contexts</em>}</li>
* </ul>
* </p>
*
@@ -85,5 +86,23 @@ public interface GenAuditRoot extends EObject {
*/
EList<GenAuditRule> getRules();
+ /**
+ * Returns the value of the '<em><b>Client Contexts</b></em>' containment reference list.
+ * The list contents are of type {@link org.eclipse.gmf.codegen.gmfgen.GenAuditContext}.
+ * It is bidirectional and its opposite is '{@link org.eclipse.gmf.codegen.gmfgen.GenAuditContext#getRoot <em>Root</em>}'.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Client Contexts</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Client Contexts</em>' containment reference list.
+ * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenAuditRoot_ClientContexts()
+ * @see org.eclipse.gmf.codegen.gmfgen.GenAuditContext#getRoot
+ * @model opposite="root" containment="true"
+ * @generated
+ */
+ EList<GenAuditContext> getClientContexts();
+
List<GenPackage> getTargetedModelPackages();
} // GenAuditRoot \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenAuditRule.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenAuditRule.java
index 933b22fca..bb4ac5deb 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenAuditRule.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenAuditRule.java
@@ -21,7 +21,6 @@ package org.eclipse.gmf.codegen.gmfgen;
* The following features are supported:
* <ul>
* <li>{@link org.eclipse.gmf.codegen.gmfgen.GenAuditRule#getRoot <em>Root</em>}</li>
- * <li>{@link org.eclipse.gmf.codegen.gmfgen.GenAuditRule#getContextSelectorLocalClassName <em>Context Selector Local Class Name</em>}</li>
* <li>{@link org.eclipse.gmf.codegen.gmfgen.GenAuditRule#getId <em>Id</em>}</li>
* <li>{@link org.eclipse.gmf.codegen.gmfgen.GenAuditRule#getRule <em>Rule</em>}</li>
* <li>{@link org.eclipse.gmf.codegen.gmfgen.GenAuditRule#getTarget <em>Target</em>}</li>
@@ -274,44 +273,6 @@ public interface GenAuditRule extends GenRuleBase {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @model kind="operation" required="true"
- * @generated
- */
- String getContextSelectorClassName();
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @model kind="operation" required="true"
- * @generated
- */
- String getContextSelectorQualifiedClassName();
-
- /**
- * Returns the value of the '<em><b>Context Selector Local Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the value of the '<em>Context Selector Local Class Name</em>' attribute.
- * @see #setContextSelectorLocalClassName(String)
- * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenAuditRule_ContextSelectorLocalClassName()
- * @model
- * @generated
- */
- String getContextSelectorLocalClassName();
-
- /**
- * Sets the value of the '{@link org.eclipse.gmf.codegen.gmfgen.GenAuditRule#getContextSelectorLocalClassName <em>Context Selector Local Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Context Selector Local Class Name</em>' attribute.
- * @see #getContextSelectorLocalClassName()
- * @generated
- */
- void setContextSelectorLocalClassName(String value);
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
* @model kind="operation"
* @generated
*/
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenAuditable.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenAuditable.java
index 49f6cc593..285ea6c8f 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenAuditable.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenAuditable.java
@@ -18,6 +18,12 @@ import org.eclipse.emf.codegen.ecore.genmodel.GenClass;
* Target suitable for auditing
* <!-- end-model-doc -->
*
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.gmf.codegen.gmfgen.GenAuditable#getContextSelector <em>Context Selector</em>}</li>
+ * </ul>
+ * </p>
*
* @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenAuditable()
* @model abstract="true"
@@ -25,15 +31,31 @@ import org.eclipse.emf.codegen.ecore.genmodel.GenClass;
*/
public interface GenAuditable extends GenRuleTarget {
/**
+ * Returns the value of the '<em><b>Context Selector</b></em>' reference.
+ * It is bidirectional and its opposite is '{@link org.eclipse.gmf.codegen.gmfgen.GenAuditContext#getRuleTargets <em>Rule Targets</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
- * Gets identifier of the validation client context for this target. It's guaranteed as a valid java identifier.
+ * To apply audit to this target, we need to select appropriate input, and here's selector that helps with that
* <!-- end-model-doc -->
- * @model kind="operation" required="true"
+ * @return the value of the '<em>Context Selector</em>' reference.
+ * @see #setContextSelector(GenAuditContext)
+ * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenAuditable_ContextSelector()
+ * @see org.eclipse.gmf.codegen.gmfgen.GenAuditContext#getRuleTargets
+ * @model opposite="ruleTargets"
* @generated
*/
- String getClientContextID();
+ GenAuditContext getContextSelector();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.gmf.codegen.gmfgen.GenAuditable#getContextSelector <em>Context Selector</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Context Selector</em>' reference.
+ * @see #getContextSelector()
+ * @generated
+ */
+ void setContextSelector(GenAuditContext value);
/**
* <!-- begin-user-doc -->
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenFactoryImpl.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenFactoryImpl.java
index 599b8ffee..8fec2416e 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenFactoryImpl.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenFactoryImpl.java
@@ -123,6 +123,7 @@ public class GMFGenFactoryImpl extends EFactoryImpl implements GMFGenFactory {
case GMFGenPackage.GEN_METRIC_CONTAINER: return createGenMetricContainer();
case GMFGenPackage.GEN_METRIC_RULE: return createGenMetricRule();
case GMFGenPackage.GEN_AUDITED_METRIC_TARGET: return createGenAuditedMetricTarget();
+ case GMFGenPackage.GEN_AUDIT_CONTEXT: return createGenAuditContext();
case GMFGenPackage.GEN_EXPRESSION_PROVIDER_CONTAINER: return createGenExpressionProviderContainer();
case GMFGenPackage.GEN_JAVA_EXPRESSION_PROVIDER: return createGenJavaExpressionProvider();
case GMFGenPackage.GEN_EXPRESSION_INTERPRETER: return createGenExpressionInterpreter();
@@ -868,6 +869,16 @@ public class GMFGenFactoryImpl extends EFactoryImpl implements GMFGenFactory {
* <!-- end-user-doc -->
* @generated
*/
+ public GenAuditContext createGenAuditContext() {
+ GenAuditContextImpl genAuditContext = new GenAuditContextImpl();
+ return genAuditContext;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public GenExpressionProviderContainer createGenExpressionProviderContainer() {
GenExpressionProviderContainerImpl genExpressionProviderContainer = new GenExpressionProviderContainerImpl();
return genExpressionProviderContainer;
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenPackageImpl.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenPackageImpl.java
index 44f82537e..59f0a7b72 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenPackageImpl.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenPackageImpl.java
@@ -688,6 +688,13 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
* <!-- end-user-doc -->
* @generated
*/
+ private EClass genAuditContextEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
private EClass genMeasurableEClass = null;
/**
@@ -4417,6 +4424,15 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
* <!-- end-user-doc -->
* @generated
*/
+ public EReference getGenAuditRoot_ClientContexts() {
+ return (EReference)genAuditRootEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EClass getGenAuditContainer() {
return genAuditContainerEClass;
}
@@ -4525,17 +4541,8 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
* <!-- end-user-doc -->
* @generated
*/
- public EAttribute getGenAuditRule_ContextSelectorLocalClassName() {
- return (EAttribute)genAuditRuleEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
public EAttribute getGenAuditRule_Id() {
- return (EAttribute)genAuditRuleEClass.getEStructuralFeatures().get(2);
+ return (EAttribute)genAuditRuleEClass.getEStructuralFeatures().get(1);
}
/**
@@ -4544,7 +4551,7 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
* @generated
*/
public EReference getGenAuditRule_Rule() {
- return (EReference)genAuditRuleEClass.getEStructuralFeatures().get(3);
+ return (EReference)genAuditRuleEClass.getEStructuralFeatures().get(2);
}
/**
@@ -4553,7 +4560,7 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
* @generated
*/
public EReference getGenAuditRule_Target() {
- return (EReference)genAuditRuleEClass.getEStructuralFeatures().get(4);
+ return (EReference)genAuditRuleEClass.getEStructuralFeatures().get(3);
}
/**
@@ -4562,7 +4569,7 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
* @generated
*/
public EAttribute getGenAuditRule_Message() {
- return (EAttribute)genAuditRuleEClass.getEStructuralFeatures().get(5);
+ return (EAttribute)genAuditRuleEClass.getEStructuralFeatures().get(4);
}
/**
@@ -4571,7 +4578,7 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
* @generated
*/
public EAttribute getGenAuditRule_Severity() {
- return (EAttribute)genAuditRuleEClass.getEStructuralFeatures().get(6);
+ return (EAttribute)genAuditRuleEClass.getEStructuralFeatures().get(5);
}
/**
@@ -4580,7 +4587,7 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
* @generated
*/
public EAttribute getGenAuditRule_UseInLiveMode() {
- return (EAttribute)genAuditRuleEClass.getEStructuralFeatures().get(7);
+ return (EAttribute)genAuditRuleEClass.getEStructuralFeatures().get(6);
}
/**
@@ -4589,7 +4596,7 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
* @generated
*/
public EAttribute getGenAuditRule_RequiresConstraintAdapter() {
- return (EAttribute)genAuditRuleEClass.getEStructuralFeatures().get(8);
+ return (EAttribute)genAuditRuleEClass.getEStructuralFeatures().get(7);
}
/**
@@ -4598,7 +4605,7 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
* @generated
*/
public EReference getGenAuditRule_Category() {
- return (EReference)genAuditRuleEClass.getEStructuralFeatures().get(9);
+ return (EReference)genAuditRuleEClass.getEStructuralFeatures().get(8);
}
/**
@@ -4822,6 +4829,60 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
* <!-- end-user-doc -->
* @generated
*/
+ public EReference getGenAuditable_ContextSelector() {
+ return (EReference)genAuditableEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getGenAuditContext() {
+ return genAuditContextEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getGenAuditContext_Root() {
+ return (EReference)genAuditContextEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getGenAuditContext_Id() {
+ return (EAttribute)genAuditContextEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getGenAuditContext_ClassName() {
+ return (EAttribute)genAuditContextEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getGenAuditContext_RuleTargets() {
+ return (EReference)genAuditContextEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EClass getGenMeasurable() {
return genMeasurableEClass;
}
@@ -6416,6 +6477,7 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
createEReference(genAuditRootEClass, GEN_AUDIT_ROOT__EDITOR_GEN);
createEReference(genAuditRootEClass, GEN_AUDIT_ROOT__CATEGORIES);
createEReference(genAuditRootEClass, GEN_AUDIT_ROOT__RULES);
+ createEReference(genAuditRootEClass, GEN_AUDIT_ROOT__CLIENT_CONTEXTS);
genAuditContainerEClass = createEClass(GEN_AUDIT_CONTAINER);
createEReference(genAuditContainerEClass, GEN_AUDIT_CONTAINER__ROOT);
@@ -6431,7 +6493,6 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
genAuditRuleEClass = createEClass(GEN_AUDIT_RULE);
createEReference(genAuditRuleEClass, GEN_AUDIT_RULE__ROOT);
- createEAttribute(genAuditRuleEClass, GEN_AUDIT_RULE__CONTEXT_SELECTOR_LOCAL_CLASS_NAME);
createEAttribute(genAuditRuleEClass, GEN_AUDIT_RULE__ID);
createEReference(genAuditRuleEClass, GEN_AUDIT_RULE__RULE);
createEReference(genAuditRuleEClass, GEN_AUDIT_RULE__TARGET);
@@ -6473,6 +6534,13 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
createEReference(genAuditedMetricTargetEClass, GEN_AUDITED_METRIC_TARGET__METRIC_VALUE_CONTEXT);
genAuditableEClass = createEClass(GEN_AUDITABLE);
+ createEReference(genAuditableEClass, GEN_AUDITABLE__CONTEXT_SELECTOR);
+
+ genAuditContextEClass = createEClass(GEN_AUDIT_CONTEXT);
+ createEReference(genAuditContextEClass, GEN_AUDIT_CONTEXT__ROOT);
+ createEAttribute(genAuditContextEClass, GEN_AUDIT_CONTEXT__ID);
+ createEAttribute(genAuditContextEClass, GEN_AUDIT_CONTEXT__CLASS_NAME);
+ createEReference(genAuditContextEClass, GEN_AUDIT_CONTEXT__RULE_TARGETS);
genMeasurableEClass = createEClass(GEN_MEASURABLE);
@@ -7403,6 +7471,7 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
initEReference(getGenAuditRoot_EditorGen(), this.getGenEditorGenerator(), this.getGenEditorGenerator_Audits(), "editorGen", null, 1, 1, GenAuditRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getGenAuditRoot_Categories(), this.getGenAuditContainer(), this.getGenAuditContainer_Root(), "categories", null, 0, -1, GenAuditRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getGenAuditRoot_Rules(), this.getGenAuditRule(), this.getGenAuditRule_Root(), "rules", null, 0, -1, GenAuditRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getGenAuditRoot_ClientContexts(), this.getGenAuditContext(), this.getGenAuditContext_Root(), "clientContexts", null, 0, -1, GenAuditRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(genAuditContainerEClass, GenAuditContainer.class, "GenAuditContainer", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getGenAuditContainer_Root(), this.getGenAuditRoot(), this.getGenAuditRoot_Categories(), "root", null, 1, 1, GenAuditContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -7418,7 +7487,6 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
initEClass(genAuditRuleEClass, GenAuditRule.class, "GenAuditRule", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getGenAuditRule_Root(), this.getGenAuditRoot(), this.getGenAuditRoot_Rules(), "root", null, 1, 1, GenAuditRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getGenAuditRule_ContextSelectorLocalClassName(), ecorePackage.getEString(), "contextSelectorLocalClassName", null, 0, 1, GenAuditRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getGenAuditRule_Id(), ecorePackage.getEString(), "id", null, 1, 1, GenAuditRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getGenAuditRule_Rule(), this.getGenConstraint(), null, "rule", null, 1, 1, GenAuditRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getGenAuditRule_Target(), this.getGenAuditable(), null, "target", null, 1, 1, GenAuditRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -7428,10 +7496,6 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
initEAttribute(getGenAuditRule_RequiresConstraintAdapter(), ecorePackage.getEBoolean(), "requiresConstraintAdapter", null, 0, 1, GenAuditRule.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
initEReference(getGenAuditRule_Category(), this.getGenAuditContainer(), this.getGenAuditContainer_Audits(), "category", null, 1, 1, GenAuditRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- addEOperation(genAuditRuleEClass, ecorePackage.getEString(), "getContextSelectorClassName", 1, 1, IS_UNIQUE, IS_ORDERED);
-
- addEOperation(genAuditRuleEClass, ecorePackage.getEString(), "getContextSelectorQualifiedClassName", 1, 1, IS_UNIQUE, IS_ORDERED);
-
addEOperation(genAuditRuleEClass, ecorePackage.getEString(), "getConstraintAdapterQualifiedClassName", 0, 1, IS_UNIQUE, IS_ORDERED);
addEOperation(genAuditRuleEClass, ecorePackage.getEString(), "getConstraintAdapterLocalClassName", 1, 1, IS_UNIQUE, IS_ORDERED);
@@ -7470,13 +7534,20 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
initEReference(getGenAuditedMetricTarget_MetricValueContext(), theGenModelPackage.getGenDataType(), null, "metricValueContext", null, 1, 1, GenAuditedMetricTarget.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(genAuditableEClass, GenAuditable.class, "GenAuditable", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- addEOperation(genAuditableEClass, ecorePackage.getEString(), "getClientContextID", 1, 1, IS_UNIQUE, IS_ORDERED);
+ initEReference(getGenAuditable_ContextSelector(), this.getGenAuditContext(), this.getGenAuditContext_RuleTargets(), "contextSelector", null, 0, 1, GenAuditable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
addEOperation(genAuditableEClass, theGenModelPackage.getGenClass(), "getTargetClass", 0, 1, IS_UNIQUE, IS_ORDERED);
addEOperation(genAuditableEClass, ecorePackage.getEString(), "getTargetClassModelQualifiedName", 0, 1, IS_UNIQUE, IS_ORDERED);
+ initEClass(genAuditContextEClass, GenAuditContext.class, "GenAuditContext", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getGenAuditContext_Root(), this.getGenAuditRoot(), this.getGenAuditRoot_ClientContexts(), "root", null, 1, 1, GenAuditContext.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getGenAuditContext_Id(), ecorePackage.getEString(), "id", "DefaultCtx", 1, 1, GenAuditContext.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getGenAuditContext_ClassName(), ecorePackage.getEString(), "className", null, 1, 1, GenAuditContext.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getGenAuditContext_RuleTargets(), this.getGenAuditable(), this.getGenAuditable_ContextSelector(), "ruleTargets", null, 0, -1, GenAuditContext.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ addEOperation(genAuditContextEClass, ecorePackage.getEString(), "getQualifiedClassName", 1, 1, IS_UNIQUE, IS_ORDERED);
+
initEClass(genMeasurableEClass, GenMeasurable.class, "GenMeasurable", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(genExpressionProviderContainerEClass, GenExpressionProviderContainer.class, "GenExpressionProviderContainer", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
@@ -7833,7 +7904,7 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
"constraints", "http://www.eclipse.org/gmf/2005/constraints",
"meta", "http://www.eclipse.org/gmf/2005/constraints/meta",
"deprecated", "http://www.eclipse.org/gmf/2006/deprecated"
- });
+ });
}
/**
@@ -8059,7 +8130,7 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
new String[] {
"ocl", "not key.oclIsUndefined() implies container.metrics->one(i | i.key = self.key)",
"description", "Metric rule with the same \'key\' already exists"
- });
+ });
addAnnotation
(getGenSharedContributionItem_ActualItem(),
source,
@@ -8082,7 +8153,7 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
source,
new String[] {
"documentation", "LinkCreationConstants should be generated if diagram has any links"
- });
+ });
}
/**
@@ -8194,7 +8265,7 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
new String[] {
"def", "type",
"ocl", "\'ecore::EDoubleObject\'"
- });
+ });
}
} //GMFGenPackageImpl \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenAuditContextImpl.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenAuditContextImpl.java
new file mode 100644
index 000000000..8b98a4f58
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenAuditContextImpl.java
@@ -0,0 +1,398 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.gmf.codegen.gmfgen.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+import org.eclipse.gmf.codegen.gmfgen.GMFGenPackage;
+import org.eclipse.gmf.codegen.gmfgen.GenAuditContext;
+import org.eclipse.gmf.codegen.gmfgen.GenAuditRoot;
+import org.eclipse.gmf.codegen.gmfgen.GenAuditable;
+import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Gen Audit Context</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.GenAuditContextImpl#getRoot <em>Root</em>}</li>
+ * <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.GenAuditContextImpl#getId <em>Id</em>}</li>
+ * <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.GenAuditContextImpl#getClassName <em>Class Name</em>}</li>
+ * <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.GenAuditContextImpl#getRuleTargets <em>Rule Targets</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class GenAuditContextImpl extends EObjectImpl implements GenAuditContext {
+ /**
+ * The default value of the '{@link #getId() <em>Id</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getId()
+ * @generated
+ * @ordered
+ */
+ protected static final String ID_EDEFAULT = "DefaultCtx";
+
+ /**
+ * The cached value of the '{@link #getId() <em>Id</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getId()
+ * @generated
+ * @ordered
+ */
+ protected String id = ID_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getClassName() <em>Class Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getClassName()
+ * @generated
+ * @ordered
+ */
+ protected static final String CLASS_NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getClassName() <em>Class Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getClassName()
+ * @generated
+ * @ordered
+ */
+ protected String className = CLASS_NAME_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getRuleTargets() <em>Rule Targets</em>}' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getRuleTargets()
+ * @generated
+ * @ordered
+ */
+ protected EList<GenAuditable> ruleTargets;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected GenAuditContextImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return GMFGenPackage.eINSTANCE.getGenAuditContext();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GenAuditRoot getRoot() {
+ if (eContainerFeatureID != GMFGenPackage.GEN_AUDIT_CONTEXT__ROOT) return null;
+ return (GenAuditRoot)eContainer();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetRoot(GenAuditRoot newRoot, NotificationChain msgs) {
+ msgs = eBasicSetContainer((InternalEObject)newRoot, GMFGenPackage.GEN_AUDIT_CONTEXT__ROOT, msgs);
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setRoot(GenAuditRoot newRoot) {
+ if (newRoot != eInternalContainer() || (eContainerFeatureID != GMFGenPackage.GEN_AUDIT_CONTEXT__ROOT && newRoot != null)) {
+ if (EcoreUtil.isAncestor(this, newRoot))
+ throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
+ NotificationChain msgs = null;
+ if (eInternalContainer() != null)
+ msgs = eBasicRemoveFromContainer(msgs);
+ if (newRoot != null)
+ msgs = ((InternalEObject)newRoot).eInverseAdd(this, GMFGenPackage.GEN_AUDIT_ROOT__CLIENT_CONTEXTS, GenAuditRoot.class, msgs);
+ msgs = basicSetRoot(newRoot, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GMFGenPackage.GEN_AUDIT_CONTEXT__ROOT, newRoot, newRoot));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setId(String newId) {
+ String oldId = id;
+ id = newId;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GMFGenPackage.GEN_AUDIT_CONTEXT__ID, oldId, id));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getClassNameGen() {
+ return className;
+ }
+
+ /**
+ * @generated NOT
+ */
+ public String getClassName() {
+ if (!GenCommonBaseImpl.isEmpty(getClassNameGen())) {
+ return getClassNameGen();
+ }
+ return getId(); //$NON-NLS-1$
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setClassName(String newClassName) {
+ String oldClassName = className;
+ className = newClassName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GMFGenPackage.GEN_AUDIT_CONTEXT__CLASS_NAME, oldClassName, className));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<GenAuditable> getRuleTargets() {
+ if (ruleTargets == null) {
+ ruleTargets = new EObjectWithInverseResolvingEList<GenAuditable>(GenAuditable.class, this, GMFGenPackage.GEN_AUDIT_CONTEXT__RULE_TARGETS, GMFGenPackage.GEN_AUDITABLE__CONTEXT_SELECTOR);
+ }
+ return ruleTargets;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String getQualifiedClassName() {
+ if (getDiagram() == null) {
+ return getClassName();
+ }
+ return getDiagram().getValidationProviderQualifiedClassName() + '$' + getClassName();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case GMFGenPackage.GEN_AUDIT_CONTEXT__ROOT:
+ if (eInternalContainer() != null)
+ msgs = eBasicRemoveFromContainer(msgs);
+ return basicSetRoot((GenAuditRoot)otherEnd, msgs);
+ case GMFGenPackage.GEN_AUDIT_CONTEXT__RULE_TARGETS:
+ return ((InternalEList<InternalEObject>)(InternalEList<?>)getRuleTargets()).basicAdd(otherEnd, msgs);
+ }
+ return super.eInverseAdd(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case GMFGenPackage.GEN_AUDIT_CONTEXT__ROOT:
+ return basicSetRoot(null, msgs);
+ case GMFGenPackage.GEN_AUDIT_CONTEXT__RULE_TARGETS:
+ return ((InternalEList<?>)getRuleTargets()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
+ switch (eContainerFeatureID) {
+ case GMFGenPackage.GEN_AUDIT_CONTEXT__ROOT:
+ return eInternalContainer().eInverseRemove(this, GMFGenPackage.GEN_AUDIT_ROOT__CLIENT_CONTEXTS, GenAuditRoot.class, msgs);
+ }
+ return super.eBasicRemoveFromContainerFeature(msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case GMFGenPackage.GEN_AUDIT_CONTEXT__ROOT:
+ return getRoot();
+ case GMFGenPackage.GEN_AUDIT_CONTEXT__ID:
+ return getId();
+ case GMFGenPackage.GEN_AUDIT_CONTEXT__CLASS_NAME:
+ return getClassName();
+ case GMFGenPackage.GEN_AUDIT_CONTEXT__RULE_TARGETS:
+ return getRuleTargets();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case GMFGenPackage.GEN_AUDIT_CONTEXT__ROOT:
+ setRoot((GenAuditRoot)newValue);
+ return;
+ case GMFGenPackage.GEN_AUDIT_CONTEXT__ID:
+ setId((String)newValue);
+ return;
+ case GMFGenPackage.GEN_AUDIT_CONTEXT__CLASS_NAME:
+ setClassName((String)newValue);
+ return;
+ case GMFGenPackage.GEN_AUDIT_CONTEXT__RULE_TARGETS:
+ getRuleTargets().clear();
+ getRuleTargets().addAll((Collection<? extends GenAuditable>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case GMFGenPackage.GEN_AUDIT_CONTEXT__ROOT:
+ setRoot((GenAuditRoot)null);
+ return;
+ case GMFGenPackage.GEN_AUDIT_CONTEXT__ID:
+ setId(ID_EDEFAULT);
+ return;
+ case GMFGenPackage.GEN_AUDIT_CONTEXT__CLASS_NAME:
+ setClassName(CLASS_NAME_EDEFAULT);
+ return;
+ case GMFGenPackage.GEN_AUDIT_CONTEXT__RULE_TARGETS:
+ getRuleTargets().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case GMFGenPackage.GEN_AUDIT_CONTEXT__ROOT:
+ return getRoot() != null;
+ case GMFGenPackage.GEN_AUDIT_CONTEXT__ID:
+ return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
+ case GMFGenPackage.GEN_AUDIT_CONTEXT__CLASS_NAME:
+ return CLASS_NAME_EDEFAULT == null ? className != null : !CLASS_NAME_EDEFAULT.equals(className);
+ case GMFGenPackage.GEN_AUDIT_CONTEXT__RULE_TARGETS:
+ return ruleTargets != null && !ruleTargets.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (id: ");
+ result.append(id);
+ result.append(", className: ");
+ result.append(className);
+ result.append(')');
+ return result.toString();
+ }
+
+ private GenDiagram getDiagram() {
+ if(getRoot() != null) {
+ return getRoot().getEditorGen().getDiagram();
+ }
+ return null;
+ }
+} //GenAuditContextImpl
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenAuditRootImpl.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenAuditRootImpl.java
index c800cfb16..80215883a 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenAuditRootImpl.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenAuditRootImpl.java
@@ -23,6 +23,7 @@ import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.gmf.codegen.gmfgen.GMFGenPackage;
import org.eclipse.gmf.codegen.gmfgen.GenAuditContainer;
+import org.eclipse.gmf.codegen.gmfgen.GenAuditContext;
import org.eclipse.gmf.codegen.gmfgen.GenAuditRoot;
import org.eclipse.gmf.codegen.gmfgen.GenAuditRule;
import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
@@ -37,6 +38,7 @@ import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
* <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.GenAuditRootImpl#getEditorGen <em>Editor Gen</em>}</li>
* <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.GenAuditRootImpl#getCategories <em>Categories</em>}</li>
* <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.GenAuditRootImpl#getRules <em>Rules</em>}</li>
+ * <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.GenAuditRootImpl#getClientContexts <em>Client Contexts</em>}</li>
* </ul>
* </p>
*
@@ -64,6 +66,16 @@ public class GenAuditRootImpl extends EObjectImpl implements GenAuditRoot {
protected EList<GenAuditRule> rules;
/**
+ * The cached value of the '{@link #getClientContexts() <em>Client Contexts</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getClientContexts()
+ * @generated
+ * @ordered
+ */
+ protected EList<GenAuditContext> clientContexts;
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -152,6 +164,18 @@ public class GenAuditRootImpl extends EObjectImpl implements GenAuditRoot {
* <!-- end-user-doc -->
* @generated
*/
+ public EList<GenAuditContext> getClientContexts() {
+ if (clientContexts == null) {
+ clientContexts = new EObjectContainmentWithInverseEList<GenAuditContext>(GenAuditContext.class, this, GMFGenPackage.GEN_AUDIT_ROOT__CLIENT_CONTEXTS, GMFGenPackage.GEN_AUDIT_CONTEXT__ROOT);
+ }
+ return clientContexts;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
@@ -164,6 +188,8 @@ public class GenAuditRootImpl extends EObjectImpl implements GenAuditRoot {
return ((InternalEList<InternalEObject>)(InternalEList<?>)getCategories()).basicAdd(otherEnd, msgs);
case GMFGenPackage.GEN_AUDIT_ROOT__RULES:
return ((InternalEList<InternalEObject>)(InternalEList<?>)getRules()).basicAdd(otherEnd, msgs);
+ case GMFGenPackage.GEN_AUDIT_ROOT__CLIENT_CONTEXTS:
+ return ((InternalEList<InternalEObject>)(InternalEList<?>)getClientContexts()).basicAdd(otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
@@ -182,6 +208,8 @@ public class GenAuditRootImpl extends EObjectImpl implements GenAuditRoot {
return ((InternalEList<?>)getCategories()).basicRemove(otherEnd, msgs);
case GMFGenPackage.GEN_AUDIT_ROOT__RULES:
return ((InternalEList<?>)getRules()).basicRemove(otherEnd, msgs);
+ case GMFGenPackage.GEN_AUDIT_ROOT__CLIENT_CONTEXTS:
+ return ((InternalEList<?>)getClientContexts()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
@@ -214,6 +242,8 @@ public class GenAuditRootImpl extends EObjectImpl implements GenAuditRoot {
return getCategories();
case GMFGenPackage.GEN_AUDIT_ROOT__RULES:
return getRules();
+ case GMFGenPackage.GEN_AUDIT_ROOT__CLIENT_CONTEXTS:
+ return getClientContexts();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -238,6 +268,10 @@ public class GenAuditRootImpl extends EObjectImpl implements GenAuditRoot {
getRules().clear();
getRules().addAll((Collection<? extends GenAuditRule>)newValue);
return;
+ case GMFGenPackage.GEN_AUDIT_ROOT__CLIENT_CONTEXTS:
+ getClientContexts().clear();
+ getClientContexts().addAll((Collection<? extends GenAuditContext>)newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -259,6 +293,9 @@ public class GenAuditRootImpl extends EObjectImpl implements GenAuditRoot {
case GMFGenPackage.GEN_AUDIT_ROOT__RULES:
getRules().clear();
return;
+ case GMFGenPackage.GEN_AUDIT_ROOT__CLIENT_CONTEXTS:
+ getClientContexts().clear();
+ return;
}
super.eUnset(featureID);
}
@@ -277,6 +314,8 @@ public class GenAuditRootImpl extends EObjectImpl implements GenAuditRoot {
return categories != null && !categories.isEmpty();
case GMFGenPackage.GEN_AUDIT_ROOT__RULES:
return rules != null && !rules.isEmpty();
+ case GMFGenPackage.GEN_AUDIT_ROOT__CLIENT_CONTEXTS:
+ return clientContexts != null && !clientContexts.isEmpty();
}
return super.eIsSet(featureID);
}
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenAuditRuleImpl.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenAuditRuleImpl.java
index 3fa10aa37..f14eced33 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenAuditRuleImpl.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenAuditRuleImpl.java
@@ -30,7 +30,6 @@ import org.eclipse.gmf.codegen.gmfgen.GenSeverity;
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.GenAuditRuleImpl#getRoot <em>Root</em>}</li>
- * <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.GenAuditRuleImpl#getContextSelectorLocalClassName <em>Context Selector Local Class Name</em>}</li>
* <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.GenAuditRuleImpl#getId <em>Id</em>}</li>
* <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.GenAuditRuleImpl#getRule <em>Rule</em>}</li>
* <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.GenAuditRuleImpl#getTarget <em>Target</em>}</li>
@@ -46,26 +45,6 @@ import org.eclipse.gmf.codegen.gmfgen.GenSeverity;
*/
public class GenAuditRuleImpl extends GenRuleBaseImpl implements GenAuditRule {
/**
- * The default value of the '{@link #getContextSelectorLocalClassName() <em>Context Selector Local Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getContextSelectorLocalClassName()
- * @generated
- * @ordered
- */
- protected static final String CONTEXT_SELECTOR_LOCAL_CLASS_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getContextSelectorLocalClassName() <em>Context Selector Local Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getContextSelectorLocalClassName()
- * @generated
- * @ordered
- */
- protected String contextSelectorLocalClassName = CONTEXT_SELECTOR_LOCAL_CLASS_NAME_EDEFAULT;
-
- /**
* The default value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -420,65 +399,6 @@ public class GenAuditRuleImpl extends GenRuleBaseImpl implements GenAuditRule {
* <!-- end-user-doc -->
* @generated NOT
*/
- public String getContextSelectorClassName() {
- if(getTarget() == null || getDiagram() == null) {
- return null;
- }
- return getDiagram().getValidationProviderClassName() + "$" + getContextSelectorLocalClassName(); //$NON-NLS-1$
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public String getContextSelectorQualifiedClassName() {
- if(getTarget() == null || getDiagram() == null) {
- return null;
- }
- return getDiagram().getValidationProviderQualifiedClassName() + "$" + getContextSelectorLocalClassName(); //$NON-NLS-1$
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getContextSelectorLocalClassNameGen() {
- return contextSelectorLocalClassName;
- }
-
- /**
- * @generated NOT
- */
- public String getContextSelectorLocalClassName() {
- if (getContextSelectorLocalClassNameGen() != null) {
- return getContextSelectorLocalClassNameGen();
- }
- String name = "NoCtx"; //$NON-NLS-1$
- if (getTarget() != null) {
- name = getTarget().getClientContextID();
- }
- return name + (getRoot().getRules().indexOf(this) + 1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setContextSelectorLocalClassName(String newContextSelectorLocalClassName) {
- String oldContextSelectorLocalClassName = contextSelectorLocalClassName;
- contextSelectorLocalClassName = newContextSelectorLocalClassName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, GMFGenPackage.GEN_AUDIT_RULE__CONTEXT_SELECTOR_LOCAL_CLASS_NAME, oldContextSelectorLocalClassName, contextSelectorLocalClassName));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
public String getConstraintAdapterClassName() {
if(getDiagram() == null || getConstraintAdapterLocalClassName() == null) {
return null;
@@ -654,8 +574,6 @@ public class GenAuditRuleImpl extends GenRuleBaseImpl implements GenAuditRule {
switch (featureID) {
case GMFGenPackage.GEN_AUDIT_RULE__ROOT:
return getRoot();
- case GMFGenPackage.GEN_AUDIT_RULE__CONTEXT_SELECTOR_LOCAL_CLASS_NAME:
- return getContextSelectorLocalClassName();
case GMFGenPackage.GEN_AUDIT_RULE__ID:
return getId();
case GMFGenPackage.GEN_AUDIT_RULE__RULE:
@@ -688,9 +606,6 @@ public class GenAuditRuleImpl extends GenRuleBaseImpl implements GenAuditRule {
case GMFGenPackage.GEN_AUDIT_RULE__ROOT:
setRoot((GenAuditRoot)newValue);
return;
- case GMFGenPackage.GEN_AUDIT_RULE__CONTEXT_SELECTOR_LOCAL_CLASS_NAME:
- setContextSelectorLocalClassName((String)newValue);
- return;
case GMFGenPackage.GEN_AUDIT_RULE__ID:
setId((String)newValue);
return;
@@ -727,9 +642,6 @@ public class GenAuditRuleImpl extends GenRuleBaseImpl implements GenAuditRule {
case GMFGenPackage.GEN_AUDIT_RULE__ROOT:
setRoot((GenAuditRoot)null);
return;
- case GMFGenPackage.GEN_AUDIT_RULE__CONTEXT_SELECTOR_LOCAL_CLASS_NAME:
- setContextSelectorLocalClassName(CONTEXT_SELECTOR_LOCAL_CLASS_NAME_EDEFAULT);
- return;
case GMFGenPackage.GEN_AUDIT_RULE__ID:
setId(ID_EDEFAULT);
return;
@@ -765,8 +677,6 @@ public class GenAuditRuleImpl extends GenRuleBaseImpl implements GenAuditRule {
switch (featureID) {
case GMFGenPackage.GEN_AUDIT_RULE__ROOT:
return getRoot() != null;
- case GMFGenPackage.GEN_AUDIT_RULE__CONTEXT_SELECTOR_LOCAL_CLASS_NAME:
- return CONTEXT_SELECTOR_LOCAL_CLASS_NAME_EDEFAULT == null ? contextSelectorLocalClassName != null : !CONTEXT_SELECTOR_LOCAL_CLASS_NAME_EDEFAULT.equals(contextSelectorLocalClassName);
case GMFGenPackage.GEN_AUDIT_RULE__ID:
return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
case GMFGenPackage.GEN_AUDIT_RULE__RULE:
@@ -797,9 +707,7 @@ public class GenAuditRuleImpl extends GenRuleBaseImpl implements GenAuditRule {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
- result.append(" (contextSelectorLocalClassName: ");
- result.append(contextSelectorLocalClassName);
- result.append(", id: ");
+ result.append(" (id: ");
result.append(id);
result.append(", message: ");
result.append(message);
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenAuditableImpl.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenAuditableImpl.java
index 8b22134cc..38b7ea9fb 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenAuditableImpl.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenAuditableImpl.java
@@ -10,10 +10,15 @@ import java.util.LinkedList;
import org.eclipse.emf.codegen.ecore.genmodel.GenClass;
import org.eclipse.emf.codegen.ecore.genmodel.GenClassifier;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.codegen.ecore.genmodel.GenPackage;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.eclipse.gmf.codegen.gmfgen.GMFGenPackage;
+import org.eclipse.gmf.codegen.gmfgen.GenAuditContext;
import org.eclipse.gmf.codegen.gmfgen.GenAuditable;
/**
@@ -21,12 +26,26 @@ import org.eclipse.gmf.codegen.gmfgen.GenAuditable;
* An implementation of the model object '<em><b>Gen Auditable</b></em>'.
* <!-- end-user-doc -->
* <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.GenAuditableImpl#getContextSelector <em>Context Selector</em>}</li>
+ * </ul>
* </p>
*
* @generated
*/
public abstract class GenAuditableImpl extends EObjectImpl implements GenAuditable {
/**
+ * The cached value of the '{@link #getContextSelector() <em>Context Selector</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getContextSelector()
+ * @generated
+ * @ordered
+ */
+ protected GenAuditContext contextSelector;
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -48,6 +67,66 @@ public abstract class GenAuditableImpl extends EObjectImpl implements GenAuditab
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * @generated
+ */
+ public GenAuditContext getContextSelector() {
+ if (contextSelector != null && contextSelector.eIsProxy()) {
+ InternalEObject oldContextSelector = (InternalEObject)contextSelector;
+ contextSelector = (GenAuditContext)eResolveProxy(oldContextSelector);
+ if (contextSelector != oldContextSelector) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, GMFGenPackage.GEN_AUDITABLE__CONTEXT_SELECTOR, oldContextSelector, contextSelector));
+ }
+ }
+ return contextSelector;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GenAuditContext basicGetContextSelector() {
+ return contextSelector;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetContextSelector(GenAuditContext newContextSelector, NotificationChain msgs) {
+ GenAuditContext oldContextSelector = contextSelector;
+ contextSelector = newContextSelector;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GMFGenPackage.GEN_AUDITABLE__CONTEXT_SELECTOR, oldContextSelector, newContextSelector);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setContextSelector(GenAuditContext newContextSelector) {
+ if (newContextSelector != contextSelector) {
+ NotificationChain msgs = null;
+ if (contextSelector != null)
+ msgs = ((InternalEObject)contextSelector).eInverseRemove(this, GMFGenPackage.GEN_AUDIT_CONTEXT__RULE_TARGETS, GenAuditContext.class, msgs);
+ if (newContextSelector != null)
+ msgs = ((InternalEObject)newContextSelector).eInverseAdd(this, GMFGenPackage.GEN_AUDIT_CONTEXT__RULE_TARGETS, GenAuditContext.class, msgs);
+ msgs = basicSetContextSelector(newContextSelector, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GMFGenPackage.GEN_AUDITABLE__CONTEXT_SELECTOR, newContextSelector, newContextSelector));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated NOT
*/
public abstract GenClassifier getContext();
@@ -55,6 +134,95 @@ public abstract class GenAuditableImpl extends EObjectImpl implements GenAuditab
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case GMFGenPackage.GEN_AUDITABLE__CONTEXT_SELECTOR:
+ if (contextSelector != null)
+ msgs = ((InternalEObject)contextSelector).eInverseRemove(this, GMFGenPackage.GEN_AUDIT_CONTEXT__RULE_TARGETS, GenAuditContext.class, msgs);
+ return basicSetContextSelector((GenAuditContext)otherEnd, msgs);
+ }
+ return super.eInverseAdd(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case GMFGenPackage.GEN_AUDITABLE__CONTEXT_SELECTOR:
+ return basicSetContextSelector(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 GMFGenPackage.GEN_AUDITABLE__CONTEXT_SELECTOR:
+ if (resolve) return getContextSelector();
+ return basicGetContextSelector();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case GMFGenPackage.GEN_AUDITABLE__CONTEXT_SELECTOR:
+ setContextSelector((GenAuditContext)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case GMFGenPackage.GEN_AUDITABLE__CONTEXT_SELECTOR:
+ setContextSelector((GenAuditContext)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case GMFGenPackage.GEN_AUDITABLE__CONTEXT_SELECTOR:
+ return contextSelector != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated NOT
*/
public GenClass getTargetClass() {
@@ -68,15 +236,6 @@ public abstract class GenAuditableImpl extends EObjectImpl implements GenAuditab
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
- */
- public String getClientContextID() {
- return "DefaultCtx"; //$NON-NLS-1$
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
*/
public String getTargetClassModelQualifiedName() {
if(getTargetClass() == null || getTargetClass().getGenPackage() == null) {
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenDiagramElementTargetImpl.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenDiagramElementTargetImpl.java
index ca6247eb6..5745f8666 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenDiagramElementTargetImpl.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenDiagramElementTargetImpl.java
@@ -86,24 +86,6 @@ public class GenDiagramElementTargetImpl extends GenAuditableImpl implements Gen
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated NOT
- */
- public String getClientContextID() {
- StringBuilder buf = new StringBuilder("Ctx"); //$NON-NLS-1$
- for (GenCommonBase nextElement : getElement()) {
- buf.append('_');
- int id = nextElement.getVisualID();
- if(id < 0) {
- buf.append('n');
- }
- buf.append(id);
- }
- return buf.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
* @generated
*/
@Override
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/util/GMFGenAdapterFactory.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/util/GMFGenAdapterFactory.java
index 447180c99..b5eda1111 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/util/GMFGenAdapterFactory.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/util/GMFGenAdapterFactory.java
@@ -445,6 +445,10 @@ public class GMFGenAdapterFactory extends AdapterFactoryImpl {
return createGenAuditableAdapter();
}
@Override
+ public Adapter caseGenAuditContext(GenAuditContext object) {
+ return createGenAuditContextAdapter();
+ }
+ @Override
public Adapter caseGenMeasurable(GenMeasurable object) {
return createGenMeasurableAdapter();
}
@@ -1843,6 +1847,20 @@ public class GMFGenAdapterFactory extends AdapterFactoryImpl {
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.gmf.codegen.gmfgen.GenAuditContext <em>Gen Audit Context</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.gmf.codegen.gmfgen.GenAuditContext
+ * @generated
+ */
+ public Adapter createGenAuditContextAdapter() {
+ return null;
+ }
+
+ /**
* Creates a new adapter for an object of class '{@link org.eclipse.gmf.codegen.gmfgen.GenMeasurable <em>Gen Measurable</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/util/GMFGenSwitch.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/util/GMFGenSwitch.java
index d7cb5dbb4..1a5f57214 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/util/GMFGenSwitch.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/util/GMFGenSwitch.java
@@ -761,6 +761,12 @@ public class GMFGenSwitch<T> {
if (result == null) result = defaultCase(theEObject);
return result;
}
+ case GMFGenPackage.GEN_AUDIT_CONTEXT: {
+ GenAuditContext genAuditContext = (GenAuditContext)theEObject;
+ T result = caseGenAuditContext(genAuditContext);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
case GMFGenPackage.GEN_MEASURABLE: {
GenMeasurable genMeasurable = (GenMeasurable)theEObject;
T result = caseGenMeasurable(genMeasurable);
@@ -2304,6 +2310,21 @@ public class GMFGenSwitch<T> {
}
/**
+ * Returns the result of interpreting the object as an instance of '<em>Gen Audit Context</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Gen Audit Context</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseGenAuditContext(GenAuditContext object) {
+ return null;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>Gen Measurable</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
diff --git a/plugins/org.eclipse.gmf.codegen/templates-dynmodel/MetaModel.xpt b/plugins/org.eclipse.gmf.codegen/templates-dynmodel/MetaModel.xpt
index 6651e64bb..81fe85c49 100644
--- a/plugins/org.eclipse.gmf.codegen/templates-dynmodel/MetaModel.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates-dynmodel/MetaModel.xpt
@@ -46,6 +46,7 @@ MetaModelFacility.get«getNameToken(genPackage)»().isInstance(«IF isExternalInter
«ENDDEFINE»
«DEFINE getFeatureValue(String containerVar, genmodel::GenClass container, boolean needsCastToResultType) FOR genmodel::GenFeature-»
+// ??? FIXME
«ENDDEFINE»
«DEFINE setFeatureValue(String containerVar, genmodel::GenClass containerClass, String valueVar) FOR genmodel::GenFeature-»
@@ -54,6 +55,9 @@ MetaModelFacility.get«getNameToken(genPackage)»().isInstance(«IF isExternalInter
«containerVar»«ENDIF-»
.eSet(«EXPAND MetaFeature», «valueVar»)«ENDDEFINE»
+«DEFINE setFeatureValue(String containerVar, genmodel::GenClass containerClass, String valueVar, boolean isPlainObjectValue) FOR genmodel::GenFeature-»
+«EXPAND setFeatureValue(containerVar, containerClass, valueVar)»«ENDDEFINE»
+
«DEFINE MetaClass FOR genmodel::GenDataType»MetaModelFacility.get«getNameToken(genPackage)»().getEDataType("«ecoreDataType.name»")«ENDDEFINE»
«DEFINE MetaClass FOR genmodel::GenEnum»MetaModelFacility.get«getNameToken(genPackage)»().getEEnum("«ecoreEnum.name»")«ENDDEFINE»
«DEFINE MetaClass FOR genmodel::GenClass»MetaModelFacility.get«getNameToken(genPackage)»().getEClass("«ecoreClass.name»")«ENDDEFINE»
@@ -78,8 +82,11 @@ org.eclipse.emf.ecore.EObject «assignee» = «value»;«ENDDEFINE»
«DEFINE DeclareAndAssign(String assignee, String value, boolean isPlainObjectValue) FOR GenClass-»
org.eclipse.emf.ecore.EObject «assignee» = «IF isPlainObjectValue»(org.eclipse.emf.ecore.EObject)«ENDIF»«value»;«ENDDEFINE»
-«DEFINE DeclareAndAssign(String assignee, String value, boolean isPlainObjectValue) FOR GenClassifier-»
-«ENDDEFINE»
+«DEFINE DeclareAndAssign(String assignee, String value, boolean isPlainObjectValue) FOR GenClassifier»NO-OP«ENDDEFINE»
+
+«DEFINE DeclareAndAssign(String assignee, String value, boolean isPlainObjectValue) FOR GenDataType-»
+«EXPAND QualifiedClassName» «assignee» = («EXPAND QualifiedClassName») «value»;«ENDDEFINE»
+
«DEFINE DeclareAndAssignContainer(String assignee, String object, GenClass metaClass) FOR GenClass-»
org.eclipse.emf.ecore.EObject «assignee» = «IF isExternalInterface(metaClass)»((org.eclipse.emf.ecore.EObject) «object»)«ELSE»«object»«ENDIF».eContainer();«ENDDEFINE»
diff --git a/plugins/org.eclipse.gmf.codegen/templates/MetaModel.xpt b/plugins/org.eclipse.gmf.codegen/templates/MetaModel.xpt
index e883a32e4..b6bfe38e7 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/MetaModel.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/MetaModel.xpt
@@ -69,15 +69,21 @@ false == «EXPAND IsInstance(accessor)»«ENDDEFINE»
«ENDIF-»
«ENDDEFINE»
-// FIXME support list features as well, i.e. do .add() instead of eSet
«DEFINE setFeatureValue(String containerVar, genmodel::GenClass containerGenClass, String valueVar) FOR genmodel::GenFeature-»
- «IF isExternalInterface(containerGenClass)-»
+«EXPAND setFeatureValue(containerVar, containerGenClass, valueVar, false)»«ENDDEFINE»
+
+// FIXME support list features as well, i.e. do .add() instead of eSet
+«DEFINE setFeatureValue(String containerVar, genmodel::GenClass containerGenClass, String valueVar, boolean isPlainObjectValue) FOR genmodel::GenFeature-»
+«IF isExternalInterface(containerGenClass)-»
((org.eclipse.emf.ecore.EObject) «containerVar»).eSet(«EXPAND MetaFeature», «valueVar»)«-»
- «ELSE-»
-«containerVar».set«getAccessorName(this)»(«valueVar»)«-»
- «ENDIF-»
+«ELSE-»
+«containerVar».set«getAccessorName(this)»(«IF !isPlainObjectValue»«valueVar»«ELSE»«IF isPrimitiveType()»«EXPAND _unwrapObjectToPrimitiveValue(valueVar)»«ELSE»(«EXPAND featureTargetType») «valueVar»«ENDIF»«ENDIF»)«-»
+«ENDIF-»
«ENDDEFINE»
+«DEFINE _unwrapObjectToPrimitiveValue(String valueVar) FOR GenFeature-»
+((«EXPAND featureTargetType») «valueVar»).«ecoreFeature.eType.instanceClassName»Value()«ENDDEFINE»
+
«DEFINE MetaClass FOR genmodel::GenClassifier»«getQualifiedPackageInterfaceName(genPackage)».eINSTANCE.get«getClassifierAccessorName(this)»()«ENDDEFINE»
«DEFINE MetaFeature FOR genmodel::GenFeature»«getQualifiedPackageInterfaceName(genClass.genPackage)».eINSTANCE.get«getFeatureAccessorName(this)»()«ENDDEFINE»
@@ -112,7 +118,7 @@ false == «EXPAND IsInstance(accessor)»«ENDDEFINE»
«getQualifiedInterfaceName()» «assignee» = («getQualifiedInterfaceName()») «value»;«ENDDEFINE»
/*
- * third boolean parameter is to indicate the value is not EObject, si may
+ * third boolean parameter is to indicate the value is not EObject, so may
* need extra cast in case dynamic model instances are in use.
*/
«DEFINE DeclareAndAssign(String assignee, String value, boolean isPlainObjectValue) FOR GenClass-»
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/ConstraintProviders.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/ConstraintProviders.xpt
index 254573aea..edc4ec692 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/ConstraintProviders.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/ConstraintProviders.xpt
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007 Borland Software Corporation
+ * Copyright (c) 2007, 2008 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -18,6 +18,15 @@
«ENDDEFINE»
«DEFINE extensions FOR gmfgen::GenAuditRoot-»
+«EXPAND extensions_emfv_constraintProviders»
+«EXPAND extensions_emfv_constraintBindings»
+«EXPAND extensions_emfv_uiContexts»
+«ENDDEFINE»
+
+//
+// Extension point: org.eclipse.emf.validation.constraintProviders
+//
+«DEFINE extensions_emfv_constraintProviders FOR GenAuditRoot-»
<extension point="org.eclipse.emf.validation.constraintProviders">
«EXPAND xpt::Common::xmlGeneratedTag»
«EXPAND declareCategory FOREACH categories-»
@@ -28,28 +37,38 @@
«EXPAND defineCategory FOREACH categories-»
</constraintProvider>
</extension>
+«ENDDEFINE»
+//
+// Extension point: org.eclipse.emf.validation.constraintBindings
+//
+«DEFINE extensions_emfv_constraintBindings FOR GenAuditRoot-»
<extension point="org.eclipse.emf.validation.constraintBindings">
«EXPAND xpt::Common::xmlGeneratedTag»
- «LET getAllRulesWithTargetAndContextID() AS rules-»
- «FOREACH rules.collect(r | r.target.getClientContextID()).toSet() AS ctxId-»
- <clientContext default="false" id="«editorGen.plugin.iD».«ctxId»">
- <selector class="«rules.select(r | r.target.getClientContextID() == ctxId).getContextSelectorQualifiedClassName().first()»"/>
+«FOREACH clientContexts AS ctx-»
+ <clientContext default="false" id="«getQualifiedIdentity(ctx)»">
+ <selector class="«ctx.getQualifiedClassName()»"/>
</clientContext>
- <binding context="«editorGen.plugin.iD».«ctxId»">
- «FOREACH rules.select(r | r.target.getClientContextID() == ctxId) AS rule-»
+ <binding context="«getQualifiedIdentity(ctx)»">
+ «FOREACH rules.select(r | r.target != null && r.target.contextSelector == ctx) /*alternative: ctx.ruleTargets.contains(r.target)*/ AS rule-»
<constraint ref="«editorGen.plugin.iD».«escapeXML(rule.id)»"/>
«ENDFOREACH-»
</binding>
- «ENDFOREACH-»
- «ENDLET-»
+
+«ENDFOREACH-»
</extension>
+«ENDDEFINE»
+
+//
+// Extension point: org.eclipse.emf.validation.ui.UIRegisteredClientContext
+//
+«DEFINE extensions_emfv_uiContexts FOR GenAuditRoot-»
«IF editorGen.diagram.liveValidationUIFeedback»
<extension point="org.eclipse.emf.validation.ui.UIRegisteredClientContext">
«EXPAND xpt::Common::xmlGeneratedTag»
- «FOREACH getAllRulesWithTargetAndContextID().collect(r | r.target.getClientContextID()).toSet() AS ctxId»
- <clientContext id="«editorGen.plugin.iD».«ctxId»"/>
- «ENDFOREACH-»
+«FOREACH clientContexts AS ctx-»
+ <clientContext id="«getQualifiedIdentity(ctx)»"/>
+«ENDFOREACH-»
</extension>
«ENDIF-»
«ENDDEFINE»
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/GenAuditRoot.ext b/plugins/org.eclipse.gmf.codegen/templates/xpt/GenAuditRoot.ext
index e66e0ee06..6bda54425 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/GenAuditRoot.ext
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/GenAuditRoot.ext
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007 Borland Software Corporation
+ * Copyright (c) 2007, 2008 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -12,17 +12,44 @@
import "http://www.eclipse.org/gmf/2006/GenModel";
import "http://www.eclipse.org/emf/2002/Ecore";
import "http://www.eclipse.org/emf/2002/GenModel";
+
extension xpt::GenEditorGenerator reexport;
List[genmodel::GenPackage] getAllTargetedModelPackages(gmfgen::GenAuditRoot root) :
- root.rules.select(r | r.target != null && r.target.getTargetClass() != null).collect(r | r.target.getTargetClass().genPackage)
+ root.rules.select(r | r.target != null && r.target.getTargetClass() != null).collect(r | r.target.getTargetClass().genPackage).toList().purgeDups()
+;
+
+String getQualifiedIdentity(GenAuditContext ctx) :
+ ctx.root.editorGen.plugin.iD + ctx.id
+;
+
+boolean hasDiagramElementTargetRule(gmfgen::GenAuditRoot audits) :
+ audits != null && audits.rules.target.typeSelect(gmfgen::GenDiagramElementTarget).size() > 0
+;
+
+private boolean hasAnyNotationElementTargetRule(gmfgen::GenAuditRoot audits) :
+ audits != null && audits.rules.target.typeSelect(gmfgen::GenNotationElementTarget).size() > 0
+;
+
+// not sure why NotationElementTarget is here - for GenDiagramElementTarget there's special selector,
+// and nothing special for NotationElementTarget (basically, it's just notation.View)
+// Perhaps, the reason is in ValidateAction use of this method - if there are NotationElementTarget, need
+// to run validation on diagram elements.
+// Present method name reflects my understanding at the moment
+boolean shouldRunValidateOnDiagram(gmfgen::GenAuditRoot audits) :
+ hasDiagramElementTargetRule(audits) || hasAnyNotationElementTargetRule(audits)
+;
+
+
+List[GenCommonBase] getTargetDiagramElements(GenAuditContext ctx) :
+ ctx.ruleTargets.typeSelect(GenDiagramElementTarget).element.purgeDups()
;
-// Partial copy of GenAuditContainerImpl#getAllRulesToTargetContextMap
-cached List[gmfgen::GenAuditRule] getAllRulesWithTargetAndContextID(gmfgen::GenAuditRoot root) :
- root.rules.select(r | r.target != null && r.target.getClientContextID() != null)
+List[GenCommonBase] getAllTargetDiagramElements(GenAuditRoot root) :
+ root.clientContexts.getTargetDiagramElements().purgeDups()
;
+
String escapeXML(String s) :
JAVA org.eclipse.gmf.internal.common.codegen.Conversions.escapeXML(java.lang.String)
; \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/GenModelUtils.ext b/plugins/org.eclipse.gmf.codegen/templates/xpt/GenModelUtils.ext
index 2ae7323c0..eed41e8e8 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/GenModelUtils.ext
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/GenModelUtils.ext
@@ -73,6 +73,11 @@ genmodel::GenClass getTypeGenClassX(genmodel::GenFeature feature) :
JAVA org.eclipse.gmf.internal.codegen.util.GenModelUtils.getTypeGenClass(org.eclipse.emf.codegen.ecore.genmodel.GenFeature)
;
+// GenFeature#getTypeGenClassifier()
+genmodel::GenClassifier getTypeGenClassifier(genmodel::GenFeature feature) :
+ findGenClassifier(feature.genClass.genPackage.genModel, feature.ecoreFeature.eType)
+;
+
// FIXME: for models loaded from generated package (e.g. gmf tests often
// refer to EClass/EOperation directly from EcorePackage) instanceClassName
// is always set and thus all metamodel types are treated as external interfaces,
@@ -89,6 +94,10 @@ boolean isContains(genmodel::GenFeature gf) :
isReferenceType(gf) && ((ecore::EReference) gf.ecoreFeature).containment
;
+boolean isPrimitiveType(genmodel::GenFeature gf) :
+ {"boolean", "byte", "char", "double", "float", "int", "long", "short"}.contains(gf.ecoreFeature.eType.instanceClassName)
+;
+
private boolean isReferenceType(genmodel::GenFeature gf) :
!{gf.ecoreFeature}.typeSelect(ecore::EReference).isEmpty()
;
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/Utils.ext b/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/Utils.ext
index 9262eebbf..cebe12183 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/Utils.ext
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/Utils.ext
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007 Borland Software Corporation
+ * Copyright (c) 2007, 2008 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -66,11 +66,6 @@ Collection[gmfgen::GenCommonBase] getEssentialVisualChildren(gmfgen::GenNode vis
{}.addAll(visualParent.labels).addAll(visualParent.compartments).addAll(visualParent.containedNodes)
;
-boolean hasDiagramElementRule(gmfgen::GenAuditRoot audits) :
- audits.rules.target.typeSelect(gmfgen::GenDiagramElementTarget).size() > 0 ||
- audits.rules.target.typeSelect(gmfgen::GenNotationElementTarget).size() > 0
-;
-
String defaultShortcutCreationWizardClassName(gmfgen::GenDiagram diagram) :
"ShortcutCreationWizard"
;
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/ValidateAction.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/ValidateAction.xpt
index f3232423f..c7413e842 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/ValidateAction.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/ValidateAction.xpt
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007 Borland Software Corporation
+ * Copyright (c) 2007, 2008 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -15,6 +15,7 @@
«IMPORT "http://www.eclipse.org/emf/2002/Ecore"»
«EXTENSION xpt::editor::Utils»
+«EXTENSION xpt::GenAuditRoot»
«DEFINE className FOR gmfgen::GenDiagram»«defaultValidateActionClassName()»«ENDDEFINE»
@@ -96,11 +97,11 @@ public class «EXPAND className» extends org.eclipse.jface.action.Action {
}
«EXPAND xpt::Common::generatedMemberComment»
- public static void runValidation(org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart diagramEditPart,
- org.eclipse.gmf.runtime.notation.View view) {
+ public static void runValidation(org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart diagramEditPart, org.eclipse.gmf.runtime.notation.View view) {
final org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart fpart = diagramEditPart;
final org.eclipse.gmf.runtime.notation.View fview = view;
- «getValidationProviderQualifiedClassName()».runWithConstraints(view, new Runnable() {
+ org.eclipse.emf.transaction.TransactionalEditingDomain txDomain = org.eclipse.emf.transaction.util.TransactionUtil.getEditingDomain(view);
+ «getValidationProviderQualifiedClassName()».runWithConstraints(txDomain, new Runnable() {
public void run() {
validate(fpart, fview);
@@ -146,12 +147,13 @@ public class «EXPAND className» extends org.eclipse.jface.action.Action {
org.eclipse.core.runtime.IStatus status = validator.validate(view.getElement());
createMarkers(target, status, diagramEditPart);
}
- «IF editorGen.audits != null && hasDiagramElementRule(editorGen.audits)-»
- validator.setTraversalStrategy(
- «getValidationProviderQualifiedClassName()».getNotationTraversalStrategy(validator));
+«IF shouldRunValidateOnDiagram(editorGen.audits)-»
+«IF hasDiagramElementTargetRule(editorGen.audits)-»
+ validator.setTraversalStrategy(«getValidationProviderQualifiedClassName()».getNotationTraversalStrategy(validator));
+«ENDIF-»
org.eclipse.core.runtime.IStatus status = validator.validate(view);
createMarkers(target, status, diagramEditPart);
- «ENDIF-»
+«ENDIF-»
«IF editorGen.application != null && validationDecorators-»
«getValidationDecoratorProviderQualifiedClassName()».refreshDecorators(view);
for (java.util.Iterator it = view.eAllContents(); it.hasNext();) {
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/providers/ValidationProvider.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/providers/ValidationProvider.xpt
index c8a7a46e5..4c44d57e0 100755
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/providers/ValidationProvider.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/providers/ValidationProvider.xpt
@@ -8,12 +8,16 @@
*
* Contributors:
* Dmitry Stadnik (Borland) - initial API and implementation
+ * Artem Tikhomirov (Borland) - introduced GenAuditContext entity
*/
«IMPORT "http://www.eclipse.org/gmf/2006/GenModel"»
«IMPORT "http://www.eclipse.org/emf/2002/GenModel"»
+
«EXTENSION xpt::GenModelUtils»
«EXTENSION xpt::EMFUtils»
+«EXTENSION xpt::GenAuditRoot»
+
«DEFINE ValidationProvider FOR gmfgen::GenDiagram-»
«EXPAND xpt::Common::copyright FOR editorGen-»
@@ -23,13 +27,11 @@ package «providersPackageName»;
public class «validationProviderClassName»
extends org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.AbstractContributionItemProvider {
- «EXPAND xpt::Common::generatedMemberComment»
- private static boolean constraintsActive = false;
+ «EXPAND constraintsActive-»
- «EXPAND xpt::Common::generatedMemberComment»
- public static boolean shouldConstraintsBePrivate() {
- return false;
- }
+ «EXPAND shouldConstraintsBePrivate-»
+
+ «EXPAND runWithActiveConstraints-»
«EXPAND xpt::Common::generatedMemberComment»
protected org.eclipse.jface.action.IAction createAction(String actionId,
@@ -40,50 +42,120 @@ public class «validationProviderClassName»
return super.createAction(actionId, partDescriptor);
}
+
+ «EXPAND isInDefaultEditorContext-»
+
+«EXPAND selectors FOR editorGen.audits-»
+
+«EXPAND strategy_support»
+
+«IF editorGen.expressionProviders != null-»
+ «EXPAND constraintAdapters(this) FOR editorGen.audits-»
+«ENDIF-»
+«IF editorGen.audits != null && editorGen.expressionProviders != null-»
+
«EXPAND xpt::Common::generatedMemberComment»
- public static void runWithConstraints(org.eclipse.gmf.runtime.notation.View view, Runnable op) {
- final Runnable fop = op;
- Runnable task = new Runnable() {
-
- public void run() {
- try {
- constraintsActive = true;
- fop.run();
- } finally {
- constraintsActive = false;
- }
- }
- };
- org.eclipse.emf.transaction.TransactionalEditingDomain txDomain =
- org.eclipse.emf.transaction.util.TransactionUtil.getEditingDomain(view);
- if (txDomain != null) {
+static class JavaAudits {
+ «FOREACH editorGen.audits.rules AS rule-»
+ «IF rule.rule != null && rule.target != null && rule.target.getContext() != null-»
+ «EXPAND javaInitializer(rule.rule, rule.target.getContext(), null) FOR editorGen.expressionProviders.getProvider(rule.rule)-»
+ «ENDIF-»
+ «ENDFOREACH-»
+}
+«ENDIF-»
+«EXPAND additions-»
+}
+«ENDDEFINE»
+
+«DEFINE constraintsActive FOR gmfgen::GenDiagram-»
+«EXPAND xpt::Common::generatedMemberComment»
+private static boolean constraintsActive = false;
+«ENDDEFINE»
+
+«DEFINE shouldConstraintsBePrivate FOR gmfgen::GenDiagram-»
+«EXPAND xpt::Common::generatedMemberComment»
+public static boolean shouldConstraintsBePrivate() {
+ return false;
+}
+«ENDDEFINE»
+
+«DEFINE runWithActiveConstraints FOR gmfgen::GenDiagram-»
+«EXPAND xpt::Common::generatedMemberComment»
+public static void runWithConstraints(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain, Runnable operation) {
+ final Runnable op = operation;
+ Runnable task = new Runnable() {
+ public void run() {
try {
- txDomain.runExclusive(task);
- } catch (Exception e) {
- «editorGen.plugin.getActivatorQualifiedClassName()».getInstance().logError(
- "Validation action failed", e); //$NON-NLS-1$
+ constraintsActive = true;
+ op.run();
+ } finally {
+ constraintsActive = false;
}
- } else {
- task.run();
}
+ };
+ if(editingDomain != null) {
+ try {
+ editingDomain.runExclusive(task);
+ } catch (Exception e) {
+ «editorGen.plugin.getActivatorQualifiedClassName()».getInstance().logError("Validation failed", e); «EXPAND xpt::Common::nonNLS»
+ }
+ } else {
+ task.run();
}
+}
+«ENDDEFINE»
+
+
+«DEFINE javaInitializer(gmfgen::ValueExpression valueExpr, genmodel::GenClassifier context, genmodel::GenClassifier oppositeEndContext) FOR GenExpressionProviderBase-»
+«ENDDEFINE»
+«DEFINE javaInitializer(gmfgen::ValueExpression valueExpr, genmodel::GenClassifier context, genmodel::GenClassifier oppositeEndContext) FOR GenJavaExpressionProvider-»
+ «EXPAND xpt::expressions::javaExpressionOperation::javaExpressionOperation(valueExpr, context, oppositeEndContext)-»
+«ENDDEFINE»
+
+«DEFINE additions FOR gmfgen::GenDiagram»«ENDDEFINE»
+
+«DEFINE selectors FOR GenAuditRoot-»
+«FOREACH clientContexts AS ctx»
«EXPAND xpt::Common::generatedMemberComment»
- static boolean isInDefaultEditorContext(Object object) {
- if (shouldConstraintsBePrivate() && !constraintsActive) {
+ public static class «ctx.className» implements org.eclipse.emf.validation.model.IClientSelector {
+
+ «EXPAND xpt::Common::generatedMemberComment»
+ public boolean selects(Object object) {
+«IF ctx.ruleTargets.typeSelect(GenDiagramElementTarget).size() > 0 -»
+ if (isInDefaultEditorContext(object) && object instanceof org.eclipse.gmf.runtime.notation.View) {
+ final int id = «EXPAND xpt::editor::VisualIDRegistry::getVisualIDMethodCall FOR editorGen.diagram»((org.eclipse.gmf.runtime.notation.View) object);
+ boolean result = false;
+«FOREACH getTargetDiagramElements(ctx) AS e-»
+ result = result || id == «EXPAND xpt::editor::VisualIDRegistry::visualID FOR e»;
+«ENDFOREACH-»
+ return result;
+ }
return false;
+«ELSE-»
+ return isInDefaultEditorContext(object);
+«ENDIF-»
}
- if (object instanceof org.eclipse.gmf.runtime.notation.View) {
- return constraintsActive && «getEditPartQualifiedClassName()».MODEL_ID.equals(
- «getVisualIDRegistryQualifiedClassName()».getModelID((org.eclipse.gmf.runtime.notation.View) object));
- }
- return true;
}
+«ENDFOREACH-»
+«ENDDEFINE»
+
+«DEFINE isInDefaultEditorContext FOR gmfgen::GenDiagram-»
+«EXPAND xpt::Common::generatedMemberComment»
+static boolean isInDefaultEditorContext(Object object) {
+ if(shouldConstraintsBePrivate() && !constraintsActive) {
+ return false;
+ }
+ if (object instanceof org.eclipse.gmf.runtime.notation.View) {
+ return constraintsActive && «EXPAND xpt::editor::VisualIDRegistry::modelID».equals(«EXPAND xpt::editor::VisualIDRegistry::getModelIDMethodCall»((org.eclipse.gmf.runtime.notation.View) object));
+ }
+ return true;
+}
+«ENDDEFINE»
- «EXPAND xpt::Common::generatedMemberComment»
- static final java.util.Map semanticCtxIdMap = new java.util.HashMap();
- «EXPAND selectors FOR editorGen.audits-»
+«DEFINE strategy_support FOR GenDiagram-»
+«IF hasDiagramElementTargetRule(editorGen.audits)-»
«EXPAND xpt::Common::generatedMemberComment»
public static org.eclipse.emf.validation.service.ITraversalStrategy getNotationTraversalStrategy(
org.eclipse.emf.validation.service.IBatchValidator validator) {
@@ -97,7 +169,7 @@ public class «validationProviderClassName»
private org.eclipse.emf.validation.service.ITraversalStrategy defaultStrategy;
«EXPAND xpt::Common::generatedMemberComment»
- private String currentSemanticCtxId;
+ private int currentSemanticCtxId = -1;
«EXPAND xpt::Common::generatedMemberComment»
private boolean ctxChanged = true;
@@ -109,8 +181,15 @@ public class «validationProviderClassName»
private org.eclipse.emf.ecore.EObject preFetchedNextTarget;
«EXPAND xpt::Common::generatedMemberComment»
+ private final int[] contextSwitchingIdentifiers;
+
+ «EXPAND xpt::Common::generatedMemberComment»
CtxSwitchStrategy(org.eclipse.emf.validation.service.IBatchValidator validator) {
this.defaultStrategy = validator.getDefaultTraversalStrategy();
+ this.contextSwitchingIdentifiers = new int[] {
+ «EXPAND xpt::editor::VisualIDRegistry::visualID FOREACH getAllTargetDiagramElements(editorGen.audits) SEPARATOR ","»
+ };
+ java.util.Arrays.sort(this.contextSwitchingIdentifiers);
}
«EXPAND xpt::Common::generatedMemberComment»
@@ -144,8 +223,7 @@ public class «validationProviderClassName»
}
«EXPAND xpt::Common::generatedMemberComment»
- public void startTraversal(java.util.Collection traversalRoots,
- org.eclipse.core.runtime.IProgressMonitor monitor) {
+ public void startTraversal(java.util.Collection traversalRoots, org.eclipse.core.runtime.IProgressMonitor monitor) {
defaultStrategy.startTraversal(traversalRoots, monitor);
}
@@ -153,92 +231,26 @@ public class «validationProviderClassName»
private void prepareNextClientContext(org.eclipse.emf.ecore.EObject nextTarget) {
if (nextTarget != null && currentTarget != null) {
if (nextTarget instanceof org.eclipse.gmf.runtime.notation.View) {
- String id = ((org.eclipse.gmf.runtime.notation.View) nextTarget).getType();
- String nextSemanticId = id != null && semanticCtxIdMap.containsKey(id) ? id : null;
- if ((currentSemanticCtxId != null && !currentSemanticCtxId.equals(nextSemanticId))
- || (nextSemanticId != null && !nextSemanticId.equals(currentSemanticCtxId))) {
+ final int id = «EXPAND xpt::editor::VisualIDRegistry::getVisualIDMethodCall FOR editorGen.diagram»((org.eclipse.gmf.runtime.notation.View) nextTarget);
+ int nextSemanticId = (id != -1 && java.util.Arrays.binarySearch(contextSwitchingIdentifiers, id) >= 0) ? id : -1;
+ if ((currentSemanticCtxId != -1 && currentSemanticCtxId != nextSemanticId)
+ || (nextSemanticId != -1 && nextSemanticId != currentSemanticCtxId)) {
this.ctxChanged = true;
- }
+ }«/*[artem] not sure why not ctxChanged = <expr>, is it intentional not to reset ctxChanged if condition did not match? I doubt. FIXME?*/»
currentSemanticCtxId = nextSemanticId;
} else {
// context of domain model
- this.ctxChanged = currentSemanticCtxId != null;
- currentSemanticCtxId = null;
+ this.ctxChanged = currentSemanticCtxId != -1;
+ currentSemanticCtxId = -1;
}
} else {
this.ctxChanged = false;
}
}
}
- «IF editorGen.expressionProviders != null-»
- «EXPAND constraintAdapters(this) FOR editorGen.audits-»
- «ENDIF-»
- «IF editorGen.audits != null && editorGen.expressionProviders != null-»
-
- «EXPAND xpt::Common::generatedMemberComment»
-static class JavaAudits {
- «FOREACH editorGen.audits.rules AS rule-»
- «IF rule.rule != null && rule.target != null && rule.target.getContext() != null-»
- «EXPAND javaInitializer(rule.rule, rule.target.getContext(), null) FOR editorGen.expressionProviders.getProvider(rule.rule)-»
- «ENDIF-»
- «ENDFOREACH-»
-}
- «ENDIF-»
- «EXPAND additions-»
-}
-«ENDDEFINE»
-
-«DEFINE javaInitializer(gmfgen::ValueExpression valueExpr, genmodel::GenClassifier context, genmodel::GenClassifier oppositeEndContext) FOR GenExpressionProviderBase-»
+«ENDIF-»
«ENDDEFINE»
-«DEFINE javaInitializer(gmfgen::ValueExpression valueExpr, genmodel::GenClassifier context, genmodel::GenClassifier oppositeEndContext) FOR GenJavaExpressionProvider-»
- «EXPAND xpt::expressions::javaExpressionOperation::javaExpressionOperation(valueExpr, context, oppositeEndContext)-»
-«ENDDEFINE»
-
-«DEFINE additions FOR gmfgen::GenDiagram»«ENDDEFINE»
-
-«DEFINE selectors FOR GenAuditRoot-»
- «FOREACH rules AS rule-»
- «IF null != rule.target && null != rule.target.getClientContextID()-»
- «EXPAND selector FOR rule-»
- «ENDIF-»
- «ENDFOREACH-»
-«ENDDEFINE»
-
-«DEFINE selector FOR GenAuditRule-»
-
- «EXPAND xpt::Common::generatedMemberComment»
- public static class «contextSelectorLocalClassName» implements org.eclipse.emf.validation.model.IClientSelector {
-
- «EXPAND xpt::Common::generatedMemberComment»
- public boolean selects(Object object) {
- «IF { target }.typeSelect(GenDiagramElementTarget).size() > 0 -»
- if (isInDefaultEditorContext(object) && object instanceof org.eclipse.gmf.runtime.notation.View) {
- String id = ((org.eclipse.gmf.runtime.notation.View) object).getType();
- return id != null && semanticCtxIdMap.get(id) == «contextSelectorLocalClassName».class;
- }
- return false;
- «ELSE-»
- return isInDefaultEditorContext(object);
- «ENDIF-»
- }
- }
- «EXPAND contexts(this) FOR target-»
-«ENDDEFINE»
-
-«DEFINE contexts(GenAuditRule rule) FOR GenAuditable-»
-«ENDDEFINE»
-
-«DEFINE contexts(GenAuditRule rule) FOR GenDiagramElementTarget-»
-
- «EXPAND xpt::Common::generatedMemberComment»
- static {
- «FOREACH element AS element-»
- semanticCtxIdMap.put(String.valueOf(«element.getEditPartQualifiedClassName()».VISUAL_ID),
- «rule.contextSelectorLocalClassName».class); //$NON-NLS-1$
- «ENDFOREACH-»
- }
-«ENDDEFINE»
«DEFINE constraintAdapters(GenDiagram diagram) FOR GenAuditRoot-»
«FOREACH rules AS rule-»

Back to the top