Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorashatalin2008-12-29 07:41:38 -0500
committerashatalin2008-12-29 07:41:38 -0500
commitfc1dfb3b462e159eec1b6031bb41ab79c762474b (patch)
tree66acb7873f68640147106dcd919a5041ecbc918b /plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/diagram/views/Utils.xpt
parent7f3bb1960b122d5d9c4edae8dc1c330032c9cf60 (diff)
downloadorg.eclipse.gmf-tooling-fc1dfb3b462e159eec1b6031bb41ab79c762474b.tar.gz
org.eclipse.gmf-tooling-fc1dfb3b462e159eec1b6031bb41ab79c762474b.tar.xz
org.eclipse.gmf-tooling-fc1dfb3b462e159eec1b6031bb41ab79c762474b.zip
QVTO-based xpand implementation was merged to HEAD
Diffstat (limited to 'plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/diagram/views/Utils.xpt')
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/diagram/views/Utils.xpt111
1 files changed, 111 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/diagram/views/Utils.xpt b/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/diagram/views/Utils.xpt
new file mode 100644
index 000000000..33eba2ec3
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/diagram/views/Utils.xpt
@@ -0,0 +1,111 @@
+/*
+ * 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
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Dmitry Stadnik (Borland) - initial API and implementation
+ */
+
+«IMPORT 'http://www.eclipse.org/gmf/2008/GenModel'»
+«IMPORT 'http://www.eclipse.org/emf/2002/Ecore'»
+«IMPORT 'http://www.eclipse.org/emf/2002/GenModel'»
+«EXTENSION xpt::diagram::ViewmapAttributesUtils»
+«EXTENSION xpt::GenModelUtils»
+
+«DEFINE updateSemanticHint FOR gmfgen::GenCommonBase-»
+ if (semanticHint == null) {
+ semanticHint = «getDiagram().getVisualIDRegistryQualifiedClassName()».getType(
+ «getEditPartQualifiedClassName()».VISUAL_ID);
+ view.setType(semanticHint);
+ }
+«ENDDEFINE»
+
+«DEFINE createChildNode FOR gmfgen::GenCommonBase-»
+ getViewService().createNode(eObjectAdapter, view,
+ «getDiagram().getVisualIDRegistryQualifiedClassName()».getType(«getEditPartQualifiedClassName()».VISUAL_ID),
+ org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.APPEND, true, getPreferencesHint());
+«ENDDEFINE»
+
+«DEFINE domainElementAdapter(adapterVar : String) FOR gmfgen::ModelFacet-»
+«ENDDEFINE»
+
+«DEFINE domainElementAdapter(adapterVar : String) FOR gmfgen::TypeModelFacet-»
+ org.eclipse.emf.ecore.EObject eObject =
+ (org.eclipse.emf.ecore.EObject) semanticAdapter.getAdapter(org.eclipse.emf.ecore.EObject.class);
+ if (eObject != null) {
+ «adapterVar» = new org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter(eObject);
+ }
+«ENDDEFINE»
+
+«DEFINE foregroundColour(viewVar : String) FOR gmfgen::Viewmap-»
+ «EXPAND foregroundColour(viewVar) FOREACH attributes-»
+«ENDDEFINE»
+
+«DEFINE foregroundColour(viewVar : String) FOR gmfgen::Attributes-»
+«ENDDEFINE»
+
+«DEFINE foregroundColour(viewVar : String) FOR gmfgen::ColorAttributes-»
+ org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(«viewVar»,
+ org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getLineStyle_LineColor(),
+ org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities.colorToInteger(
+ org.eclipse.draw2d.ColorConstants.«foregroundColor»));
+«ENDDEFINE»
+
+«DEFINE backgroundColour(viewVar : String) FOR gmfgen::Viewmap-»
+ «EXPAND backgroundColour(viewVar) FOREACH attributes-»
+«ENDDEFINE»
+
+«DEFINE backgroundColour(viewVar : String) FOR gmfgen::Attributes-»
+«ENDDEFINE»
+
+«DEFINE backgroundColour(viewVar : String) FOR gmfgen::ColorAttributes-»
+ org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(«viewVar»,
+ org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getFillStyle_FillColor(),
+ org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities.colorToInteger(
+ org.eclipse.draw2d.ColorConstants.«backgroundColor»));
+«ENDDEFINE»
+
+«DEFINE addShapeStyle(stylesVar : String) FOR gmfgen::Viewmap-»
+ «IF isFixedFont(self)-»
+ «stylesVar».add(org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createDescriptionStyle());
+ «stylesVar».add(org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createFillStyle());
+ «stylesVar».add(org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createLineStyle());
+ «ELSE-»
+ «stylesVar».add(org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createShapeStyle());
+ «ENDIF-»
+«ENDDEFINE»
+
+«DEFINE addTextStyle(stylesVar : String) FOR gmfgen::LabelModelFacet-»
+«ENDDEFINE»
+
+«DEFINE addTextStyle(stylesVar : String) FOR gmfgen::DesignLabelModelFacet-»
+ «stylesVar».add(org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createDescriptionStyle());
+«ENDDEFINE»
+
+«DEFINE addLinkedDiagramStyle(stylesVar : String) FOR gmfgen::GenCommonBase-»
+ «EXPAND addLinkedDiagramStyle(stylesVar) FOREACH behaviour-»
+«ENDDEFINE»
+
+«DEFINE addLinkedDiagramStyle(stylesVar : String) FOR gmfgen::Behaviour-»
+«ENDDEFINE»
+
+«DEFINE addLinkedDiagramStyle(stylesVar : String) FOR gmfgen::OpenDiagramBehaviour-»
+ {
+ org.eclipse.gmf.runtime.notation.HintedDiagramLinkStyle diagramFacet =
+ org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createHintedDiagramLinkStyle();
+ «IF diagramKind <> null-»
+ diagramFacet.setHint("«diagramKind»"); // $NON-NLS-1$
+ «ENDIF-»
+ «stylesVar».add(diagramFacet);
+ }
+«ENDDEFINE»
+
+«DEFINE addCustomStyles(stylesVar : String) FOR gmfgen::GenCommonBase-»
+ «FOREACH styles->asSequence() AS style-»
+ «stylesVar».add(«EXPAND MetaModel::NewInstance FOR style»);
+ «ENDFOREACH-»
+«ENDDEFINE»

Back to the top