Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormgolubev2014-01-15 07:03:54 -0500
committermgolubev2014-01-15 07:03:54 -0500
commit7b875c3f20f466b993a00218bfe96fea8317a42a (patch)
treef29fea80226112319f19eccaa4ca746bc0c69965 /plugins/org.eclipse.gmf.codegen/templates
parent1a89e50446cfaac74455cad3f3a8c4a5420589f4 (diff)
downloadorg.eclipse.gmf-tooling-7b875c3f20f466b993a00218bfe96fea8317a42a.tar.gz
org.eclipse.gmf-tooling-7b875c3f20f466b993a00218bfe96fea8317a42a.tar.xz
org.eclipse.gmf-tooling-7b875c3f20f466b993a00218bfe96fea8317a42a.zip
[418566] Normalized line-breaks, no structural changes in any file
Diffstat (limited to 'plugins/org.eclipse.gmf.codegen/templates')
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/MetaModel.qvto8
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/ChoiceUtils.qvto86
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/RuntimeLabelsSupport.qvto122
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/impl/parsers/expression.qvto50
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/VisualEffectEditPolicy.xpt444
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/editor/diagram.gifbin339 -> 717 bytes
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/editor/wizban.gifbin2466 -> 4876 bytes
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/navigator/navigatorGroup.gifbin709 -> 1107 bytes
8 files changed, 355 insertions, 355 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates/MetaModel.qvto b/plugins/org.eclipse.gmf.codegen/templates/MetaModel.qvto
index 2a522884f..6d56f4600 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/MetaModel.qvto
+++ b/plugins/org.eclipse.gmf.codegen/templates/MetaModel.qvto
@@ -12,7 +12,7 @@
import xpt.StringOperations;
import xpt.GenModelUtils;
import gmf.CodeGenerationUtils;
-import gmf.GenPackageUtils;
+import gmf.GenPackageUtils;
modeltype genmodel uses "http://www.eclipse.org/emf/2002/GenModel";
modeltype ecore uses "http://www.eclipse.org/emf/2002/Ecore";
@@ -31,14 +31,14 @@ library MetaModel;
-- GenPackageImpl#getQualifiedPackageInterfaceName()
--
helper getQualifiedPackageInterfaceName(gp : genmodel::GenPackage) : String {
- return getGenPackageQualifiedPackageInterfaceName(gp)
+ return getGenPackageQualifiedPackageInterfaceName(gp)
}
--
-- GenPackageImpl#getQualifiedFactoryInterfaceName()
--
helper getQualifiedFactoryInterfaceName(gp : genmodel::GenPackage) : String {
- return getGenPackageQualifiedFactoryInterfaceName(gp)
+ return getGenPackageQualifiedFactoryInterfaceName(gp)
}
--
@@ -67,7 +67,7 @@ helper getItemProviderAdapterFactoryClassName(gp : genmodel::GenPackage) : Strin
-- GenClass#getQualifiedInterfaceName
--
helper getQualifiedInterfaceName(gc : genmodel::GenClass) : String {
- return getGenPackageQualifiedInterfaceName(gc)
+ return getGenPackageQualifiedInterfaceName(gc)
}
--
diff --git a/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/ChoiceUtils.qvto b/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/ChoiceUtils.qvto
index ffa2f0ba8..856b69046 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/ChoiceUtils.qvto
+++ b/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/ChoiceUtils.qvto
@@ -1,44 +1,44 @@
-modeltype gmfgen uses "http://www.eclipse.org/gmf/2009/GenModel";
-modeltype ecore uses "http://www.eclipse.org/emf/2002/Ecore";
-
-library Utils;
-
-
-helper gmfgen::GenCommonBase::isOclChoiceLabel() : 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 (labelModelFacet <> null)
- and labelModelFacet.parser.oclIsKindOf(gmfgen::OclChoiceParser);
-}
-
-helper gmfgen::GenCommonBase::isOclChoiceLabelWithShowExpr() : 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 (labelModelFacet <> null)
- and labelModelFacet.parser.oclIsKindOf(gmfgen::OclChoiceParser)
- and (labelModelFacet.parser.oclAsType(gmfgen::OclChoiceParser).showExpression <> null);
-}
-
-helper isChoiceLabel(modelFacet : gmfgen::LabelModelFacet) : Boolean {
- return modelFacet.parser.oclIsKindOf(gmfgen::PredefinedEnumParser)
- or modelFacet.parser.oclIsKindOf(gmfgen::OclChoiceParser);
-}
-
-helper getDirectManagerFQN(modelFacet : gmfgen::LabelModelFacet) : String {
- return
- (if isChoiceLabel(modelFacet) then
- -- 'org.eclipse.gmf.runtime.diagram.ui.tools.ComboDirectEditManager'
- 'org.eclipse.gmf.tooling.runtime.directedit.ComboDirectEditManager'
- else
- -- 'org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager'
- 'org.eclipse.gmf.tooling.runtime.directedit.TextDirectEditManager2'
- endif);
+modeltype gmfgen uses "http://www.eclipse.org/gmf/2009/GenModel";
+modeltype ecore uses "http://www.eclipse.org/emf/2002/Ecore";
+
+library Utils;
+
+
+helper gmfgen::GenCommonBase::isOclChoiceLabel() : 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 (labelModelFacet <> null)
+ and labelModelFacet.parser.oclIsKindOf(gmfgen::OclChoiceParser);
+}
+
+helper gmfgen::GenCommonBase::isOclChoiceLabelWithShowExpr() : 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 (labelModelFacet <> null)
+ and labelModelFacet.parser.oclIsKindOf(gmfgen::OclChoiceParser)
+ and (labelModelFacet.parser.oclAsType(gmfgen::OclChoiceParser).showExpression <> null);
+}
+
+helper isChoiceLabel(modelFacet : gmfgen::LabelModelFacet) : Boolean {
+ return modelFacet.parser.oclIsKindOf(gmfgen::PredefinedEnumParser)
+ or modelFacet.parser.oclIsKindOf(gmfgen::OclChoiceParser);
+}
+
+helper getDirectManagerFQN(modelFacet : gmfgen::LabelModelFacet) : String {
+ return
+ (if isChoiceLabel(modelFacet) then
+ -- 'org.eclipse.gmf.runtime.diagram.ui.tools.ComboDirectEditManager'
+ 'org.eclipse.gmf.tooling.runtime.directedit.ComboDirectEditManager'
+ else
+ -- 'org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager'
+ 'org.eclipse.gmf.tooling.runtime.directedit.TextDirectEditManager2'
+ endif);
} \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/RuntimeLabelsSupport.qvto b/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/RuntimeLabelsSupport.qvto
index d4b388891..2c8c050f5 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/RuntimeLabelsSupport.qvto
+++ b/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/RuntimeLabelsSupport.qvto
@@ -1,61 +1,61 @@
-import xpt.OclMigrationProblems;
-
-modeltype gmfgen uses "http://www.eclipse.org/gmf/2009/GenModel";
-modeltype gmfgraph uses "http://www.eclipse.org/gmf/2006/GraphicalDefinition";
-
-library RuntimeLabelsSupport;
-
-
-helper isVerticalLabel(commonBase : gmfgen::GenCommonBase) : Boolean {
- return
- not commonBase.viewmap.oclIsUndefined() and (
- (commonBase.viewmap.oclIsKindOf(gmfgen::ParentAssignedViewmap) and isVerticalLabelParentAssignedViewmap(commonBase.viewmap.oclAsType(gmfgen::ParentAssignedViewmap)))
- or
- (commonBase.viewmap.oclIsKindOf(gmfgen::ModeledViewmap) and isVerticalLabelModeledViewmap(commonBase.viewmap.oclAsType(gmfgen::ModeledViewmap)))
- )
-}
-
-helper isVerticalLabelParentAssignedViewmap(vm : gmfgen::ParentAssignedViewmap) : Boolean {
- return undefinedAsFalse(vm.figureQualifiedClassName = getVerticalLabelFQN())
-}
-
-helper isVerticalLabelModeledViewmap(vm : gmfgen::ModeledViewmap) : Boolean {
- return
- not vm.figureModel.oclIsUndefined()
- and vm.figureModel.oclIsKindOf(gmfgraph::DiagramLabel)
- and isVerticalDiagramLabel(vm.figureModel.oclAsType(gmfgraph::DiagramLabel))
-}
-
-helper isVerticalDiagramLabel(dl : gmfgraph::DiagramLabel) : Boolean {
- return
- not dl.accessor.figure.oclIsUndefined() and dl.accessor.figure.oclIsKindOf(gmfgraph::VerticalLabel)
-}
-
-
-helper getSimpleLabelDelegateFQN() : String {
- return getRuntimeLabelPackage().concat(".").concat("SimpleLabelDelegate");
-}
-
-helper getVerticalLabelFQN() : String {
- return getRuntimeLabelPackage().concat(".").concat("VerticalLabel");
-}
-
-helper getVerticalLabelDelegateFQN() : String {
- return getRuntimeLabelPackage().concat(".").concat("VerticalLabelDelegate");
-}
-
-helper getVerticalLabelCellEditorLocatorFQN() : String {
- return getRuntimeLabelPackage().concat(".").concat("VerticalLabelCellEditorLocator");
-}
-
-helper getRuntimeLabelPackage() : String {
- return "org.eclipse.gmf.tooling.runtime.draw2d.labels";
-}
-
-helper supportsVerticalLabels(diagram : gmfgen::GenDiagram) : Boolean {
- return diagram.getAllNodes()->exists(n | hasVerticalLabels(n))
-}
-
-helper hasVerticalLabels(node : gmfgen::GenNode) : Boolean {
- return isVerticalLabel(node) or node.labels->exists(label | isVerticalLabel(label))
-}
+import xpt.OclMigrationProblems;
+
+modeltype gmfgen uses "http://www.eclipse.org/gmf/2009/GenModel";
+modeltype gmfgraph uses "http://www.eclipse.org/gmf/2006/GraphicalDefinition";
+
+library RuntimeLabelsSupport;
+
+
+helper isVerticalLabel(commonBase : gmfgen::GenCommonBase) : Boolean {
+ return
+ not commonBase.viewmap.oclIsUndefined() and (
+ (commonBase.viewmap.oclIsKindOf(gmfgen::ParentAssignedViewmap) and isVerticalLabelParentAssignedViewmap(commonBase.viewmap.oclAsType(gmfgen::ParentAssignedViewmap)))
+ or
+ (commonBase.viewmap.oclIsKindOf(gmfgen::ModeledViewmap) and isVerticalLabelModeledViewmap(commonBase.viewmap.oclAsType(gmfgen::ModeledViewmap)))
+ )
+}
+
+helper isVerticalLabelParentAssignedViewmap(vm : gmfgen::ParentAssignedViewmap) : Boolean {
+ return undefinedAsFalse(vm.figureQualifiedClassName = getVerticalLabelFQN())
+}
+
+helper isVerticalLabelModeledViewmap(vm : gmfgen::ModeledViewmap) : Boolean {
+ return
+ not vm.figureModel.oclIsUndefined()
+ and vm.figureModel.oclIsKindOf(gmfgraph::DiagramLabel)
+ and isVerticalDiagramLabel(vm.figureModel.oclAsType(gmfgraph::DiagramLabel))
+}
+
+helper isVerticalDiagramLabel(dl : gmfgraph::DiagramLabel) : Boolean {
+ return
+ not dl.accessor.figure.oclIsUndefined() and dl.accessor.figure.oclIsKindOf(gmfgraph::VerticalLabel)
+}
+
+
+helper getSimpleLabelDelegateFQN() : String {
+ return getRuntimeLabelPackage().concat(".").concat("SimpleLabelDelegate");
+}
+
+helper getVerticalLabelFQN() : String {
+ return getRuntimeLabelPackage().concat(".").concat("VerticalLabel");
+}
+
+helper getVerticalLabelDelegateFQN() : String {
+ return getRuntimeLabelPackage().concat(".").concat("VerticalLabelDelegate");
+}
+
+helper getVerticalLabelCellEditorLocatorFQN() : String {
+ return getRuntimeLabelPackage().concat(".").concat("VerticalLabelCellEditorLocator");
+}
+
+helper getRuntimeLabelPackage() : String {
+ return "org.eclipse.gmf.tooling.runtime.draw2d.labels";
+}
+
+helper supportsVerticalLabels(diagram : gmfgen::GenDiagram) : Boolean {
+ return diagram.getAllNodes()->exists(n | hasVerticalLabels(n))
+}
+
+helper hasVerticalLabels(node : gmfgen::GenNode) : Boolean {
+ return isVerticalLabel(node) or node.labels->exists(label | isVerticalLabel(label))
+}
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 26a46c3a6..956983cbe 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/impl/parsers/expression.qvto
+++ b/plugins/org.eclipse.gmf.codegen/templates/impl/parsers/expression.qvto
@@ -1,25 +1,25 @@
-import xpt.diagram.Utils;
-modeltype gmfgen uses "http://www.eclipse.org/gmf/2009/GenModel";
-library expression;
-
-helper gmfgen::ExpressionLabelParser::isViewExpressionDefinedAndOcl() : Boolean {
- return not(self.viewExpression.oclIsUndefined()) and self.viewExpression.provider.oclIsKindOf(gmfgen::GenExpressionInterpreter);
-}
-
-helper gmfgen::GenParserImplementation::isViewExpressionDefinedAndOcl() : Boolean {
- return false;
-}
-
-helper gmfgen::GenCommonBase::isViewExpressionDefiedAndOcl() : 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()
- endif;
-}
-
+import xpt.diagram.Utils;
+modeltype gmfgen uses "http://www.eclipse.org/gmf/2009/GenModel";
+library expression;
+
+helper gmfgen::ExpressionLabelParser::isViewExpressionDefinedAndOcl() : Boolean {
+ return not(self.viewExpression.oclIsUndefined()) and self.viewExpression.provider.oclIsKindOf(gmfgen::GenExpressionInterpreter);
+}
+
+helper gmfgen::GenParserImplementation::isViewExpressionDefinedAndOcl() : Boolean {
+ return false;
+}
+
+helper gmfgen::GenCommonBase::isViewExpressionDefiedAndOcl() : 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()
+ endif;
+}
+
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 2c3f2857d..137984463 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
@@ -1,223 +1,223 @@
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/emf/2002/GenModel'»
-«IMPORT 'http://www.eclipse.org/emf/2002/Ecore'»
-
-«EXTENSION xpt::expressions::OclTracker»
-«EXTENSION xpt::GenModelUtils»
-
-«DEFINE VisualEffectEditPolicy FOR gmfgen::GenVisualEffect-»
-«EXPAND xpt::Common::copyright FOR subject.getDiagram().editorGen-»
-«EXPAND xpt::Common::packageStatement FOR getEditPolicyQualifiedClassName()»
-
-«EXPAND xpt::Common::generatedClassComment»
-public class «EXPAND xpt::Common::disqualifiedClassName FOR getEditPolicyQualifiedClassName()»«EXPAND extendsList» {
-
- «EXPAND fields-»
-
- «EXPAND _constructor-»
-
- «EXPAND methods-»
-}
-«ENDDEFINE»
-
-«DEFINE extendsList FOR gmfgen::GenVisualEffect-»
- extends org.eclipse.gmf.tooling.runtime.edit.policies.effect.AbstractOclVisualEffectEditPolicy
-«ENDDEFINE»
-
-«DEFINE fields FOR gmfgen::GenVisualEffect-»
- «EXPAND xpt::Common::generatedMemberComment»
- public static final String KEY = "«getEditPolicyQualifiedClassName()»:KEY";
-«ENDDEFINE»
-
-«DEFINE _constructor FOR gmfgen::GenVisualEffect-»
- «EXPAND xpt::Common::generatedMemberComment»
- public «EXPAND xpt::Common::disqualifiedClassName FOR getEditPolicyQualifiedClassName()»() {
- «IF isForcedImpactAnalyzerKind(oclExpression)-»
- super(org.eclipse.gmf.tooling.runtime.ocl.tracker.OclTrackerFactory.Type.IMPACT_ANALYZER);
- «ELSE-»
- super();
- «ENDIF-»
- }
-«ENDDEFINE»
-
-«DEFINE methods FOR gmfgen::GenVisualEffect-»
- «EXPAND setVisualEffectValue-»
-
- «EXPAND getHostImpl-»
-
- «EXPAND getExpressionBody-»
-
- «EXPAND getContext-»
-«ENDDEFINE»
-
-«DEFINE setVisualEffectValue FOR gmfgen::GenVisualEffect-»
- «EXPAND xpt::Common::generatedMemberComment»
-
- «EXPAND CodeStyle::override FOR self.oclAsType(ecore::EObject).eContainer().oclAsType(gmfgen::GenCommonBase)»
- protected void setVisualEffectValue(Object value) {
- «IF pinKind = 'ColorPin'-»
- «EXPAND setVisualEffectValueOnColorPin-»
- «ELSEIF pinKind = 'VisiblePin'-»
- «EXPAND setVisualEffectValueOnCustomPin-»
- «ELSEIF pinKind = 'CustomPin'-»
- «EXPAND setVisualEffectValueOnCustomPin-»
- «ELSE-»
- «ERROR 'Unsupported Pin kind: ' + pinKind»
- «ENDIF-»
- }
-«ENDDEFINE»
-
-«DEFINE getHostImpl FOR gmfgen::GenVisualEffect-»
- «EXPAND xpt::Common::generatedMemberComment»
- «EXPAND CodeStyle::override FOR self.oclAsType(ecore::EObject).eContainer().oclAsType(gmfgen::GenCommonBase)»
- protected «subject.getEditPartQualifiedClassName()» getHostImpl() {
- return («subject.getEditPartQualifiedClassName()») super.getHostImpl();
- }
-«ENDDEFINE»
-
-«DEFINE getExpressionBody FOR gmfgen::GenVisualEffect-»
- «EXPAND xpt::Common::generatedMemberComment»
- «EXPAND CodeStyle::override FOR self.oclAsType(ecore::EObject).eContainer().oclAsType(gmfgen::GenCommonBase)»
- protected String getExpressionBody() {
- return
- «IF subject.oclIsKindOf(gmfgen::GenLink)-»
- «EXPAND expressionLinkEnds FOR subject.oclAsType(gmfgen::GenLink).modelFacet-»
- «ENDIF-»
- «getOclExpressionString()»; «EXPAND xpt::Common::nonNLS»
- }
-«ENDDEFINE»
-
-«DEFINE expressionLinkEnds FOR gmfgen::LinkModelFacet»«ENDDEFINE»
-
-«DEFINE expressionLinkEnds FOR gmfgen::FeatureLinkModelFacet-»
- «IF metaFeature.ecoreFeature.upperBound = 1-»
- «EXPAND expressionLinkEnds('', '.'+metaFeature.ecoreFeature.name)-»
- «ELSE-»
- «LET getReverse(metaFeature) AS reverseMetaFeature-»
- «IF reverseMetaFeature <> null-»
- «EXPAND expressionLinkEnds('.'+reverseMetaFeature.ecoreFeature.name, '')-»
- «ELSEIF metaFeature.ecoreFeature.oclAsType(ecore::EReference).containment-»
- «EXPAND expressionLinkEnds('.oclAsType(ecore::EObject).eContainer().oclAsType('+getSourceType().ecoreClass.name+')', '')-»
- «ELSE-»
- /* unable to set up both link ends */
- «ENDIF-»
- «ENDLET-»
- «ENDIF-»
-«ENDDEFINE»
-
-«DEFINE expressionLinkEnds FOR gmfgen::TypeLinkModelFacet-»
- «EXPAND expressionLinkEnds('.'+sourceMetaFeature.ecoreFeature.name, '.'+targetMetaFeature.ecoreFeature.name)-»
-«ENDDEFINE»
-
-«DEFINE expressionLinkEnds(sourcePath : String, targetPath : String) FOR gmfgen::LinkModelFacet-»
- " let _src : «getSourceType().ecoreClass.name» = self«sourcePath» in " //
- + " let _dst : «getTargetType().ecoreClass.name» = self«targetPath» in " //
- +
-«ENDDEFINE»
-
-«DEFINE callOperation FOR gmfgen::GenVisualEffect-»
-getHostImpl().getPrimaryShape().«operationName-»
-«ENDDEFINE»
-
-«DEFINE setVisualEffectValueOnColorPin FOR gmfgen::GenVisualEffect-»
- «LET getOperationRuntimeType().oclAsType(ocl::ecore::TupleType) AS tupleType-»
- «EXPAND defineTupleParts FOR tupleType-»
- org.eclipse.swt.graphics.Color color = new org.eclipse.swt.graphics.Color(null, «EXPAND enumerateTupleParts FOR tupleType»);
- «EXPAND callOperation»(color);
- «ENDLET-»
-«ENDDEFINE»
-
-«DEFINE setVisualEffectValueOnCustomPin FOR gmfgen::GenVisualEffect-»
- «EXPAND setVisualEffectValueOfType(self) FOR getOperationRuntimeType()»
-«ENDDEFINE»
-
-«DEFINE setVisualEffectValueOfType(visualEffect : gmfgen::GenVisualEffect) FOR ecore::EClassifier-»
- «ERROR 'Asbtract template call setVisualEffectValueOfType for ' + self.repr()»
-«ENDDEFINE»
-
-«DEFINE setVisualEffectValueOfType(visualEffect : gmfgen::GenVisualEffect) FOR ocl::ecore::PrimitiveType-»
- «EXPAND callOperation FOR visualEffect»((«instanceTypeName»)value);
-«ENDDEFINE»
-
-«DEFINE setVisualEffectValueOfType(visualEffect : gmfgen::GenVisualEffect) FOR ocl::ecore::TupleType-»
- «EXPAND defineTupleParts»
- «EXPAND callOperation FOR visualEffect-»
- («-»
- «EXPAND enumerateTupleParts-»
- );
-«ENDDEFINE»
-
-«DEFINE defineTupleParts FOR ocl::ecore::TupleType-»
- org.eclipse.ocl.util.Tuple<?, ?> tupleValue = (org.eclipse.ocl.util.Tuple<?, ?>) value;
- «FOREACH eAllAttributes AS attribute -»
- «attribute.eType.instanceTypeName» «attribute.name» = («attribute.eType.instanceTypeName»)tupleValue.getValue("«attribute.name»");
- «ENDFOREACH-»
-«ENDDEFINE»
-
-«DEFINE enumerateTupleParts FOR ocl::ecore::TupleType-»
- «FOREACH eAllAttributes AS attribute SEPARATOR ','-»
- «attribute.name-»
- «ENDFOREACH-»
-«ENDDEFINE»
-
-«DEFINE getContext FOR gmfgen::GenVisualEffect-»
- «IF subject.oclIsKindOf(gmfgen::GenLink)-»
- «EXPAND getContext FOR subject.oclAsType(gmfgen::GenLink).modelFacet-»
- «ENDIF-»
-«ENDDEFINE»
-
-«DEFINE getContext FOR gmfgen::LinkModelFacet»«ENDDEFINE»
-
-«DEFINE getContext FOR gmfgen::FeatureLinkModelFacet-»
- «EXPAND xpt::Common::generatedMemberComment»
- «EXPAND CodeStyle::override FOR self.oclAsType(ecore::EObject).eContainer().oclAsType(gmfgen::GenCommonBase)»
- protected org.eclipse.emf.ecore.EObject getContext() {
- «IF metaFeature.ecoreFeature.upperBound = 1-»
- «EXPAND getContextBody('source', 'target', getSourceType(), getTargetType(), metaFeature)-»
- «ELSE-»
- «LET getReverse(metaFeature) AS reverseMetaFeature-»
- «IF reverseMetaFeature <> null or metaFeature.ecoreFeature.oclAsType(ecore::EReference).containment-»
- «EXPAND getContextBody('target', 'source', getTargetType(), getSourceType(), reverseMetaFeature)-»
- «ELSE-»
- // unable to pass both link ends
- return null;
- «ENDIF-»
- «ENDLET-»
- «ENDIF-»
- }
-«ENDDEFINE»
-
-
-«DEFINE getContextBody(selfName : String,
- oppositeName : String,
- selfType : genmodel::GenClass,
- oppositeType : genmodel::GenClass,
- selfFeature : genmodel::GenFeature) FOR gmfgen::FeatureLinkModelFacet-»
- org.eclipse.gmf.runtime.notation.Edge hostModel = (org.eclipse.gmf.runtime.notation.Edge) host().getModel();
- org.eclipse.gmf.runtime.notation.View targetModel = hostModel.getTarget();
- org.eclipse.gmf.runtime.notation.View sourceModel = hostModel.getSource();
-
- if (targetModel == null || sourceModel == null) {
- return null;
- }
-
- org.eclipse.emf.ecore.EObject «selfName»SemanticModel = org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.resolveSemanticElement(«selfName»Model);
- // need to check actual opposite of the semantic element, since diagram opposite could be not up to date
- «REM»(selfFeature = null) if link is multiplicity containment without opposite«ENDREM-»
- «IF selfFeature <> null-»
- «EXPAND MetaModel::QualifiedClassName FOR selfType» «selfName»TypedModel = «EXPAND MetaModel::CastEObject(selfName + 'SemanticModel') FOR selfType»;
- «ENDIF-»
- org.eclipse.emf.ecore.EObject «oppositeName»SemanticModel =
- «IF selfFeature <> null-»
- «EXPAND MetaModel::getFeatureValue(selfName + 'TypedModel', oppositeType) FOR selfFeature»
- «ELSE-»
- «selfName»SemanticModel.eContainer()
- «ENDIF-»
- ;
-
- if («oppositeName»SemanticModel == null) {
- return null;
- }
-
- return «selfName»SemanticModel;
+«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
+«IMPORT 'http://www.eclipse.org/emf/2002/GenModel'»
+«IMPORT 'http://www.eclipse.org/emf/2002/Ecore'»
+
+«EXTENSION xpt::expressions::OclTracker»
+«EXTENSION xpt::GenModelUtils»
+
+«DEFINE VisualEffectEditPolicy FOR gmfgen::GenVisualEffect-»
+«EXPAND xpt::Common::copyright FOR subject.getDiagram().editorGen-»
+«EXPAND xpt::Common::packageStatement FOR getEditPolicyQualifiedClassName()»
+
+«EXPAND xpt::Common::generatedClassComment»
+public class «EXPAND xpt::Common::disqualifiedClassName FOR getEditPolicyQualifiedClassName()»«EXPAND extendsList» {
+
+ «EXPAND fields-»
+
+ «EXPAND _constructor-»
+
+ «EXPAND methods-»
+}
+«ENDDEFINE»
+
+«DEFINE extendsList FOR gmfgen::GenVisualEffect-»
+ extends org.eclipse.gmf.tooling.runtime.edit.policies.effect.AbstractOclVisualEffectEditPolicy
+«ENDDEFINE»
+
+«DEFINE fields FOR gmfgen::GenVisualEffect-»
+ «EXPAND xpt::Common::generatedMemberComment»
+ public static final String KEY = "«getEditPolicyQualifiedClassName()»:KEY";
+«ENDDEFINE»
+
+«DEFINE _constructor FOR gmfgen::GenVisualEffect-»
+ «EXPAND xpt::Common::generatedMemberComment»
+ public «EXPAND xpt::Common::disqualifiedClassName FOR getEditPolicyQualifiedClassName()»() {
+ «IF isForcedImpactAnalyzerKind(oclExpression)-»
+ super(org.eclipse.gmf.tooling.runtime.ocl.tracker.OclTrackerFactory.Type.IMPACT_ANALYZER);
+ «ELSE-»
+ super();
+ «ENDIF-»
+ }
+«ENDDEFINE»
+
+«DEFINE methods FOR gmfgen::GenVisualEffect-»
+ «EXPAND setVisualEffectValue-»
+
+ «EXPAND getHostImpl-»
+
+ «EXPAND getExpressionBody-»
+
+ «EXPAND getContext-»
+«ENDDEFINE»
+
+«DEFINE setVisualEffectValue FOR gmfgen::GenVisualEffect-»
+ «EXPAND xpt::Common::generatedMemberComment»
+
+ «EXPAND CodeStyle::override FOR self.oclAsType(ecore::EObject).eContainer().oclAsType(gmfgen::GenCommonBase)»
+ protected void setVisualEffectValue(Object value) {
+ «IF pinKind = 'ColorPin'-»
+ «EXPAND setVisualEffectValueOnColorPin-»
+ «ELSEIF pinKind = 'VisiblePin'-»
+ «EXPAND setVisualEffectValueOnCustomPin-»
+ «ELSEIF pinKind = 'CustomPin'-»
+ «EXPAND setVisualEffectValueOnCustomPin-»
+ «ELSE-»
+ «ERROR 'Unsupported Pin kind: ' + pinKind»
+ «ENDIF-»
+ }
+«ENDDEFINE»
+
+«DEFINE getHostImpl FOR gmfgen::GenVisualEffect-»
+ «EXPAND xpt::Common::generatedMemberComment»
+ «EXPAND CodeStyle::override FOR self.oclAsType(ecore::EObject).eContainer().oclAsType(gmfgen::GenCommonBase)»
+ protected «subject.getEditPartQualifiedClassName()» getHostImpl() {
+ return («subject.getEditPartQualifiedClassName()») super.getHostImpl();
+ }
+«ENDDEFINE»
+
+«DEFINE getExpressionBody FOR gmfgen::GenVisualEffect-»
+ «EXPAND xpt::Common::generatedMemberComment»
+ «EXPAND CodeStyle::override FOR self.oclAsType(ecore::EObject).eContainer().oclAsType(gmfgen::GenCommonBase)»
+ protected String getExpressionBody() {
+ return
+ «IF subject.oclIsKindOf(gmfgen::GenLink)-»
+ «EXPAND expressionLinkEnds FOR subject.oclAsType(gmfgen::GenLink).modelFacet-»
+ «ENDIF-»
+ «getOclExpressionString()»; «EXPAND xpt::Common::nonNLS»
+ }
+«ENDDEFINE»
+
+«DEFINE expressionLinkEnds FOR gmfgen::LinkModelFacet»«ENDDEFINE»
+
+«DEFINE expressionLinkEnds FOR gmfgen::FeatureLinkModelFacet-»
+ «IF metaFeature.ecoreFeature.upperBound = 1-»
+ «EXPAND expressionLinkEnds('', '.'+metaFeature.ecoreFeature.name)-»
+ «ELSE-»
+ «LET getReverse(metaFeature) AS reverseMetaFeature-»
+ «IF reverseMetaFeature <> null-»
+ «EXPAND expressionLinkEnds('.'+reverseMetaFeature.ecoreFeature.name, '')-»
+ «ELSEIF metaFeature.ecoreFeature.oclAsType(ecore::EReference).containment-»
+ «EXPAND expressionLinkEnds('.oclAsType(ecore::EObject).eContainer().oclAsType('+getSourceType().ecoreClass.name+')', '')-»
+ «ELSE-»
+ /* unable to set up both link ends */
+ «ENDIF-»
+ «ENDLET-»
+ «ENDIF-»
+«ENDDEFINE»
+
+«DEFINE expressionLinkEnds FOR gmfgen::TypeLinkModelFacet-»
+ «EXPAND expressionLinkEnds('.'+sourceMetaFeature.ecoreFeature.name, '.'+targetMetaFeature.ecoreFeature.name)-»
+«ENDDEFINE»
+
+«DEFINE expressionLinkEnds(sourcePath : String, targetPath : String) FOR gmfgen::LinkModelFacet-»
+ " let _src : «getSourceType().ecoreClass.name» = self«sourcePath» in " //
+ + " let _dst : «getTargetType().ecoreClass.name» = self«targetPath» in " //
+ +
+«ENDDEFINE»
+
+«DEFINE callOperation FOR gmfgen::GenVisualEffect-»
+getHostImpl().getPrimaryShape().«operationName-»
+«ENDDEFINE»
+
+«DEFINE setVisualEffectValueOnColorPin FOR gmfgen::GenVisualEffect-»
+ «LET getOperationRuntimeType().oclAsType(ocl::ecore::TupleType) AS tupleType-»
+ «EXPAND defineTupleParts FOR tupleType-»
+ org.eclipse.swt.graphics.Color color = new org.eclipse.swt.graphics.Color(null, «EXPAND enumerateTupleParts FOR tupleType»);
+ «EXPAND callOperation»(color);
+ «ENDLET-»
+«ENDDEFINE»
+
+«DEFINE setVisualEffectValueOnCustomPin FOR gmfgen::GenVisualEffect-»
+ «EXPAND setVisualEffectValueOfType(self) FOR getOperationRuntimeType()»
+«ENDDEFINE»
+
+«DEFINE setVisualEffectValueOfType(visualEffect : gmfgen::GenVisualEffect) FOR ecore::EClassifier-»
+ «ERROR 'Asbtract template call setVisualEffectValueOfType for ' + self.repr()»
+«ENDDEFINE»
+
+«DEFINE setVisualEffectValueOfType(visualEffect : gmfgen::GenVisualEffect) FOR ocl::ecore::PrimitiveType-»
+ «EXPAND callOperation FOR visualEffect»((«instanceTypeName»)value);
+«ENDDEFINE»
+
+«DEFINE setVisualEffectValueOfType(visualEffect : gmfgen::GenVisualEffect) FOR ocl::ecore::TupleType-»
+ «EXPAND defineTupleParts»
+ «EXPAND callOperation FOR visualEffect-»
+ («-»
+ «EXPAND enumerateTupleParts-»
+ );
+«ENDDEFINE»
+
+«DEFINE defineTupleParts FOR ocl::ecore::TupleType-»
+ org.eclipse.ocl.util.Tuple<?, ?> tupleValue = (org.eclipse.ocl.util.Tuple<?, ?>) value;
+ «FOREACH eAllAttributes AS attribute -»
+ «attribute.eType.instanceTypeName» «attribute.name» = («attribute.eType.instanceTypeName»)tupleValue.getValue("«attribute.name»");
+ «ENDFOREACH-»
+«ENDDEFINE»
+
+«DEFINE enumerateTupleParts FOR ocl::ecore::TupleType-»
+ «FOREACH eAllAttributes AS attribute SEPARATOR ','-»
+ «attribute.name-»
+ «ENDFOREACH-»
+«ENDDEFINE»
+
+«DEFINE getContext FOR gmfgen::GenVisualEffect-»
+ «IF subject.oclIsKindOf(gmfgen::GenLink)-»
+ «EXPAND getContext FOR subject.oclAsType(gmfgen::GenLink).modelFacet-»
+ «ENDIF-»
+«ENDDEFINE»
+
+«DEFINE getContext FOR gmfgen::LinkModelFacet»«ENDDEFINE»
+
+«DEFINE getContext FOR gmfgen::FeatureLinkModelFacet-»
+ «EXPAND xpt::Common::generatedMemberComment»
+ «EXPAND CodeStyle::override FOR self.oclAsType(ecore::EObject).eContainer().oclAsType(gmfgen::GenCommonBase)»
+ protected org.eclipse.emf.ecore.EObject getContext() {
+ «IF metaFeature.ecoreFeature.upperBound = 1-»
+ «EXPAND getContextBody('source', 'target', getSourceType(), getTargetType(), metaFeature)-»
+ «ELSE-»
+ «LET getReverse(metaFeature) AS reverseMetaFeature-»
+ «IF reverseMetaFeature <> null or metaFeature.ecoreFeature.oclAsType(ecore::EReference).containment-»
+ «EXPAND getContextBody('target', 'source', getTargetType(), getSourceType(), reverseMetaFeature)-»
+ «ELSE-»
+ // unable to pass both link ends
+ return null;
+ «ENDIF-»
+ «ENDLET-»
+ «ENDIF-»
+ }
+«ENDDEFINE»
+
+
+«DEFINE getContextBody(selfName : String,
+ oppositeName : String,
+ selfType : genmodel::GenClass,
+ oppositeType : genmodel::GenClass,
+ selfFeature : genmodel::GenFeature) FOR gmfgen::FeatureLinkModelFacet-»
+ org.eclipse.gmf.runtime.notation.Edge hostModel = (org.eclipse.gmf.runtime.notation.Edge) host().getModel();
+ org.eclipse.gmf.runtime.notation.View targetModel = hostModel.getTarget();
+ org.eclipse.gmf.runtime.notation.View sourceModel = hostModel.getSource();
+
+ if (targetModel == null || sourceModel == null) {
+ return null;
+ }
+
+ org.eclipse.emf.ecore.EObject «selfName»SemanticModel = org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.resolveSemanticElement(«selfName»Model);
+ // need to check actual opposite of the semantic element, since diagram opposite could be not up to date
+ «REM»(selfFeature = null) if link is multiplicity containment without opposite«ENDREM-»
+ «IF selfFeature <> null-»
+ «EXPAND MetaModel::QualifiedClassName FOR selfType» «selfName»TypedModel = «EXPAND MetaModel::CastEObject(selfName + 'SemanticModel') FOR selfType»;
+ «ENDIF-»
+ org.eclipse.emf.ecore.EObject «oppositeName»SemanticModel =
+ «IF selfFeature <> null-»
+ «EXPAND MetaModel::getFeatureValue(selfName + 'TypedModel', oppositeType) FOR selfFeature»
+ «ELSE-»
+ «selfName»SemanticModel.eContainer()
+ «ENDIF-»
+ ;
+
+ if («oppositeName»SemanticModel == null) {
+ return null;
+ }
+
+ return «selfName»SemanticModel;
«ENDDEFINE» \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/diagram.gif b/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/diagram.gif
index bdc8ae9a0..d766ee3b8 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/diagram.gif
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/diagram.gif
Binary files differ
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/wizban.gif b/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/wizban.gif
index cc3848e15..1e20ffd08 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/wizban.gif
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/wizban.gif
Binary files differ
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/navigator/navigatorGroup.gif b/plugins/org.eclipse.gmf.codegen/templates/xpt/navigator/navigatorGroup.gif
index fca9c53e6..339f99d5f 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/navigator/navigatorGroup.gif
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/navigator/navigatorGroup.gif
Binary files differ

Back to the top