Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/RuntimeLabelsSupport.qvto')
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/RuntimeLabelsSupport.qvto122
1 files changed, 61 insertions, 61 deletions
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))
+}

Back to the top