Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormgolubev2012-04-30 00:36:19 +0000
committermgolubev2012-04-30 00:36:19 +0000
commitbae549722e7eadd167c9d6c9cca4f75d7640a672 (patch)
tree3c36700c237f0fa18c9874d48ba2b01772bca642
parenta36081efd3a63690373c95908afc856eb834f7ac (diff)
downloadorg.eclipse.gmf-tooling-bae549722e7eadd167c9d6c9cca4f75d7640a672.tar.gz
org.eclipse.gmf-tooling-bae549722e7eadd167c9d6c9cca4f75d7640a672.tar.xz
org.eclipse.gmf-tooling-bae549722e7eadd167c9d6c9cca4f75d7640a672.zip
[158116][368398] - post-merge refactoring to have the '--IA' hints for
IA factory type in one place instead of many +obsolete unused qvto around this IA-check removed
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/impl/parsers/ParserProvider.xpt4
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/impl/parsers/expression.qvto22
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/Utils.qvto4
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/VisualEffectEditPolicy.xpt4
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/expressions/OclTracker.qvto11
5 files changed, 15 insertions, 30 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates/impl/parsers/ParserProvider.xpt b/plugins/org.eclipse.gmf.codegen/templates/impl/parsers/ParserProvider.xpt
index 484b3cbfe..21c9e8d4b 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/impl/parsers/ParserProvider.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/impl/parsers/ParserProvider.xpt
@@ -14,10 +14,10 @@
*/
«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/emf/2002/Ecore'»
«IMPORT 'http://www.eclipse.org/emf/2002/GenModel'»
«EXTENSION xpt::providers::ParserUtils»
«EXTENSION impl::parsers::expression»
+«EXTENSION xpt::expressions::OclTracker»
«DEFINE accessorMethod_delegate2providers FOR gmfgen::GenParsers-»
«EXPAND xpt::Common::generatedMemberComment('Utility method that consults ParserService')»
@@ -277,7 +277,7 @@ org.eclipse.gmf.runtime.common.ui.services.parser.ParserService.getInstance().ge
«ENDDEFINE»
«DEFINE _optionalOclTrackerFactoryTypeHint FOR gmfgen::ValueExpression-»
-«IF body.startsWith('--IA')», org.eclipse.gmf.tooling.runtime.ocl.tracker.OclTrackerFactory.Type.IMPACT_ANALYZER«ENDIF-»
+«IF isForcedImpactAnalyzerKind(body)», org.eclipse.gmf.tooling.runtime.ocl.tracker.OclTrackerFactory.Type.IMPACT_ANALYZER«ENDIF-»
«ENDDEFINE»
«DEFINE _setPatterns(viewMethod : gmfgen::LabelTextAccessMethod, editMethod : gmfgen::LabelTextAccessMethod, parserVar : String) FOR gmfgen::FeatureLabelModelFacet-»
diff --git a/plugins/org.eclipse.gmf.codegen/templates/impl/parsers/expression.qvto b/plugins/org.eclipse.gmf.codegen/templates/impl/parsers/expression.qvto
index 7217c89e4..26a46c3a6 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/impl/parsers/expression.qvto
+++ b/plugins/org.eclipse.gmf.codegen/templates/impl/parsers/expression.qvto
@@ -10,14 +10,6 @@ helper gmfgen::GenParserImplementation::isViewExpressionDefinedAndOcl() : Boolea
return false;
}
-helper gmfgen::ExpressionLabelParser::isImpactAnalyzerKind() : Boolean {
- return isImpactAnalyzerKind(self.viewExpression.body);
-}
-
-helper gmfgen::GenParserImplementation::isImpactAnalyzerKind() : Boolean {
- return false
-}
-
helper gmfgen::GenCommonBase::isViewExpressionDefiedAndOcl() : Boolean {
return let labelModelFacet : gmfgen::LabelModelFacet
= if self.oclIsKindOf(gmfgen::GenChildLabelNode) then self.oclAsType(gmfgen::GenChildLabelNode).labelModelFacet
@@ -31,17 +23,3 @@ helper gmfgen::GenCommonBase::isViewExpressionDefiedAndOcl() : Boolean {
endif;
}
-helper gmfgen::GenCommonBase::isViewExpressionDefiedAndOclAndImpactAnalyzerKind() : Boolean {
- return let labelModelFacet : gmfgen::LabelModelFacet
- = if self.oclIsKindOf(gmfgen::GenChildLabelNode) then self.oclAsType(gmfgen::GenChildLabelNode).labelModelFacet
- else (if self.oclIsKindOf(gmfgen::GenLabel) then self.oclAsType(gmfgen::GenLabel).modelFacet
- else null
- endif)
- endif
- in if labelModelFacet = null
- then false
- else (labelModelFacet.parser.isViewExpressionDefinedAndOcl()
- and labelModelFacet.parser.isImpactAnalyzerKind()
- )
- endif;
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/Utils.qvto b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/Utils.qvto
index 3be39253a..bb266d1d2 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/Utils.qvto
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/Utils.qvto
@@ -62,7 +62,3 @@ helper gmfgen::GenCommonBase::hasFillStyleInCustom() : Boolean {
helper gmfgen::GenDiagram::isPixelMapMode() : Boolean {
return self.units = 'Pixel';
}
-
-helper isImpactAnalyzerKind(oclExpression : String) : Boolean {
- return oclExpression.startsWith('--IA');
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/VisualEffectEditPolicy.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/VisualEffectEditPolicy.xpt
index a50919176..40bc8a23d 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/VisualEffectEditPolicy.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/VisualEffectEditPolicy.xpt
@@ -2,7 +2,7 @@
«IMPORT 'http://www.eclipse.org/emf/2002/GenModel'»
«IMPORT 'http://www.eclipse.org/emf/2002/Ecore'»
-«EXTENSION xpt::diagram::Utils»
+«EXTENSION xpt::expressions::OclTracker»
«EXTENSION xpt::GenModelUtils»
«DEFINE VisualEffectEditPolicy FOR gmfgen::GenVisualEffect-»
@@ -32,7 +32,7 @@ public class «EXPAND xpt::Common::disqualifiedClassName FOR getEditPolicyQualif
«DEFINE _constructor FOR gmfgen::GenVisualEffect-»
«EXPAND xpt::Common::generatedMemberComment»
public «EXPAND xpt::Common::disqualifiedClassName FOR getEditPolicyQualifiedClassName()»() {
- «IF isImpactAnalyzerKind(oclExpression)-»
+ «IF isForcedImpactAnalyzerKind(oclExpression)-»
super(org.eclipse.gmf.tooling.runtime.ocl.tracker.OclTrackerFactory.Type.IMPACT_ANALYZER);
«ELSE-»
super();
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/expressions/OclTracker.qvto b/plugins/org.eclipse.gmf.codegen/templates/xpt/expressions/OclTracker.qvto
new file mode 100644
index 000000000..bd6ad2fad
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/expressions/OclTracker.qvto
@@ -0,0 +1,11 @@
+modeltype gmfgen uses "http://www.eclipse.org/gmf/2009/GenModel";
+
+library OclTracker;
+
+helper isForcedImpactAnalyzerKind(oclExpression : String) : Boolean {
+ return null != oclExpression and oclExpression.startsWith('--IA');
+}
+
+
+
+

Back to the top