diff options
Diffstat (limited to 'plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.codegen/templates/impl/diagram/editparts/RuntimeLabelsSupport.qvto')
-rw-r--r-- | plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.codegen/templates/impl/diagram/editparts/RuntimeLabelsSupport.qvto | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.codegen/templates/impl/diagram/editparts/RuntimeLabelsSupport.qvto b/plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.codegen/templates/impl/diagram/editparts/RuntimeLabelsSupport.qvto deleted file mode 100644 index 600ccd3aa52..00000000000 --- a/plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.codegen/templates/impl/diagram/editparts/RuntimeLabelsSupport.qvto +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2012, 2020 Borland Software Corporation, CEA LIST, Artal - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Michael Golubev (Borland) - initial API and implementation - * Aurelien Didier (ARTAL) - aurelien.didier51@gmail.com - Bug 569174 - *****************************************************************************/ -import xpt.OclMigrationProblems; - -modeltype gmfgen uses "http://www.eclipse.org/papyrus/gmf/2020/GenModel"; -modeltype gmfgraph uses "http://www.eclipse.org/papyrus/gmf/2020/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)) -} |