Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Le Fevre - CEA2016-02-12 16:39:58 +0000
committerGerrit Code Review @ Eclipse.org2016-02-15 08:37:28 +0000
commit5f20e6d9b53c77b4f9a8d467cd96d579ee72bc86 (patch)
tree2cecacfc7752f81c131e83f82812a987b8fa194c /plugins/developer
parent44c20884092aa34624c42f80588622150885ef6d (diff)
downloadorg.eclipse.papyrus-5f20e6d9b53c77b4f9a8d467cd96d579ee72bc86.tar.gz
org.eclipse.papyrus-5f20e6d9b53c77b4f9a8d467cd96d579ee72bc86.tar.xz
org.eclipse.papyrus-5f20e6d9b53c77b4f9a8d467cd96d579ee72bc86.zip
Bug 487751 - [diagram] remove old templates
Change-Id: Ic03042c71108755efee1a027dd063a27aa3f67ce Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=4787751 Signed-off-by: Francois Le Fevre - CEA <francois.le-fevre@cea.fr>
Diffstat (limited to 'plugins/developer')
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/build.properties4
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/CodeStyle.xpt86
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/ChildNodeLabelEditPart.xpt108
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/CompartmentEditPart.xpt78
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/DiagramEditPart.xpt72
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/ExternalNodeLabelEditPart.xpt63
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/LinkEditPart.xpt67
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/LinkLabelEditPart.xpt51
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/NodeEditPart.xpt141
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/NodeLabelEditPart.xpt107
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/ChildNodeLabelEditPart.xpt30
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/CompartmentEditPart.xpt36
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/DiagramEditPart.xpt125
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/EditPartsUtils.qvto49
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/LinkEditPart.xpt162
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/LinkLabelEditPart.xpt33
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/NodeEditPart.xpt302
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/NodeLabelEditPart.xpt32
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/TextAware.xpt793
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/preferences/StandardPage.xpt52
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/Common.xpt153
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/editparts/Common.xpt175
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/editparts/EditPartFactory.xpt118
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/editpolicies/linkCommands.xpt83
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/preferences/PreferenceInitializer.xpt50
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/preferences/extensions.xpt47
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/updater/DiagramUpdater.xpt65
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/views/Utils.xpt24
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/editor/Editor.xpt594
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/plugin/Activator.xpt286
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/plugin/manifest.xpt87
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/plugin/plugin.xpt347
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/providers/ViewProvider.xpt686
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/commands/CreateLinkUtils.xpt141
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/commands/CreateNodeCommand.xpt208
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/commands/NodeConstraintUtils.qvto53
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/commands/file.qvto9
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/edithelpers/BaseEditHelper.xpt65
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/edithelpers/EditHelper.xpt27
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/edithelpers/EditHelperUtils.qvto17
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/BaseItemSemanticEditPolicy.xpt607
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/CompartmentItemSemanticEditPolicy.xpt123
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/DiagramItemSemanticEditPolicy.xpt138
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/LinkItemSemanticEditPolicy.xpt75
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/NodeItemSemanticEditPolicy.xpt216
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/UtilsItemSemanticEditPolicy.xpt50
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/childContainerCreateCommand.xpt64
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/linkCommands.xpt183
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/updater/DiagramUpdater.xpt273
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/DeleteElementAction.xpt22
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/DiagramEditorContextMenuProvider.xpt78
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/ViewInfoUtils.qvto60
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/VisualIDRegistry.xpt491
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/extensions.xpt87
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/palette/PaletteFactory.xpt362
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/palette/Utils.qvto85
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/navigator/NavigatorContentProvider.xpt472
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/preferences/LinkPreferencePage.xpt92
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/preferences/NodePreferencePage.xpt196
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/preferences/PrefsConstant.qvto99
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/providers/ValidationDecoratorProvider.xpt64
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/providers/extensions.xpt200
62 files changed, 1 insertions, 9662 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.def/build.properties b/plugins/developer/org.eclipse.papyrus.def/build.properties
index 843e1a7d8bb..057f0ec72ef 100644
--- a/plugins/developer/org.eclipse.papyrus.def/build.properties
+++ b/plugins/developer/org.eclipse.papyrus.def/build.properties
@@ -5,9 +5,7 @@ output.. = bin/
bin.includes = META-INF/,\
.,\
about.html,\
- dynamic-templates3.5/,\
plugin.properties,\
xtend/,\
xtend-gen/
-src.includes = dynamic-templates3.5/,\
- about.html
+src.includes = about.html
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/CodeStyle.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/CodeStyle.xpt
deleted file mode 100644
index 2f07726ece5..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/CodeStyle.xpt
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2010 Artem Tikhomirov and others
- *
- * 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:
- * Artem Tikhomirov (independent) - initial API and implementation
- * modificiation by Patrick Tessier (CEA LIST)
- */
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«EXTENSION xpt::GenEditorGenerator»
-// Generic types
-«DEFINE G(String type) FOR gmfgen::GenCommonBase»«IF self.jdkComplianceLevel() > 4»<«type»>«ELSE»/*[«type»]*/«ENDIF»«ENDDEFINE»
-«DEFINE G2(String type1, String type2) FOR gmfgen::GenCommonBase»«IF self.jdkComplianceLevel() > 4»<«type1», «type2»>«ELSE»/*[«type1», «type2»]*/«ENDIF»«ENDDEFINE»
-«DEFINE _g2_3(String t, String a, String b, String c) FOR gmfgen::GenCommonBase»«t»«IF self.jdkComplianceLevel() > 4»<«a», «b»<«c»>>«ELSE»/*[«a», «b»[«c»]]*/«ENDIF»«ENDDEFINE»
-
-// e.g. java.util.List<String>
-«DEFINE G(String type, String typeArgument) FOR gmfgen::GenCommonBase»«type»«EXPAND G(typeArgument)»«ENDDEFINE»
-// e.g. java.util.Map<String, Integer>
-«DEFINE G2(String type, String typeArgument1, String typeArgument2) FOR gmfgen::GenCommonBase»«type»«EXPAND G2(typeArgument1, typeArgument2)»«ENDDEFINE»
-
-// java.util.List<String> varName = new Type<TypeArgument>
-// note, no constructor parameters, callers should add (); or whatever they think is reasonable
-// XXX perhaps, varName should go first, to be consistent with iterate?
-«DEFINE newGenericInstance(String varName, String type, String typeArgument) FOR gmfgen::GenCommonBase»«EXPAND G(type, typeArgument)» «varName» = new «EXPAND G(type, typeArgument)»«ENDDEFINE»
-
-// new HashMap<Object, String>
-«DEFINE newGenericInstance2(String varName, String type, String typeArgument1, String typeArgument2) FOR gmfgen::GenCommonBase»«EXPAND G2(type, typeArgument1, typeArgument2)» «varName»= new «EXPAND G2(type, typeArgument1, typeArgument2)»«ENDDEFINE»
-
-// new HashMap<Object, List<String>>
-«DEFINE newGenericInstance2(String varName, String type, String typeArgument1, String typeArgument2, String typeArgument3) FOR gmfgen::GenCommonBase»«EXPAND _g2_3(type, typeArgument1, typeArgument2, typeArgument3)» «varName»= new «EXPAND _g2_3(type, typeArgument1, typeArgument2, typeArgument3)»«ENDDEFINE»
-
-// iterate cycle with explicit iterator variable
-// use this one if you need access to iterator (i.e. remove elements) or when there's no java.lang.Iterable source (i.e. some API gives Iterator right away)
-«DEFINE iterate(String elementVar, String elementType, String iteratorVar, String iterationSource) FOR gmfgen::GenCommonBase-»
-for («EXPAND G('java.util.Iterator', elementType)» «iteratorVar» = «iterationSource»; «iteratorVar».hasNext();) {
- «elementType» «elementVar» = «IF 'Object' <> elementType /*cast to Object is implicit*/ and not (self.jdkComplianceLevel() > 4) /*generics are not used then, should cast. Using 'not greater 4' instead of 'less than 5' to handle null/undefined case correctly*/»(«elementType») «ENDIF»«iteratorVar».next();
-«ENDDEFINE»
-
-//
-// generates Java5-style iterate cycle (no explicit iterator), if possibl, otherwise uses default iterator name, 'it'
-// beware of nested cycles using same 'it' name (relevant for Java 1.4)
-«DEFINE iterate(String elementVar, String elementType, String iterable /*java.lang.Iterable*/) FOR gmfgen::GenCommonBase-»
-«IF self.jdkComplianceLevel() > 4 -»
-for («elementType» «elementVar» : «iterable») {
-«ELSE-»
-«EXPAND iterate(elementVar, elementType, 'it', iterable.concat('.iterator()'))-»
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE emptyList FOR gmfgen::GenCommonBase-»
-«IF self.jdkComplianceLevel() > 4 -»
-java.util.Collections.emptyList()«ELSE-»
-java.util.Collections.EMPTY_LIST«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE emptyMap(String genericTypes) FOR gmfgen::GenCommonBase-»
-«IF self.jdkComplianceLevel() > 4 -»
-java.util.Collections.<«genericTypes»>emptyMap()«ELSE-»
-java.util.Collections.EMPTY_MAP«ENDIF-»
-«ENDDEFINE»
-
-// when need to cast 1.5-typed variable to be usable in 1.4 code. does nothing for 1.5 and greater. I.e.
-// List/*[String]*/ coll = ...
-// String aaa = (String) coll.get(0);
-// cast to string is needed in 1.4
-«DEFINE castTyped(String type) FOR gmfgen::GenCommonBase»«IF not (self.jdkComplianceLevel() > 4)»(«type») «ENDIF»«ENDDEFINE»
-
-// annotations are from Java 5 and above
-«DEFINE SuppressWarnings(String warnToken) FOR gmfgen::GenEditorGenerator»«EXPAND SuppressWarnings(warnToken) FOR diagram»«ENDDEFINE»
-«DEFINE SuppressWarnings(String warnToken) FOR gmfgen::GenCommonBase-»
-«IF self.jdkComplianceLevel() > 4 -»
-@SuppressWarnings(«warnToken»)
-«ENDIF-»
-«ENDDEFINE»
-
-
-«AROUND override FOR gmfgen::GenCommonBase-»
-«IF self.jdkComplianceLevel() > 5-»
-@Override
-«ENDIF-»
-«ENDAROUND» \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/ChildNodeLabelEditPart.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/ChildNodeLabelEditPart.xpt
deleted file mode 100644
index 20564c3cb9a..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/ChildNodeLabelEditPart.xpt
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2006, 2009 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
- * Alexander Shatalin (Borland) - initial API and implementation
- */
-
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension'»
-«REM»DOCUMENTATION: PapyrusGencode«ENDREM»
-«REM»Dthis template changes only the define implementsList line 64«ENDREM»
-
-«EXTENSION xpt::diagram::editparts::Utils»
-
-«DEFINE Main FOR gmfgen::GenChildLabelNode-»
-«EXPAND xpt::Common::copyright FOR getDiagram().editorGen-»
-package «getDiagram().editPartsPackageName»;
-
-«EXPAND xpt::Common::generatedClassComment»
-public class «editPartClassName» «EXPAND extendsList» «EXPAND implementsList» {
-
- «EXPAND attributes-»
-
- «EXPAND impl::diagram::editparts::ChildNodeLabelEditPart::contsructor-»
-
- «EXPAND getDragTracker-»
-
- «EXPAND createDefaultEditPolicies-»
-
- «EXPAND impl::diagram::editparts::TextAware::methods(false, labelReadOnly, labelElementIcon, viewmap, labelModelFacet, self, getDiagram())-»
-
- «EXPAND xpt::diagram::editparts::Common::notationalListeners-»
-
-«IF getAssistantOutgoingLinks(self)->size() > 0-»
- «EXPAND impl::diagram::editparts::NodeEditPart::getMARelTypesOnSource-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::getMARelTypesOnSourceAndTarget-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::getMATypesForTarget-»
-«ENDIF-»
-
-«IF getAssistantIncomingLinks(self)->size() > 0-»
- «EXPAND impl::diagram::editparts::NodeEditPart::getMARelTypesOnTarget-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::getMATypesForSource-»
-«ENDIF-»
-
- «EXPAND handleNotificationEvent-»
-
- «EXPAND xpt::diagram::editparts::Common::labelFigure FOR viewmap-»
-
- «EXPAND additions-»
-}
-«ENDDEFINE»
-
-«DEFINE extendsList FOR gmfgen::GenChildLabelNode»
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»Add own extension«ENDREM»
-«IF papyrusgmfgenextension::ExtendedGenView.allInstances()->select(v:papyrusgmfgenextension::ExtendedGenView|v.genView->includes(self) and v.superOwnedEditPart<>null)->size()<>0»
- extends «FOREACH papyrusgmfgenextension::ExtendedGenView.allInstances()->select(v:papyrusgmfgenextension::ExtendedGenView|v.genView->includes(self) and v.superOwnedEditPart<>null) AS extendedObject»«EXPAND specifyInheritance FOR extendedObject»«ENDFOREACH-»
-«REM»END: BEGIN: PapyrusGenCode«ENDREM»
-«ELSE»
- extends org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart
-«ENDIF»
-«ENDDEFINE»
-
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»definition of the inheritance «ENDREM»
-«DEFINE specifyInheritance FOR papyrusgmfgenextension::ExtendedGenView-»«superOwnedEditPart»«ENDDEFINE»
-«REM»END: BEGIN: PapyrusGenCode«ENDREM»
-
-«DEFINE implementsList FOR gmfgen::GenChildLabelNode»implements org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart, org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart, org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit«ENDDEFINE»
-
-«DEFINE attributes FOR gmfgen::GenChildLabelNode-»
- «EXPAND xpt::diagram::editparts::Common::visualIDConstant FOR self-»
-
- «EXPAND impl::diagram::editparts::TextAware::fields FOR self-»
-«ENDDEFINE»
-
-«DEFINE getDragTracker FOR gmfgen::GenChildLabelNode-»
- «EXPAND xpt::Common::generatedMemberComment»
-public org.eclipse.gef.DragTracker getDragTracker(org.eclipse.gef.Request request) {
- «EXPAND impl::diagram::editparts::ChildNodeLabelEditPart::getDragTrackerBody-»
-}
-«ENDDEFINE»
-
-«DEFINE createDefaultEditPolicies FOR gmfgen::GenChildLabelNode-»
- «EXPAND xpt::Common::generatedMemberComment»
-protected void createDefaultEditPolicies() {
- «EXPAND impl::diagram::editparts::ChildNodeLabelEditPart::createDefaultEditPoliciesBody-»
-}
-«ENDDEFINE»
-
-«DEFINE handleNotificationEvent FOR gmfgen::GenChildLabelNode-»
- «EXPAND xpt::Common::generatedMemberComment»
-protected void handleNotificationEvent(org.eclipse.emf.common.notify.Notification event) {
- «EXPAND impl::diagram::editparts::ChildNodeLabelEditPart::handleNotificationEventBody-»
-}
-«ENDDEFINE»
-
-«DEFINE additions FOR gmfgen::GenChildLabelNode»«ENDDEFINE» \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/CompartmentEditPart.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/CompartmentEditPart.xpt
deleted file mode 100644
index be2bd7542b2..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/CompartmentEditPart.xpt
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2006, 2009 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
- * Alexander Shatalin (Borland) - initial API and implementation
- */
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension'»
-«EXTENSION xpt::diagram::editparts::Utils»
-«REM»DOCUMENTATION: PapyrusGencode«ENDREM»
-«REM»Dthis template changes only the redefine the superclass and add code to manage the size the and the refresh visual «ENDREM»
-
-
-«AROUND extendsList FOR gmfgen::GenCompartment-»
-
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»Add own extension«ENDREM»
-«IF papyrusgmfgenextension::ExtendedGenView.allInstances()->select(v:papyrusgmfgenextension::ExtendedGenView|v.genView->includes(self) and v.superOwnedEditPart<>null)->size()<>0»
- extends «FOREACH papyrusgmfgenextension::ExtendedGenView.allInstances()->select(v:papyrusgmfgenextension::ExtendedGenView|v.genView->includes(self) and v.superOwnedEditPart<>null) AS extendedObject»«EXPAND specifyInheritance FOR extendedObject»«ENDFOREACH-»
-«REM»END: BEGIN: PapyrusGenCode«ENDREM»
-«ELSE»
- «targetDef.proceed()»
-«ENDIF»
-«ENDAROUND»
-
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»definition of the inheritance «ENDREM»
-«DEFINE specifyInheritance FOR papyrusgmfgenextension::ExtendedGenView-»«superOwnedEditPart»«ENDDEFINE»
-«REM»END: BEGIN: PapyrusGenCode«ENDREM»
-
-«AROUND additions FOR gmfgen::GenCompartment»
- «EXPAND handleSize-»
- «EXPAND refreshbound-»
- «EXPAND refreshvisual-»
-«ENDAROUND»
-
-«DEFINE handleSize FOR gmfgen::GenCompartment»
- «EXPAND xpt::Common::generatedMemberComment»
-protected void handleNotificationEvent(org.eclipse.emf.common.notify.Notification notification) {
- Object feature = notification.getFeature();
- if (org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getSize_Width().equals(feature)
- || org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getSize_Height().equals(feature)
- || org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getLocation_X().equals(feature)
- || org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
- refreshBounds();
- }
- super.handleNotificationEvent(notification);
- }
-«ENDDEFINE»
-«DEFINE refreshbound FOR gmfgen::GenCompartment»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void refreshBounds() {
- int width = ((Integer) getStructuralFeatureValue(org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer) getStructuralFeatureValue(org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getSize_Height())).intValue();
- org.eclipse.draw2d.geometry.Dimension size = new org.eclipse.draw2d.geometry.Dimension(width, height);
- int x = ((Integer) getStructuralFeatureValue(org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer) getStructuralFeatureValue(org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- org.eclipse.draw2d.geometry.Point loc = new org.eclipse.draw2d.geometry.Point(x, y);
- ((org.eclipse.gef.GraphicalEditPart) getParent()).setLayoutConstraint(
- this,
- getFigure(),
- new org.eclipse.draw2d.geometry.Rectangle(loc, size));
- }
-«ENDDEFINE»
-«DEFINE refreshvisual FOR gmfgen::GenCompartment»
- «EXPAND xpt::Common::generatedMemberComment»
-protected void refreshVisuals() {
- super.refreshVisuals();
- refreshBounds();
- }
-«ENDDEFINE» \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/DiagramEditPart.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/DiagramEditPart.xpt
deleted file mode 100644
index 4715af71459..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/DiagramEditPart.xpt
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2006, 2009 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
- * Alexander Shatalin (Borland) - initial API and implementation
- * modified by Patrick Tessier (CEA LIST)
- */
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«REM»DOCUMENTATION: PapyrusGencode«ENDREM»
-«REM»This template has been modify to allow the drag and drop«ENDREM»
-«REM»and install the mecanism of "filters views..." view for subelements«ENDREM»
-«REM»modification have been only done in the additions«ENDREM»
-
-«AROUND Main FOR gmfgen::GenDiagram-»
-«EXPAND xpt::Common::copyright FOR editorGen-»
-package «editPartsPackageName»;
-
-«EXPAND xpt::Common::generatedClassComment»
-public class «editPartClassName» «EXPAND extendsList» «EXPAND implementsList» {
-
- «EXPAND attributes-»
-
- «EXPAND impl::diagram::editparts::DiagramEditPart::_constructor-»
-
- «EXPAND createDefaultEditPolicies-»
-
- «EXPAND impl::diagram::editparts::DiagramEditPart::createFigure-»
-«IF getAllNodes()->exists(n | n.labels->exists(not oclIsKindOf(gmfgen::GenExternalNodeLabel))) /*iow, NodeLabelEditPart template (GenNodeLabel target) will require this EditPolicy*/-»
- «EXPAND impl::diagram::editparts::NodeLabelEditPart::nodeLabelDragPolicyClass»
-«ENDIF-»
-
-«IF links->exists(labels->notEmpty())-»
- «EXPAND impl::diagram::editparts::LinkLabelEditPart::linkLabelDragPolicyClass»
-«ENDIF-»
-
-
-}
-«ENDAROUND»
-
-
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»patches the super type of the diagram edit part in case the controlled object represents a UML element«ENDREM»
-«DEFINE extendsList FOR gmfgen::GenDiagram»extends «EXPAND impl::diagram::editparts::DiagramEditPart::extendsListContents»«ENDDEFINE»
-«REM»END: PapyrusGenCode«ENDREM»
-
-«DEFINE implementsList FOR gmfgen::GenDiagram»«ENDDEFINE»
-
-«DEFINE attributes FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
- public final static String MODEL_ID = "«editorGen.modelID»"; «EXPAND xpt::Common::nonNLS»
-
- «EXPAND xpt::diagram::editparts::Common::visualIDConstant FOR self-»
-
-
-«ENDDEFINE»
-
-«DEFINE createDefaultEditPolicies FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void createDefaultEditPolicies() {
- «EXPAND impl::diagram::editparts::DiagramEditPart::createDefaultEditPoliciesBody-»
- }
-«ENDDEFINE»
-
-«DEFINE definionName FOR gmfgen::GenDiagram-»
-«ENDDEFINE»
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/ExternalNodeLabelEditPart.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/ExternalNodeLabelEditPart.xpt
deleted file mode 100644
index 8f3250336fb..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/ExternalNodeLabelEditPart.xpt
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2006, 2009 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
- * Alexander Shatalin (Borland) - initial API and implementation
- * modified by Patrick Tessier (CEA LIST, patch from Vincent Lorenzo)
- * Vincent Lorenzo (CEA-LIST) - bug 335987: [General][Enhancement] Show/Hide Connectors Labels https://bugs.eclipse.org/bugs/show_bug.cgi?id=335987
- */
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension'»
-«EXTENSION xpt::diagram::editparts::Utils»
-«REM»DOCUMENTATION: PapyrusGenCode«ENDREM»
-«REM»Overloads only superclasseses and the interfaces that implements this class«ENDREM»
-
-«AROUND extendsList FOR gmfgen::GenExternalNodeLabel-»
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»specify a java super class for external nodes«ENDREM»
-«IF papyrusgmfgenextension::ExtendedGenView.allInstances()->select(v:papyrusgmfgenextension::ExtendedGenView|v.genView->includes(self) and v.superOwnedEditPart<>null)->size()<>0»
- extends «FOREACH papyrusgmfgenextension::ExtendedGenView.allInstances()->select(v:papyrusgmfgenextension::ExtendedGenView|v.genView->includes(self) and v.superOwnedEditPart<>null) AS extendedObject»«EXPAND specifyInheritance FOR extendedObject»«ENDFOREACH-»
-«ELSE»
- «targetDef.proceed()»
-«ENDIF»
-«REM»END: PapyrusGenCode«ENDREM»
-«ENDAROUND»
-
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»definition of the inheritance «ENDREM»
-«DEFINE specifyInheritance FOR papyrusgmfgenextension::ExtendedGenView-»«superOwnedEditPart»«ENDDEFINE»
-«REM»END: BEGIN: PapyrusGenCode«ENDREM»
-
-«REM» we add the interface ILabelRoleProvider «ENDREM»
-«AROUND implementsList FOR gmfgen::GenExternalNodeLabel-»
- «targetDef.proceed()»
- «REM»BEGIN: PapyrusGenCode«ENDREM»
- «IF papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label : papyrusgmfgenextension::LabelVisibilityPreference | label.externalNodeLabels->includes(self))->size()<>0-»
- , org.eclipse.papyrus.uml.diagram.common.editparts.ILabelRoleProvider
- «ENDIF-»
- «REM»END: PapyrusGenCode«ENDREM»
-«ENDAROUND»
-
-«REM» we add the methods provided by the interface «ENDREM»
-«AROUND additions FOR gmfgen::GenExternalNodeLabel-»
- «REM»BEGIN: PapyrusGenCode«ENDREM»
- «IF papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label : papyrusgmfgenextension::LabelVisibilityPreference | label.externalNodeLabels->includes(self))->size()<>0»
- «EXPAND xpt::Common::generatedClassComment»
- public String getLabelRole(){
- return "«papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label : papyrusgmfgenextension::LabelVisibilityPreference | label.externalNodeLabels->includes(self))->asSequence()->first().role»";//$NON-NLS-1$
- }
-
- «EXPAND xpt::Common::generatedClassComment»
- public String getIconPathRole(){
- return "«papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label : papyrusgmfgenextension::LabelVisibilityPreference | label.externalNodeLabels->includes(self))->asSequence()->first().iconPathRole»";//$NON-NLS-1$
- }
- «ENDIF»
- «REM»END: PapyrusGenCode«ENDREM»
-«ENDAROUND» \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/LinkEditPart.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/LinkEditPart.xpt
deleted file mode 100644
index dfc24d8624c..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/LinkEditPart.xpt
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2006, 2009 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
- * Alexander Shatalin (Borland) - initial API and implementation
- */
-
-
-«REM»DOCUMENTATION: PapyrusGencode«ENDREM»
-«REM»Dthis template changes only the define extendsList line 48«ENDREM»
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-
-«DEFINE Main FOR gmfgen::GenLink-»
-«EXPAND xpt::Common::copyright FOR getDiagram().editorGen-»
-package «getDiagram().editPartsPackageName»;
-
-«EXPAND xpt::Common::generatedClassComment»
-public class «editPartClassName» «EXPAND extendsList» «EXPAND implementsList» {
-
- «EXPAND attributes-»
-
- «EXPAND impl::diagram::editparts::LinkEditPart::_constructor-»
-
- «EXPAND createDefaultEditPolicies-»
-
- «EXPAND impl::diagram::editparts::LinkEditPart::addFixedChild-»
-
- «EXPAND impl::diagram::editparts::LinkEditPart::addChildVisual-»
-
- «EXPAND impl::diagram::editparts::LinkEditPart::removeFixedChild-»
-
- «EXPAND impl::diagram::editparts::LinkEditPart::removeChildVisual-»
-
- «EXPAND impl::diagram::editparts::LinkEditPart::createLinkFigure-»
-
- «EXPAND additions-»
-}
-«ENDDEFINE»
-
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»patches the super type of the link edit part in case the controlled object represents a UML element«ENDREM»
-«DEFINE extendsList FOR gmfgen::GenLink»extends «EXPAND impl::diagram::editparts::LinkEditPart::extendsListContents»«ENDDEFINE»
-«REM»END: PapyrusGenCode«ENDREM»
-
-«DEFINE implementsList FOR gmfgen::GenLink-»
- «IF treeBranch»implements org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE attributes FOR gmfgen::GenLink-»
- «EXPAND xpt::diagram::editparts::Common::visualIDConstant-»
-«ENDDEFINE»
-
-«DEFINE createDefaultEditPolicies FOR gmfgen::GenLink-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void createDefaultEditPolicies() {
- «EXPAND impl::diagram::editparts::LinkEditPart::createDefaultEditPoliciesBody-»
- }
-«ENDDEFINE»
-
-«DEFINE additions FOR gmfgen::GenLink-»
-«ENDDEFINE» \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/LinkLabelEditPart.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/LinkLabelEditPart.xpt
deleted file mode 100644
index 8d77c5f4d4a..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/LinkLabelEditPart.xpt
+++ /dev/null
@@ -1,51 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * 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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation bug 335987: [General][Enhancement] Show/Hide Connectors Labels https://bugs.eclipse.org/bugs/show_bug.cgi?id=335987
- *****************************************************************************/
-
-«REM»DOCUMENTATION: PapyrusGencode«ENDREM»
-«REM» this template add the interface ILabelRoleProvider for the label EditPart. This interface is used in by the Manage Label Action «ENDREM»
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension'»
-
-«REM» we add the interface ILabelRoleProvider «ENDREM»
-«AROUND implementsList FOR gmfgen::GenLinkLabel»
- «targetDef.proceed()»
- «REM»BEGIN: PapyrusGenCode«ENDREM»
- «IF papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label : papyrusgmfgenextension::LabelVisibilityPreference | label.linkLabels->includes(self))->size()<>0-»
- , org.eclipse.papyrus.uml.diagram.common.editparts.ILabelRoleProvider
- «ENDIF-»
- «REM»END: PapyrusGenCode«ENDREM»
-«ENDAROUND»
-
-«REM» we add the methods provided by the interface «ENDREM»
-«AROUND additions FOR gmfgen::GenLinkLabel-»
-«targetDef.proceed()»
- «REM»BEGIN: PapyrusGenCode«ENDREM»
- «IF papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label : papyrusgmfgenextension::LabelVisibilityPreference | label.linkLabels->includes(self))->size()<>0»
- «EXPAND xpt::Common::generatedClassComment»
- public String getLabelRole(){
- return "«papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label : papyrusgmfgenextension::LabelVisibilityPreference | label.linkLabels->includes(self))->asSequence()->first().role»";//$NON-NLS-1$
- }
-
- «EXPAND xpt::Common::generatedClassComment»
- public String getIconPathRole(){
- return "«papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label : papyrusgmfgenextension::LabelVisibilityPreference | label.linkLabels->includes(self))->asSequence()->first().iconPathRole»";//$NON-NLS-1$
- }
- «ENDIF»
- «REM»END: PapyrusGenCode«ENDREM»
-«ENDAROUND»
-
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»patches the super type of the link label edit part in case the controlled object represents a UML element«ENDREM»
-«DEFINE extendsList FOR gmfgen::GenLinkLabel»extends org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusLabelEditPart«ENDDEFINE»
-«REM»END: PapyrusGenCode«ENDREM»
-
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/NodeEditPart.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/NodeEditPart.xpt
deleted file mode 100644
index 2c72f699c08..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/NodeEditPart.xpt
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright (c) 2006, 2009 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
- * Alexander Shatalin (Borland) - initial API and implementation
- * modified by Patrick Tessier (CEA LIST)
- */
-
-«REM»DOCUMENTATION: PapyrusGenCode«ENDREM»
-«REM»add call template in order to generate handlenotification in order to refresh figure by taking account event«ENDREM»
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-
-«EXTENSION xpt::diagram::editparts::Utils»
-
-«DEFINE Main FOR gmfgen::GenNode-»
-«EXPAND xpt::Common::copyright FOR getDiagram().editorGen-»
-package «getDiagram().editPartsPackageName»;
-
-«EXPAND xpt::Common::generatedClassComment»
-public class «editPartClassName» «EXPAND extendsList» «EXPAND implementsList» {
-
- «EXPAND attributes-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::_constructor-»
-
- «EXPAND createDefaultEditPolicies-»
-
- «REM»BEGIN: PapyrusGenCode«ENDREM»
- «REM»call tamplate to paste code for refresh figure by taking account event«ENDREM»
- «EXPAND impl::diagram::editparts::NodeEditPart::specificHandleNotificationEvent-»
- «REM»BEGIN: PapyrusGenCode«ENDREM»
-
-
- «EXPAND impl::diagram::editparts::NodeEditPart::createLayoutEditPolicy-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::createNodeShape(self) FOR viewmap-»
-
-«IF hasFixedChildren(self)-»
- «EXPAND impl::diagram::editparts::NodeEditPart::addFixedChild-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::removeFixedChild-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::addChildVisual-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::removeChildVisual-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::getContentPaneFor-»
-«ENDIF-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::addBorderItem-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::createNodePlate-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::getPrimaryDragEditPolicy-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::createFigure-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::setupContentPane-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::getContentPane-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::setForegroundColor-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::setLineWidth-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::setLineStyle-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::getPrimaryChildEditPart-»
-
-«IF getAssistantOutgoingLinks(self)->size() > 0-»
- «EXPAND impl::diagram::editparts::NodeEditPart::getMARelTypesOnSource-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::getMARelTypesOnSourceAndTarget-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::getMATypesForTarget-»
-«ENDIF-»
-
-«IF getAssistantIncomingLinks(self)->size() > 0-»
- «EXPAND impl::diagram::editparts::NodeEditPart::getMARelTypesOnTarget-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::getMATypesForSource-»
-«ENDIF-»
-
-«IF hasChildrenInListCompartments(self)-»
- «EXPAND impl::diagram::editparts::NodeEditPart::getTargetEditPartMethod-»
-«ENDIF-»
-
- «EXPAND handleNotificationEvent-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::innerClassDeclaration FOR viewmap-»
-
- «EXPAND additions-»
-}
-«ENDDEFINE»
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»patches the super type of the node edit part in case the controlled object represents a UML element«ENDREM»
-«DEFINE extendsList FOR gmfgen::GenNode»extends «EXPAND impl::diagram::editparts::NodeEditPart::extendsListContents»«ENDDEFINE»
-«REM»END: PapyrusGenCode«ENDREM»
-«DEFINE implementsList FOR gmfgen::GenNode»«ENDDEFINE»
-
-«DEFINE attributes FOR gmfgen::GenNode-»
- «EXPAND xpt::diagram::editparts::Common::visualIDConstant FOR self-»
-
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.draw2d.IFigure contentPane;
-
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.draw2d.IFigure primaryShape;
-«ENDDEFINE»
-
-«DEFINE createDefaultEditPolicies FOR gmfgen::GenNode-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void createDefaultEditPolicies() {
- «EXPAND impl::diagram::editparts::NodeEditPart::createDefaultEditPoliciesBody-»
- }
-«ENDDEFINE»
-
-«DEFINE handleNotificationEvent FOR gmfgen::GenNode-»
-«ENDDEFINE»
-
-«DEFINE handleNotificationEvent FOR gmfgen::GenTopLevelNode-»
- «REM»This code is important for refreshing shortcut decoration
- on adding corresponding annotation to the View instance.«ENDREM»
- «IF getDiagram().generateShortcutIcon()-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void handleNotificationEvent(org.eclipse.emf.common.notify.Notification event) {
- «EXPAND impl::diagram::editparts::NodeEditPart::handleNotificationEventBody-»
- }
- «ENDIF-»
-«ENDDEFINE»
-
-«DEFINE additions FOR gmfgen::GenNode-»
- «EXPAND impl::diagram::editparts::NodeEditPart::genPreferredValue-»
-«ENDDEFINE» \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/NodeLabelEditPart.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/NodeLabelEditPart.xpt
deleted file mode 100644
index 5e38a2226f9..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/NodeLabelEditPart.xpt
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2006, 2009 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
- * Alexander Shatalin (Borland) - initial API and implementation
- */
-«REM»DOCUMENTATION: PapyrusGenCode«ENDREM»
-«REM»add in the addition codes in order to refresh the labels«ENDREM»
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«EXTENSION xpt::diagram::editparts::Utils»
-
-«DEFINE Main FOR gmfgen::GenNodeLabel-»
-«EXPAND xpt::Common::copyright FOR getDiagram().editorGen-»
-package «getDiagram().editPartsPackageName»;
-
-«EXPAND xpt::Common::generatedClassComment»
-public class «editPartClassName» «EXPAND extendsList» «EXPAND implementsList» {
-
- «EXPAND attributes-»
-
- «EXPAND impl::diagram::editparts::NodeLabelEditPart::_constructor-»
-
- «EXPAND createDefaultEditPolicies-»
-
- «EXPAND impl::diagram::editparts::TextAware::methods(isStoringChildPositions(node), readOnly, elementIcon, viewmap, modelFacet, node, getDiagram())-»
-
- «EXPAND xpt::diagram::editparts::Common::notationalListeners-»
-
- «EXPAND impl::diagram::editparts::NodeLabelEditPart::refreshBounds-»
-
- «EXPAND handleNotificationEvent-»
-
- «EXPAND xpt::diagram::editparts::Common::labelFigure FOR viewmap-»
-
- «EXPAND additions-»
-}
-«ENDDEFINE»
-
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»Definition of the inheritance«ENDREM»
-«DEFINE extendsList FOR gmfgen::GenNodeLabel»extends org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart«ENDDEFINE»
-«REM»END: PapyrusGenCode«ENDREM»
-
-«DEFINE implementsList FOR gmfgen::GenNodeLabel»implements org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart, org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit«ENDDEFINE»
-
-«DEFINE attributes FOR gmfgen::GenNodeLabel-»
- «EXPAND xpt::diagram::editparts::Common::visualIDConstant FOR self-»
-
- «EXPAND impl::diagram::editparts::TextAware::fields FOR self-»
-«ENDDEFINE»
-
-«DEFINE createDefaultEditPolicies FOR gmfgen::GenNodeLabel-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void createDefaultEditPolicies() {
- «EXPAND impl::diagram::editparts::NodeLabelEditPart::createDefaultEditPoliciesBody-»
- }
-«ENDDEFINE»
-
-«DEFINE handleNotificationEvent FOR gmfgen::GenNodeLabel-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void handleNotificationEvent(org.eclipse.emf.common.notify.Notification event) {
- refreshLabel();
- «EXPAND impl::diagram::editparts::NodeLabelEditPart::handleNotificationEventBody-»
- }
-«ENDDEFINE»
-
-«DEFINE additions FOR gmfgen::GenNodeLabel-»
-«REM»Code to refresh icon«ENDREM»
-
-«EXPAND xpt::Common::generatedMemberComment»
-private static final String ADD_PARENT_MODEL = "AddParentModel";
-
-
-«EXPAND xpt::Common::generatedMemberComment»
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((org.eclipse.gmf.runtime.notation.View) getParent().getModel())); //$NON-NLS-1$
-
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
-
- «EXPAND xpt::Common::generatedMemberComment»
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-«REM»END: PapyrusGenCode«ENDREM»
-«ENDDEFINE»
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/ChildNodeLabelEditPart.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/ChildNodeLabelEditPart.xpt
deleted file mode 100644
index 6ab7970b0fe..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/ChildNodeLabelEditPart.xpt
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2009 Atos Origin
- *
- * 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:
- * Thibault Landre (Atos Origin) - initial API and implementation
- */
-
-«REM»DOCUMENTATION: PapyrusGenCode«ENDREM»
-«REM»Overload only the handle notification«ENDREM»
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-
-
-«AROUND handleNotificationEventBody FOR gmfgen::GenChildLabelNode-»
- Object feature = event.getFeature();
- «EXPAND xpt::diagram::editparts::Common::handleText FOR self-»
- «IF labelElementIcon-»
- if(event.getNewValue() instanceof org.eclipse.emf.ecore.EAnnotation && org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((org.eclipse.emf.ecore.EAnnotation)event.getNewValue()).getSource())){
- refreshLabel();
- }
- «ENDIF-»
- if (org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getFeature_IsStatic().equals(feature)) {
- refreshUnderline();
- }
- super.handleNotificationEvent(event);
-«ENDAROUND» \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/CompartmentEditPart.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/CompartmentEditPart.xpt
deleted file mode 100644
index 7695b0b91c7..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/CompartmentEditPart.xpt
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2006, 2009 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
- * Alexander Shatalin (Borland) - initial API and implementation
- */
-
-
-«REM»DOCUMENTATION: PapyrusGenCode«ENDREM»
-«REM»Overload only the creation of editPolicies in order to add the paste edit policy«ENDREM»
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«EXTENSION xpt::diagram::editparts::Utils»
-
-
-
-«AROUND createDefaultEditPoliciesBody FOR gmfgen::GenCompartment-»
- super.createDefaultEditPolicies();
- «IF canCollapse-»
- installEditPolicy(org.eclipse.gef.EditPolicy.PRIMARY_DRAG_ROLE, new org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy());
- «ENDIF-»
- «EXPAND xpt::diagram::editparts::Common::installSemanticEditPolicy-»
- «IF childNodes->size() > 0-»
- installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CREATION_ROLE, new org.eclipse.papyrus.uml.diagram.common.editpolicies.PapyrusCreationEditPolicy());
- installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.DRAG_DROP_ROLE, new org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy());
- installEditPolicy(org.eclipse.papyrus.uml.diagram.common.editpolicies.DuplicatePasteEditPolicy.PASTE_ROLE, new org.eclipse.papyrus.uml.diagram.common.editpolicies.DuplicatePasteEditPolicy());
- «ENDIF-»
- «EXPAND xpt::diagram::editparts::Common::installCanonicalEditPolicy-»
- «EXPAND xpt::diagram::editparts::Common::behaviour-»
-«ENDAROUND»
-
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/DiagramEditPart.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/DiagramEditPart.xpt
deleted file mode 100644
index df7c608b754..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/DiagramEditPart.xpt
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright (c) 2006, 2010 Borland Software Corporation and others
- *
- * 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
- * Alexander Shatalin (Borland) - initial API and implementation
- * modified by Patrick Tessier (CEA LIST)
- */
-
-
-«REM»DOCUMENTATION: PapyrusGencode«ENDREM»
-«REM»This template has been modify to allow the drag and drop«ENDREM»
-
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/emf/2002/Ecore'»
-«EXTENSION xpt::diagram::editparts::Utils»
-
-
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»computes super type of the link edit part in case the edit part manages a representation of a UML element«ENDREM»
-«DEFINE extendsListContents FOR gmfgen::GenDiagram-»
-org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusDiagramEditPart
-«ENDDEFINE»
-«REM»END: BEGIN: PapyrusGenCode«ENDREM»
-
-
-«DEFINE _constructor FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
- public «editPartClassName»(org.eclipse.gmf.runtime.notation.View view) {
- super(view);
- }
-«ENDDEFINE»
-
-«DEFINE createDefaultEditPoliciesBody FOR gmfgen::GenDiagram-»
- super.createDefaultEditPolicies();
- installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CREATION_ROLE, new org.eclipse.papyrus.uml.diagram.common.editpolicies.PapyrusCreationEditPolicy());
- installEditPolicy(org.eclipse.papyrus.uml.diagram.common.editpolicies.DuplicatePasteEditPolicy.PASTE_ROLE, new org.eclipse.papyrus.uml.diagram.common.editpolicies.DuplicatePasteEditPolicy());
-
- «EXPAND xpt::diagram::editparts::Common::installSemanticEditPolicy-»
- «EXPAND xpt::diagram::editparts::Common::installCanonicalEditPolicy-»
-
- «IF generateCreateShortcutAction() and null = editorGen.application-»
- installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.DRAG_DROP_ROLE, new org.eclipse.gmf.runtime.diagram.ui.editpolicies.DiagramDragDropEditPolicy() {
- public org.eclipse.gef.commands.Command getDropObjectsCommand(org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest dropRequest) {
- «EXPAND CodeStyle::newGenericInstance('viewDescriptors', 'java.util.ArrayList', 'org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor')»();
- for («EXPAND CodeStyle::G('java.util.Iterator', '?')» it = dropRequest.getObjects().iterator(); it.hasNext();) {
- Object nextObject = it.next();
- if (false == nextObject instanceof org.eclipse.emf.ecore.EObject) {
- continue;
- }
- viewDescriptors.add(new org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor(new org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter((org.eclipse.emf.ecore.EObject) nextObject), org.eclipse.gmf.runtime.notation.Node.class, null, getDiagramPreferencesHint()));
- }
- return createShortcutsCommand(dropRequest, viewDescriptors);
- }
-
- private org.eclipse.gef.commands.Command createShortcutsCommand(org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest dropRequest, «EXPAND CodeStyle::G('java.util.List', 'org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor')» viewDescriptors) {
- org.eclipse.gef.commands.Command command = createViewsAndArrangeCommand(dropRequest, viewDescriptors);
- if (command != null) {
- return command.chain(new org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy(new «getCreateShortcutDecorationsCommandQualifiedClassName()»(getEditingDomain(), (org.eclipse.gmf.runtime.notation.View) getModel(), viewDescriptors)));
- }
- return null;
- }
- });
- «ENDIF-»
- «IF shouldGenerateDiagramViewmap(self)-»
- // diagram figure does layout; need to install child editpolicy to show selection feedback
- installEditPolicy(org.eclipse.gef.EditPolicy.LAYOUT_ROLE, new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
- protected org.eclipse.gef.EditPolicy createChildEditPolicy(org.eclipse.gef.EditPart child) {
- final org.eclipse.gef.editpolicies.NonResizableEditPolicy p = new org.eclipse.gef.editpolicies.NonResizableEditPolicy();
- p.setDragAllowed(false);
- return p;
- }
- protected org.eclipse.gef.commands.Command getMoveChildrenCommand(org.eclipse.gef.Request request) {
- return null;
- }
- protected org.eclipse.gef.commands.Command getCreateCommand(org.eclipse.gef.requests.CreateRequest request) {
- return null;
- }
- });
- «ENDIF-»
- «EXPAND xpt::diagram::editparts::Common::behaviour FOR self-»
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE);
-«ENDDEFINE»
-
-«DEFINE createFigure FOR gmfgen::GenDiagram-»
- «IF shouldGenerateDiagramViewmap(self)-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.draw2d.IFigure createFigure() {
- org.eclipse.draw2d.FreeformLayer l = new org.eclipse.draw2d.FreeformLayer();
- l.setBorder(new org.eclipse.draw2d.MarginBorder(50));
- «EXPAND initLayout('lm') FOR viewmap.layoutType-»
- l.setLayoutManager(lm);
- return l;
- }
- «ENDIF»
-«ENDDEFINE»
-
-«DEFINE initLayout(varName : String) FOR gmfgen::ViewmapLayoutType-»
- «IF self = gmfgen::ViewmapLayoutType::TOOLBAR_LAYOUT-»
- org.eclipse.draw2d.ToolbarLayout «varName» = new org.eclipse.draw2d.ToolbarLayout();
- «varName».setSpacing(10);
- «ELSEIF self = gmfgen::ViewmapLayoutType::FLOW_LAYOUT-»
- org.eclipse.draw2d.FlowLayout «varName» = new org.eclipse.draw2d.FlowLayout();
- «varName».setMajorSpacing(10);
- «varName».setMinorSpacing(10);
- «ELSE-»
- org.eclipse.draw2d.LayoutManager «varName» = null; /*FIXME - unknown layout type*/
- «ENDIF-»
-«ENDDEFINE»
-
-
-
-
-«DEFINE featureForMetaclass FOR gmfgen::GenNode-»
- if («EXPAND MetaModel::MetaClass FOR modelFacet.metaClass».equals(class1)) {
- return «EXPAND MetaModel::MetaFeature FOR modelFacet.containmentMetaFeature»;
- }
-«ENDDEFINE»
-
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/EditPartsUtils.qvto b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/EditPartsUtils.qvto
deleted file mode 100644
index 5a61f9bdca7..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/EditPartsUtils.qvto
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2010 CEA LIST
- *
- * 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:
- * Yann Tanguy (CEA LIST) - initial API and implementation
- *
- */
-
-modeltype gmfgen uses "http://www.eclipse.org/gmf/2009/GenModel";
-modeltype papyrusgmfgenextension uses "http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension";
-
-library EditPartsUtils;
-
-helper gmfgen::GenExternalNodeLabel::hasSpecificLocator() : Boolean {
- return (papyrusgmfgenextension::SpecificLocatorExternalLabel.allInstances()
- ->select(loc : papyrusgmfgenextension::SpecificLocatorExternalLabel
- | loc.genExternalNodeLabel->includes(self))
- ->size() <> 0);
-}
-
-helper gmfgen::GenExternalNodeLabel::getSpecificLocator() : String {
- if self.hasSpecificLocator() then {
- return papyrusgmfgenextension::SpecificLocatorExternalLabel.allInstances()
- ->select(loc : papyrusgmfgenextension::SpecificLocatorExternalLabel
- | loc.genExternalNodeLabel->includes(self))
- ->asSequence()->first().classpath
- } endif;
-
- return null;
-}
-
-helper gmfgen::GenNode::getExternalLabelsWithoutSpecificLocator() : Sequence(gmfgen::GenExternalNodeLabel) {
- return (self.labels)[gmfgen::GenExternalNodeLabel]
- ->select(l : gmfgen::GenExternalNodeLabel
- | not l.hasSpecificLocator())
- ->asSequence();
-}
-
-helper gmfgen::GenNode::getExternalLabelsWithSpecificLocator() : Sequence(gmfgen::GenExternalNodeLabel) {
- return (self.labels)[gmfgen::GenExternalNodeLabel]
- ->select(l : gmfgen::GenExternalNodeLabel
- | l.hasSpecificLocator())
- ->asSequence();
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/LinkEditPart.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/LinkEditPart.xpt
deleted file mode 100644
index a0595abc8b2..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/LinkEditPart.xpt
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (c) 2006, 2009 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
- * Alexander Shatalin (Borland) - initial API and implementation
- * Remi Schnekenburger (CEA LIST) - modification for Papyrus MDT
- */
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension'»
-
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»computes super type of the link edit part in case the edit part manages a representation of a UML element«ENDREM»
-«DEFINE extendsListContents FOR gmfgen::GenLink-»
-
-«IF papyrusgmfgenextension::ExtendedGenView.allInstances()->select(v:papyrusgmfgenextension::ExtendedGenView|v.genView->includes(self) and v.superOwnedEditPart<>null)->size()<>0»
- «FOREACH papyrusgmfgenextension::ExtendedGenView.allInstances()->select(v:papyrusgmfgenextension::ExtendedGenView|v.genView->includes(self) and v.superOwnedEditPart<>null) AS extendedObject»«EXPAND specifyInheritance FOR extendedObject»«ENDFOREACH-»
-«ELSE»org.eclipse.papyrus.infra.gmfdiag.common.editpart.ConnectionEditPart
-«ENDIF»
-«ENDDEFINE»
-«REM»END: BEGIN: PapyrusGenCode«ENDREM»
-
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»definition of the inheritance «ENDREM»
-«DEFINE specifyInheritance FOR papyrusgmfgenextension::ExtendedGenView-»«superOwnedEditPart»«ENDDEFINE»
-«REM»END: BEGIN: PapyrusGenCode«ENDREM»
-
-«DEFINE _constructor FOR gmfgen::GenLink-»
- «EXPAND xpt::Common::generatedMemberComment»
- public «editPartClassName»(org.eclipse.gmf.runtime.notation.View view) {
- super(view);
- }
-«ENDDEFINE»
-
-«DEFINE createDefaultEditPoliciesBody FOR gmfgen::GenLink-»
- super.createDefaultEditPolicies();
- «IF null = modelFacet-»
- installEditPolicy(org.eclipse.gef.EditPolicy.COMPONENT_ROLE, new org.eclipse.gmf.runtime.diagram.ui.editpolicies.ViewComponentEditPolicy());
- «ENDIF-»
- «EXPAND xpt::diagram::editparts::Common::installSemanticEditPolicy-»
- «EXPAND xpt::diagram::editparts::Common::behaviour FOR self-»
-«ENDDEFINE»
-
-«DEFINE addFixedChild FOR gmfgen::GenLink-»
- «IF labels->size() > 0-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected boolean addFixedChild(org.eclipse.gef.EditPart childEditPart) {
- «FOREACH labels->asSequence() AS label-»
- «EXPAND addLabel(label) FOR label.viewmap-»
- «ENDFOREACH-»
- return false;
- }
- «ENDIF»
-«ENDDEFINE»
-
-«DEFINE addLabel(label : gmfgen::GenLinkLabel) FOR gmfgen::Viewmap-»
-«ENDDEFINE»
-
-«DEFINE addLabel(label : gmfgen::GenLinkLabel) FOR gmfgen::ParentAssignedViewmap-»
- if (childEditPart instanceof «label.getEditPartQualifiedClassName()») {
- ((«label.getEditPartQualifiedClassName()») childEditPart).«EXPAND impl::diagram::editparts::TextAware::labelSetterName»(
- getPrimaryShape().«getterName»());
- return true;
- }
-«ENDDEFINE»
-
-«DEFINE removeFixedChild FOR gmfgen::GenLink-»
- «IF labels->size() > 0-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected boolean removeFixedChild(org.eclipse.gef.EditPart childEditPart) {
- «FOREACH labels->asSequence() AS label-»
- «EXPAND removeLabel(label) FOR label.viewmap-»
- «ENDFOREACH-»
- return false;
- }
- «ENDIF»
-«ENDDEFINE»
-
-«DEFINE removeLabel(label : gmfgen::GenLinkLabel) FOR gmfgen::Viewmap-»
-«ENDDEFINE»
-
-«DEFINE removeLabel(label : gmfgen::GenLinkLabel) FOR gmfgen::ParentAssignedViewmap-»
- if (childEditPart instanceof «label.getEditPartQualifiedClassName()») {
- return true;
- }
-«ENDDEFINE»
-
-«DEFINE addChildVisual FOR gmfgen::GenLink-»
- «IF labels->size() > 0-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void addChildVisual(org.eclipse.gef.EditPart childEditPart, int index) {
- if (addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
- «ENDIF»
-«ENDDEFINE»
-
-«DEFINE removeChildVisual FOR gmfgen::GenLink-»
- «IF labels->size() > 0-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void removeChildVisual(org.eclipse.gef.EditPart childEditPart) {
- if (removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
- «ENDIF»
-«ENDDEFINE»
-
-«DEFINE createLinkFigure FOR gmfgen::GenLink-»
- «EXPAND xpt::Common::generatedMemberComment(
- 'Creates figure for this edit part.\n' +
- '\n' +
- 'Body of this method does not depend on settings in generation model\n' +
- 'so you may safely remove <i>generated</i> tag and modify it.\n'
- )»
- «EXPAND createLinkFigure(self) FOR viewmap-»
-«ENDDEFINE»
-
-«DEFINE createLinkFigure(link : gmfgen::GenLink) FOR gmfgen::Viewmap-»
- «ERROR 'Unknown viewmap: ' + self.repr()-»
-«ENDDEFINE»
-
-«DEFINE createLinkFigure(link : gmfgen::GenLink) FOR gmfgen::FigureViewmap-»
- «LET (if figureQualifiedClassName = null then 'org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx' else figureQualifiedClassName endif) AS fqn-»
- protected org.eclipse.draw2d.Connection createConnectionFigure() {
- return new «fqn»();
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- public «fqn» getPrimaryShape() {
- return («fqn») getFigure();
- }
- «ENDLET-»
-«ENDDEFINE»
-
-«DEFINE createLinkFigure(link : gmfgen::GenLink) FOR gmfgen::SnippetViewmap»
- protected org.eclipse.draw2d.Connection createConnectionFigure() {
- return «body»;
- }
-«ENDDEFINE»
-
-«DEFINE createLinkFigure(link : gmfgen::GenLink) FOR gmfgen::InnerClassViewmap»
- protected org.eclipse.draw2d.Connection createConnectionFigure() {
- return new «className»();
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- public «className» getPrimaryShape() {
- return («className») getFigure();
- }
-
- «classBody»
-«ENDDEFINE» \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/LinkLabelEditPart.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/LinkLabelEditPart.xpt
deleted file mode 100644
index 1a4627694a3..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/LinkLabelEditPart.xpt
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2009 Atos Origin
- *
- * 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:
- * Thibault Landre (Atos Origin) - initial API and implementation
- */
-
-«REM»DOCUMENTATION: PapyrusGencode«ENDREM»
-«REM»Overlaod only the method handlenotificationEventBody«ENDREM»
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«EXTENSION xpt::diagram::ViewmapAttributesUtils»
-
-
-«AROUND handleNotificationEventBody FOR gmfgen::GenLinkLabel-»
- Object feature = event.getFeature();
- «EXPAND xpt::diagram::editparts::Common::handleText FOR self-»
-
- «REM»START Papyrus Code«ENDREM»
- «IF elementIcon-»
- if(event.getNewValue() instanceof org.eclipse.emf.ecore.EAnnotation && org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((org.eclipse.emf.ecore.EAnnotation)event.getNewValue()).getSource())){
- refreshLabel();
- }
- «ENDIF-»
- «REM»End Papyrus Code«ENDREM»
-
- super.handleNotificationEvent(event);
-«ENDAROUND» \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/NodeEditPart.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/NodeEditPart.xpt
deleted file mode 100644
index 370d17c5bf0..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/NodeEditPart.xpt
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * Copyright (c) 2009 Atos Origin
- *
- * 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:
- * Patrick Tessier (CEA) - initial API and implementation
- * Thibault Landre (Atos Origin) - initial API and implementation
- * Vincent Lorenzo (CEA-LIST) - Bug 335987 [General][Enhancement] Show/Hide Connectors Labels and External Nodes Labels
- */
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension'»
-«EXTENSION xpt::diagram::ViewmapAttributesUtils»
-«EXTENSION xpt::diagram::editparts::Utils»
-«EXTENSION xpt::diagram::Utils»
-«EXTENSION xpt::EMFUtils»
-«EXTENSION xpt::preferences::PrefsConstant»
-«EXTENSION aspects::impl::diagram::editparts::EditPartsUtils»
-
-«REM»-----«ENDREM»
-«REM» GMF «ENDREM»
-«REM»-----«ENDREM»
-
-
-
-«DEFINE extendsListContents FOR gmfgen::GenNode-»
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»Add own extension«ENDREM»
-«IF papyrusgmfgenextension::ExtendedGenView.allInstances()->select(v:papyrusgmfgenextension::ExtendedGenView|v.genView->includes(self) and v.superOwnedEditPart<>null)->size()<>0»
- «FOREACH papyrusgmfgenextension::ExtendedGenView.allInstances()->select(v:papyrusgmfgenextension::ExtendedGenView|v.genView->includes(self) and v.superOwnedEditPart<>null) AS extendedObject»«EXPAND specifyInheritance FOR extendedObject»«ENDFOREACH-»
-«REM»END: BEGIN: PapyrusGenCode«ENDREM»
-«ELSE-»
- «IF hasBorderItems(self)»org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart«ELSE»org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart«ENDIF-»
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE extendsListContents FOR gmfgen::GenChildSideAffixedNode-»
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»Add own eextension«ENDREM»
-«IF papyrusgmfgenextension::ExtendedGenView.allInstances()->select(v:papyrusgmfgenextension::ExtendedGenView|v.genView->includes(self) and v.superOwnedEditPart<>null)->size()<>0»
- «FOREACH papyrusgmfgenextension::ExtendedGenView.allInstances()->select(v:papyrusgmfgenextension::ExtendedGenView|v.genView->includes(self) and v.superOwnedEditPart<>null) AS extendedObject»«EXPAND specifyInheritance FOR extendedObject»«ENDFOREACH-»
-«REM»END: BEGIN: PapyrusGenCode«ENDREM»
-«ELSE-»
- «IF hasBorderItems(self)»org.eclipse.gmf.runtime.diagram.ui.editparts.BorderedBorderItemEditPart«ELSE»org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderItemEditPart«ENDIF-»
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE borderItemSelectionEP FOR gmfgen::GenNode-»
-new org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy() {
-
- protected java.util.List createSelectionHandles() {
- org.eclipse.gef.handles.MoveHandle mh = new org.eclipse.gef.handles.MoveHandle((org.eclipse.gef.GraphicalEditPart) getHost());
- mh.setBorder(null);
- return java.util.Collections.singletonList(mh);
- }
-}
-«ENDDEFINE»
-
-
-«AROUND addFixedChild FOR gmfgen::GenNode-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected boolean addFixedChild(org.eclipse.gef.EditPart childEditPart) {
-«FOREACH getInnerFixedLabels(self) AS label»«LET label.viewmap.oclAsType(gmfgen::ParentAssignedViewmap) AS childViewmap-»
- if (childEditPart instanceof «label.getEditPartQualifiedClassName()») {
- ((«label.getEditPartQualifiedClassName()») childEditPart).«EXPAND impl::diagram::editparts::TextAware::labelSetterName FOR childViewmap»(getPrimaryShape().«childViewmap.getterName»());
- return true;
- }
-«ENDLET»«ENDFOREACH-»
-
-«FOREACH getPinnedCompartments(self) AS compartment»«LET compartment.viewmap.oclAsType(gmfgen::ParentAssignedViewmap) AS childViewmap-»
-
- if (childEditPart instanceof «compartment.getEditPartQualifiedClassName()») {
- org.eclipse.draw2d.IFigure pane = getPrimaryShape().«childViewmap.getterName»();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((«compartment.getEditPartQualifiedClassName()») childEditPart).getFigure());
- return true;
- }
-«ENDLET»«ENDFOREACH-»
-
-«FOREACH getSideAffixedChildren(self) AS child-»
- «REM»BEGIN PapyrusGencode«ENDREM»
- «REM»adding IF else end in order to take in account the case where a specific locator is added«ENDREM»
- «IF papyrusgmfgenextension::SpecificLocator.allInstances()->select(v:papyrusgmfgenextension::SpecificLocator | v.genChildSideAffixedNode->includes(child))->size()<>0»
- «FOREACH papyrusgmfgenextension::SpecificLocator.allInstances()->select(v:papyrusgmfgenextension::SpecificLocator | v.genChildSideAffixedNode->includes(child)) AS extendedObject»
- «EXPAND genSpecificLocator(child) FOR extendedObject-»
- «ENDFOREACH-»
-
- «ELSE»
- «REM»END PapyrusGencode«ENDREM»
- if (childEditPart instanceof «child.getEditPartQualifiedClassName()») {
- org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator locator = new org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator(getMainFigure(), org.eclipse.draw2d.PositionConstants.«child.preferredSideName»);
- getBorderedFigure().getBorderItemContainer().add(((«child.getEditPartQualifiedClassName()») childEditPart).getFigure(), locator);
- return true;
- }
- «REM»BEGIN PapyrusGencode«ENDREM»
- «ENDIF»
- «REM»END PapyrusGencode«ENDREM»
-«ENDFOREACH-»
- return false;
- }
-
-«ENDAROUND»
-
-
-«AROUND createNodePlate FOR gmfgen::GenNode-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure createNodePlate() {
- String prefElementId="«elementType.displayName»";
- org.eclipse.jface.preference.IPreferenceStore store =«getDiagram().editorGen.plugin.getActivatorQualifiedClassName()».getInstance().getPreferenceStore();
- String preferenceConstantWitdh=org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.WIDTH);
- String preferenceConstantHeight=org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.HEIGHT);
- org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure result = new org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- «EXPAND setupNodePlate-»
- return result;
- }
-«ENDAROUND»
-«AROUND borderItemSelectionEditPolicy FOR gmfgen::GenNode-»
-«IF hasBorderItems(self)-»
-org.eclipse.gmf.runtime.notation.View childView = (org.eclipse.gmf.runtime.notation.View) child.getModel();
-switch («EXPAND xpt::editor::VisualIDRegistry::getVisualIDMethodCall FOR getDiagram()»(childView)) {
-«IF getExternalLabels(self)->size() > 0-»
-«FOREACH getExternalLabels(self) AS nextLabel-»
-«EXPAND xpt::Common::caseVisualID FOR nextLabel-»
-«ENDFOREACH-»
- return «EXPAND borderItemSelectionEP»;
-«ENDIF-»
-«IF getSideAffixedChildren(self)->size() > 0-»
-«FOREACH getSideAffixedChildren(self) AS nextBorderItem-»
-«EXPAND xpt::Common::caseVisualID FOR nextBorderItem-»
-«ENDFOREACH-»
- «REM»BEGIN PapyrusGenCode«ENDREM»
- «REM»The puRprose is to add replace GMF edit prolicy by an new editPolicy that allows to resize BorderItem«ENDREM»
- return new org.eclipse.papyrus.uml.diagram.common.editpolicies.BorderItemResizableEditPolicy();
- «REM»END PapyrusGenCode«ENDREM»
-«ENDIF-»
-}
-«ENDIF-»
-«ENDAROUND»
-
-«REM»---------«ENDREM»
-«REM» PAPYRUS «ENDREM»
-«REM»---------«ENDREM»
-
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»definition of the inheritance «ENDREM»
-«DEFINE specifyInheritance FOR papyrusgmfgenextension::ExtendedGenView-»«superOwnedEditPart»«ENDDEFINE»
-«REM»END: BEGIN: PapyrusGenCode«ENDREM»
-
-
-«REM»BEGIN PapyrusGencode «ENDREM»
-«REM» Adding line of template to manange code thanks to a spcific locator«ENDREM»
-«DEFINE genSpecificLocator(gmfgen::GenChildSideAffixedNode child) FOR gmfgen::GenCommonBase-»
-«ENDDEFINE»
-
-«DEFINE genSpecificLocator(gmfgen::GenChildSideAffixedNode child) FOR gmfgen::ToolEntry-»
-«ENDDEFINE»
-
-«DEFINE genSpecificLocator(gmfgen::GenChildSideAffixedNode child) FOR gmfgen::GenNavigatorChildReference-»
-«ENDDEFINE»
-
-«DEFINE genSpecificLocator(gmfgen::GenChildSideAffixedNode child) FOR papyrusgmfgenextension::SpecificLocator-»
-//Papyrus Gencode :«self.comment»
- if (childEditPart instanceof «child.getEditPartQualifiedClassName()») {
- org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator locator = new «self.classpath»(getMainFigure(), org.eclipse.draw2d.PositionConstants.«child.preferredSideName»);
- getBorderedFigure().getBorderItemContainer().add(((«child.getEditPartQualifiedClassName()») childEditPart).getFigure(), locator);
- return true;
- }
-
-«ENDDEFINE»
-«REM»END PapyrusGencode «ENDREM»
-
-«REM»BEGIN PapyrusGencode «ENDREM»
-«REM» Overwrite an existing method to set the preference value in the editpart«ENDREM»
-«DEFINE genPreferredValue FOR gmfgen::GenNode-»
-
- «EXPAND xpt::Common::generatedMemberComment»
- @Override
- public Object getPreferredValue(org.eclipse.emf.ecore.EStructuralFeature feature) {
- org.eclipse.jface.preference.IPreferenceStore preferenceStore = (org.eclipse.jface.preference.IPreferenceStore) getDiagramPreferencesHint()
- .getPreferenceStore();
- Object result = null;
-
- if(feature == org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE
- .getFontStyle_FontColor() || feature == org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE
- .getFillStyle_FillColor()){
- String prefColor = null;
- if (feature == org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
- prefColor = org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant("«elementType.displayName»", org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE);
- } else if (feature == org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE
- .getFontStyle_FontColor()) {
- prefColor = org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant("«elementType.displayName»", org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FONT);
- } else if (feature == org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE
- .getFillStyle_FillColor()) {
- prefColor = org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant("«elementType.displayName»", org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL);
- }
- result = org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities
- .RGBToInteger(org.eclipse.jface.preference.PreferenceConverter
- .getColor(
- (org.eclipse.jface.preference.IPreferenceStore) preferenceStore, prefColor));
- } else if (feature == org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE
- .getFillStyle_Transparency() || feature == org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE
- .getFillStyle_Gradient()) {
- String prefGradient = org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant("«elementType.displayName»", org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT);
- org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
- preferenceStore.getString(prefGradient));
- if(feature == org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE
- .getFillStyle_Transparency()){
- result = new Integer(gradientPreferenceConverter
- .getTransparency());
- } else if (feature == org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE
- .getFillStyle_Gradient()){
- result = gradientPreferenceConverter.getGradientData();
- }
- }
-
- if(result == null){
- result = getStructuralFeatureValue(feature);
- }
- return result;
- }
-«ENDDEFINE»
-«REM»END PapyrusGencode «ENDREM»
-
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»CreateGenerator to refresh figure by taking account of event of UML element or graphical element «ENDREM»
-«DEFINE specificHandleNotificationEvent FOR gmfgen::GenNode-»
- «IF papyrusgmfgenextension::ExtendedGenView.allInstances()->select(v:papyrusgmfgenextension::ExtendedGenView|v.genView->includes(self))->size()<>0»
-/**
-*Papyrus codeGen
-*@generated
-**/
-protected void handleNotificationEvent(org.eclipse.emf.common.notify.Notification event) {
-«IF self.labels->exists(oclIsKindOf(gmfgen::GenExternalNodeLabel))-»
- /*
- * when a node have external node labels, the methods refreshChildren() remove the EditPart corresponding to the Label from the EditPart
- * Registry. After that, we can't reset the visibility to true (using the Show/Hide Label Action)!
- */
- if(org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getView_Visible().equals(event.getFeature())) {
- Object notifier = event.getNotifier();
- java.util.List<?> modelChildren = ((org.eclipse.gmf.runtime.notation.View)getModel()).getChildren();
- if(!(notifier instanceof org.eclipse.gmf.runtime.notation.Edge)) {
- if(modelChildren.contains(event.getNotifier())) {
- return;
- }
- }
- }
- «ENDIF-»
- super.handleNotificationEvent(event);
- «FOREACH papyrusgmfgenextension::ExtendedGenView.allInstances()->select(v:papyrusgmfgenextension::ExtendedGenView|v.genView->includes(self)) AS extendedObject»
- «EXPAND specificHandleNotificationEventBody FOR extendedObject.propRefreshHook-»
- «ENDFOREACH-»
- }
- «ENDIF»
-
-«ENDDEFINE»
-
-«DEFINE specificHandleNotificationEventBody FOR papyrusgmfgenextension::PropertyRefreshHook-»
-//«self.comment»
-if (resolveSemanticElement() != null) {
-if(«self.triggeringCondition»){
- «self.action»;
- refreshVisuals();
-}
-}
-«ENDDEFINE»
-«REM»END: PapyrusGenCode«ENDREM»
-
-«DEFINE addBorderItem FOR gmfgen::GenNode-»
- «IF getExternalLabels(self)->size() > 0-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void addBorderItem(org.eclipse.draw2d.IFigure borderItemContainer, org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart borderItemEditPart) {
- «IF self.getExternalLabelsWithoutSpecificLocator()->size() > 0-»
- if («FOREACH self.getExternalLabelsWithoutSpecificLocator() AS label SEPARATOR ' || '»borderItemEditPart instanceof «label.getEditPartQualifiedClassName()»«ENDFOREACH») {
- org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator locator = new org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator(getMainFigure(), org.eclipse.draw2d.PositionConstants.SOUTH);
- locator.setBorderItemOffset(new org.eclipse.draw2d.geometry.Dimension(-20, -20));
- borderItemContainer.add(borderItemEditPart.getFigure(), locator);
- } else
- «ENDIF-»
- «FOREACH self.getExternalLabelsWithSpecificLocator() AS label-»
- if (borderItemEditPart instanceof «label.getEditPartQualifiedClassName()») {
- org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator locator = new «label.getSpecificLocator()»(getMainFigure());
- borderItemContainer.add(borderItemEditPart.getFigure(), locator);
- } else
- «ENDFOREACH-»
- {
- super.addBorderItem(borderItemContainer, borderItemEditPart);
- }
- }
- «ENDIF-»
-«ENDDEFINE»
-
-«DEFINE setupNodePlate FOR gmfgen::GenNode»«ENDDEFINE»
-
-«DEFINE setupNodePlate FOR gmfgen::GenChildSideAffixedNode»
- //FIXME: workaround for #154536
- result.getBounds().setSize(result.getPreferredSize());
-«ENDDEFINE»
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/NodeLabelEditPart.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/NodeLabelEditPart.xpt
deleted file mode 100644
index ecbe9b8301d..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/NodeLabelEditPart.xpt
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2009 Atos Origin
- *
- * 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:
- * Thibault Landre (Atos Origin) - initial API and implementation
- */
-
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«EXTENSION xpt::diagram::editparts::Utils»
-
-
-«AROUND handleNotificationEventBody FOR gmfgen::GenNodeLabel-»
- Object feature = event.getFeature();
- «IF isStoringChildPositions(node)-»
- «EXPAND xpt::diagram::editparts::Common::handleBounds FOR self-»
- «ENDIF-»
- «EXPAND xpt::diagram::editparts::Common::handleText FOR self-»
- «REM»START Papyrus Code«ENDREM»
- «IF elementIcon-»
- if(event.getNewValue() instanceof org.eclipse.emf.ecore.EAnnotation && org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((org.eclipse.emf.ecore.EAnnotation)event.getNewValue()).getSource())){
- refreshLabel();
- }
- «ENDIF-»
- «REM»End Papyrus Code«ENDREM»
- super.handleNotificationEvent(event);
-«ENDAROUND» \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/TextAware.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/TextAware.xpt
deleted file mode 100644
index 4a4c8713f9d..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/TextAware.xpt
+++ /dev/null
@@ -1,793 +0,0 @@
-/*
- * Copyright (c) 2006, 2009 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
- * Alexander Shatalin (Borland) - initial API and implementation
- */
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«EXTENSION xpt::diagram::ViewmapAttributesUtils»
-
-«REM»DOCUMENTATION: PapyrusGencode«ENDREM»
-«REM»This template has been modified to take in account the possibility to have extended direct editors«ENDREM»
-
-«DEFINE fields FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- private org.eclipse.gef.tools.DirectEditManager manager;
-
- «EXPAND xpt::Common::generatedMemberComment»
- private org.eclipse.gmf.runtime.common.ui.services.parser.IParser parser;
-
- «EXPAND xpt::Common::generatedMemberComment»
- private «EXPAND CodeStyle::G('java.util.List', '?')» parserElements;
-
- «EXPAND xpt::Common::generatedMemberComment»
- private String defaultText;
-
- «REM»BEGIN: PapyrusGenCode«ENDREM»
- «REM»Add attributes to manage extended editors«ENDREM»
- «EXPAND xpt::Common::generatedMemberComment('direct edition mode (default, undefined, registered editor, etc.)')»
- protected int directEditionMode = org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- «EXPAND xpt::Common::generatedMemberComment('configuration from a registered edit dialog')»
- protected org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration configuration;
- «REM»END: BEGIN: PapyrusGenCode«ENDREM»
-
-«ENDDEFINE»
-
-«DEFINE methods(needsRefreshBounds : Boolean, readOnly : Boolean, useElementIcon : Boolean, viewmap : gmfgen::Viewmap,
- modelFacet : gmfgen::LabelModelFacet, host : gmfgen::GenCommonBase, diagram : gmfgen::GenDiagram) FOR gmfgen::GenCommonBase-»
- «EXPAND getLabelTextHelper-»
-
- «EXPAND setLabelTextHelper-»
-
- «EXPAND getLabelIconHelper-»
-
- «EXPAND setLabelIconHelper-»
-
- «EXPAND labelSetter-»
-
- «EXPAND getModelChildren-»
-
- «EXPAND getChildBySemanticHint-»
- «REM»ITEMIS CHANGES«ENDREM»
- «EXPAND setParser -»
- «REM»ITEMIS CHANGES END«ENDREM»
- «EXPAND getParserElement(modelFacet)-»
-
- «EXPAND getLabelIcon(useElementIcon, diagram)-»
-
- «EXPAND getLabelText-»
-
- «EXPAND setLabelText(diagram)-»
-
- «EXPAND getEditText-»
-
- «EXPAND isEditable(readOnly)-»
-
- «EXPAND getEditTextValidator-»
-
- «EXPAND getCompletionProcessor-»
-
- «EXPAND getParserOptions-»
-
- «EXPAND getParser(modelFacet, diagram, host)-»
-
- «EXPAND getManager(diagram)-»
-
- «EXPAND setManager-»
-
- «EXPAND performDirectEdit-»
-
- «EXPAND performDirectEditAtPoint-»
-
- «EXPAND performDirectEditWithInitialChar-»
-
- «EXPAND performDirectEditRequest(diagram)-»
-
- «EXPAND initializeDirectEditManager-»
-
- «EXPAND refreshVisuals(needsRefreshBounds)-»
-
- «EXPAND refreshLabel(diagram)-»
-
- «EXPAND refreshUnderline-»
-
- «EXPAND refreshStrikeThrough-»
-
- «EXPAND refreshFont-»
-
- «EXPAND setFontColor-»
-
- «EXPAND addSemanticListeners-»
-
- «EXPAND removeSemanticListeners-»
-
- «EXPAND getAccessibleEditPart-»
-
- «EXPAND getFontStyleOwnerView(viewmap)-»
-
- «REM»BEGIN: PapyrusGenCode«ENDREM»
- «REM»Add extended editors management for direct edit«ENDREM»
- «EXPAND getDirectEditionType(readOnly)-»
-
- «EXPAND checkExtendedEditor-»
-
- «EXPAND checkDefaultEdition-»
-
- «EXPAND initExtendedEditorConfiguration -»
-
- «EXPAND updateExtendedEditorConfiguration -»
-
- «EXPAND performDefaultDirectEditorEdit-»
-
- «REM»END: PapyrusGenCode«ENDREM»
-«ENDDEFINE»
-
-«DEFINE labelSetterName FOR gmfgen::ParentAssignedViewmap-»
-«IF setterName <> null»«setterName»«ELSE»setLabel«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE labelSetterName FOR gmfgen::Viewmap»setLabel«ENDDEFINE»
-
-«DEFINE getLabelTextHelper FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected String getLabelTextHelper(org.eclipse.draw2d.IFigure figure) {
- if (figure instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
- return ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) figure).getText();
- } else if (figure instanceof org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure) {
- return ((org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure) figure).getText();
- } else {
- return ((org.eclipse.draw2d.Label) figure).getText();
- }
- }
-«ENDDEFINE»
-
-«DEFINE setLabelTextHelper FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void setLabelTextHelper(org.eclipse.draw2d.IFigure figure, String text) {
- if (figure instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
- ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) figure).setText(text);
- } else if (figure instanceof org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure) {
- ((org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure) figure).setText(text);
- } else {
- ((org.eclipse.draw2d.Label) figure).setText(text);
- }
- }
-«ENDDEFINE»
-
-«DEFINE getLabelIconHelper FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.swt.graphics.Image getLabelIconHelper(org.eclipse.draw2d.IFigure figure) {
- if (figure instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
- return ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) figure).getIcon();
- } else if (figure instanceof org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure) {
- return ((org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure) figure).getIcon();
- } else {
- return ((org.eclipse.draw2d.Label) figure).getIcon();
- }
- }
-«ENDDEFINE»
-
-«DEFINE setLabelIconHelper FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void setLabelIconHelper(org.eclipse.draw2d.IFigure figure, org.eclipse.swt.graphics.Image icon) {
- if (figure instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
- ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) figure).setIcon(icon);
- } else if (figure instanceof org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure) {
- ((org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure) figure).setIcon(icon);
- } else {
- ((org.eclipse.draw2d.Label) figure).setIcon(icon);
- }
- }
-«ENDDEFINE»
-
-«DEFINE labelSetter FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- public void «EXPAND labelSetterName FOR viewmap»(«EXPAND labelSetterFigureClassName FOR viewmap» figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-«ENDDEFINE»
-
-«DEFINE labelSetterFigureClassName FOR gmfgen::ParentAssignedViewmap-»
- «IF figureQualifiedClassName <> null-»
- «figureQualifiedClassName»
- «ELSE-»
- org.eclipse.draw2d.IFigure
- «ENDIF-»
-«ENDDEFINE»
-
-«DEFINE labelSetterFigureClassName FOR gmfgen::Viewmap-»
- org.eclipse.draw2d.IFigure
-«ENDDEFINE»
-
-«DEFINE getModelChildren FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected java.util.List getModelChildren() {
- return java.util.Collections.EMPTY_LIST;
- }
-«ENDDEFINE»
-
-«DEFINE getChildBySemanticHint FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- public org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-«ENDDEFINE»
-
-«DEFINE setParser FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- public void setParser(IParser parser) {
- this.parser = parser;
- }
-«ENDDEFINE»
-
-«DEFINE getParserElement(modelFacet : gmfgen::LabelModelFacet) FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.emf.ecore.EObject getParserElement() {
-«IF modelFacet = null»
- org.eclipse.emf.ecore.EObject element = resolveSemanticElement();
- return element != null ? element : (org.eclipse.gmf.runtime.notation.View) getModel();
-«ELSE»«EXPAND getParserElement FOR modelFacet»«ENDIF-»
- }
-«ENDDEFINE»
-
-«DEFINE getParserElement FOR gmfgen::LabelModelFacet-»
- return resolveSemanticElement();
-«ENDDEFINE»
-
-«DEFINE getParserElement FOR gmfgen::DesignLabelModelFacet-»
- return (org.eclipse.gmf.runtime.notation.View) getModel();
-«ENDDEFINE»
-
-«DEFINE getLabelIcon(useElementIcon : Boolean, diagram : gmfgen::GenDiagram) FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.swt.graphics.Image getLabelIcon() {
- «IF useElementIcon-»
- org.eclipse.emf.ecore.EObject parserElement = getParserElement();
- if (parserElement == null) {
- return null;
- }
- «REM»START: PapyrusGenCode«ENDREM»
- java.util.List<org.eclipse.gmf.runtime.notation.View> views = org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for (org.eclipse.gmf.runtime.notation.View view : views) {
- if (org.eclipse.papyrus.infra.emf.appearance.helper.NameLabelIconHelper.showLabelIcon(view)) {
- return «diagram.getElementTypesQualifiedClassName()».getImage(parserElement.eClass());
- }
- }
- return null;
- «REM»END: PapyrusGenCode«ENDREM»
- «ELSE-»
- return null;
- «ENDIF-»
- }
-«ENDDEFINE»
-
-«DEFINE getLabelText FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected String getLabelText() {
- String text = null;
- org.eclipse.emf.ecore.EObject parserElement = getParserElement();
- if (parserElement != null && getParser() != null) {
- text = getParser().getPrintString(
- new org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter(parserElement),
- getParserOptions().intValue());
- }
- if (text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-«ENDDEFINE»
-
-«DEFINE setLabelText(diagram : gmfgen::GenDiagram) FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(org.eclipse.gef.EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof «diagram.getTextSelectionEditPolicyQualifiedClassName()») {
- ((«diagram.getTextSelectionEditPolicyQualifiedClassName()») pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(org.eclipse.gef.EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof «diagram.getTextSelectionEditPolicyQualifiedClassName()») {
- ((«diagram.getTextSelectionEditPolicyQualifiedClassName()») sfEditPolicy).refreshFeedback();
- }
- }
-«ENDDEFINE»
-
-«DEFINE getEditText FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- public String getEditText() {
- if (getParserElement() == null || getParser() == null) {
- return ""; «EXPAND xpt::Common::nonNLS»
- }
- return getParser().getEditString(
- new org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter(getParserElement()),
- getParserOptions().intValue());
- }
-«ENDDEFINE»
-
-«DEFINE isEditable(readOnly : Boolean) FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected boolean isEditable() {
- «IF readOnly-»
- return false;
- «ELSE-»
- return getParser() != null;
- «ENDIF-»
- }
-«ENDDEFINE»
-
-«DEFINE getEditTextValidator FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- public org.eclipse.jface.viewers.ICellEditorValidator getEditTextValidator() {
- return new org.eclipse.jface.viewers.ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if (value instanceof String) {
- final org.eclipse.emf.ecore.EObject element = getParserElement();
- final org.eclipse.gmf.runtime.common.ui.services.parser.IParser parser = getParser();
- try {
- org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus valid =
- (org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus) getEditingDomain().runExclusive(
- new org.eclipse.emf.transaction.RunnableWithResult.Impl() {
-
- public void run() {
- setResult(parser.isValidEditString(new org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter(element), (String) value));
- }
- });
- return valid.getCode() == org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-«ENDDEFINE»
-
-«DEFINE getCompletionProcessor FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- public org.eclipse.jface.text.contentassist.IContentAssistProcessor getCompletionProcessor() {
- if (getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter(getParserElement()));
- }
-«ENDDEFINE»
-
-«DEFINE getParserOptions FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- public org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions getParserOptions() {
- return org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions.NONE;
- }
-«ENDDEFINE»
-
-«DEFINE getParser(modelFacet : gmfgen::LabelModelFacet, diagram : gmfgen::GenDiagram, host : gmfgen::GenCommonBase) FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- public org.eclipse.gmf.runtime.common.ui.services.parser.IParser getParser() {
- if (parser == null) {
- parser = «EXPAND parsers::ParserProvider::accessorCall(host, modelFacet, 'getParserElement()')»;
- }
- return parser;
- }
-«ENDDEFINE»
-
-«DEFINE getManager(diagram : gmfgen::GenDiagram) FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.gef.tools.DirectEditManager getManager() {
- if (manager == null) {
- setManager(new org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager(this,
- org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager.getTextCellEditorClass(this),
- «diagram.getEditPartFactoryQualifiedClassName()».getTextCellEditorLocator(this)));
- }
- return manager;
- }
-«ENDDEFINE»
-
-«DEFINE setManager FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void setManager(org.eclipse.gef.tools.DirectEditManager manager) {
- this.manager = manager;
- }
-«ENDDEFINE»
-
-«DEFINE performDirectEdit FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void performDirectEdit() {
- org.eclipse.swt.custom.BusyIndicator.showWhile(org.eclipse.swt.widgets.Display.getDefault(), new java.lang.Runnable() {
-
- public void run() {
- getManager().show();
- }
- });
- }
-«ENDDEFINE»
-
-«DEFINE performDirectEditAtPoint FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void performDirectEdit(org.eclipse.draw2d.geometry.Point eventLocation) {
- if (getManager() instanceof org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
- }
- }
-«ENDDEFINE»
-
-«DEFINE performDirectEditWithInitialChar FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- private void performDirectEdit(char initialCharacter) {
- if (getManager() instanceof org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-«ENDDEFINE»
-
-«DEFINE performDirectEditRequest(diagram : gmfgen::GenDiagram) FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void performDirectEditRequest(org.eclipse.gef.Request request) {
-
- final org.eclipse.gef.Request theRequest = request;
-
- if (org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch (directEditionMode) {
- case org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if (configuration == null || configuration.getLanguage() == null) {
- // Create default edit manager
- setManager(new org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager(this,
- org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager.getTextCellEditorClass(this),
- «diagram.getEditPartFactoryQualifiedClassName()».getTextCellEditorLocator(this)));
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- org.eclipse.jface.dialogs.Dialog dialog = null;
- if (configuration instanceof org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration) {
- setManager(((org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
- initializeDirectEditManager(theRequest);
- return;
- } else if (configuration instanceof org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration) {
- org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper helper = ((org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration)configuration).createPopupEditorHelper(this) ;
- helper.showEditor() ;
- return ;
- }
- else if(configuration instanceof org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration) {
- dialog = ((org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration)configuration).createDialog(org.eclipse.ui.PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration) {
- dialog = new org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final org.eclipse.jface.dialogs.Dialog finalDialog = dialog;
-
- if (org.eclipse.jface.window.Window.OK == dialog.open()) {
- org.eclipse.emf.transaction.TransactionalEditingDomain domain = getEditingDomain();
- org.eclipse.emf.transaction.RecordingCommand command = new org.eclipse.emf.transaction.RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition.DEFAULT_DIRECT_EDITOR:
- initializeDirectEditManager(theRequest);
- break;
- default:
- break;
- }
- }
-«ENDDEFINE»
-
-«DEFINE initializeDirectEditManager FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void initializeDirectEditManager(final Request request) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
- public void run() {
- if (isActive() && isEditable()) {
- if (request.getExtendedData().get(
- org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character) request.getExtendedData().get(org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- }
- else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-«ENDDEFINE»
-
-«DEFINE refreshVisuals(needsRefreshBounds : Boolean) FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- «IF needsRefreshBounds-»
- refreshBounds();
- «ENDIF-»
- }
-«ENDDEFINE»
-
-«DEFINE refreshLabel(diagram : gmfgen::GenDiagram) FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void refreshLabel() {
- org.eclipse.gef.EditPolicy maskLabelPolicy = getEditPolicy(org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if (maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(org.eclipse.gef.EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof «diagram.getTextSelectionEditPolicyQualifiedClassName()») {
- ((«diagram.getTextSelectionEditPolicyQualifiedClassName()») pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(org.eclipse.gef.EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof «diagram.getTextSelectionEditPolicyQualifiedClassName()») {
- ((«diagram.getTextSelectionEditPolicyQualifiedClassName()») sfEditPolicy).refreshFeedback();
- }
- }
-«ENDDEFINE»
-
-«DEFINE refreshUnderline FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void refreshUnderline() {
- org.eclipse.gmf.runtime.notation.FontStyle style =
- (org.eclipse.gmf.runtime.notation.FontStyle) getFontStyleOwnerView().getStyle(
- org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
- ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof org.eclipse.uml2.uml.Feature){
- if(((org.eclipse.uml2.uml.Feature)resolveSemanticElement()).isStatic()){
- ((WrappingLabel)getFigure()).setTextUnderline(true);
- }
- else{((WrappingLabel)getFigure()).setTextUnderline(false);}
- }
- }
-«ENDDEFINE»
-
-«DEFINE refreshStrikeThrough FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void refreshStrikeThrough() {
- org.eclipse.gmf.runtime.notation.FontStyle style =
- (org.eclipse.gmf.runtime.notation.FontStyle) getFontStyleOwnerView().getStyle(
- org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
- ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-«ENDDEFINE»
-
-«DEFINE refreshFont FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void refreshFont() {
- org.eclipse.gmf.runtime.notation.FontStyle style =
- (org.eclipse.gmf.runtime.notation.FontStyle) getFontStyleOwnerView().getStyle(
- org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getFontStyle());
- if (style != null) {
- org.eclipse.swt.graphics.FontData fontData = new org.eclipse.swt.graphics.FontData(
- style.getFontName(), style.getFontHeight(),
- (style.isBold() ? org.eclipse.swt.SWT.BOLD : org.eclipse.swt.SWT.NORMAL) |
- (style.isItalic() ? org.eclipse.swt.SWT.ITALIC : org.eclipse.swt.SWT.NORMAL));
- setFont(fontData);
- }
- }
-«ENDDEFINE»
-
-«DEFINE setFontColor FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void setFontColor(org.eclipse.swt.graphics.Color color) {
- getFigure().setForegroundColor(color);
- }
-«ENDDEFINE»
-
-«DEFINE addSemanticListeners FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void addSemanticListeners() {
- if (getParser() instanceof org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser) {
- org.eclipse.emf.ecore.EObject element = resolveSemanticElement();
- parserElements = ((org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
- for (int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (org.eclipse.emf.ecore.EObject) parserElements.get(i)); «EXPAND xpt::Common::nonNLS»
- }
- } else {
- super.addSemanticListeners();
- }
- }
-«ENDDEFINE»
-
-«DEFINE removeSemanticListeners FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void removeSemanticListeners() {
- if (parserElements != null) {
- for (int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); «EXPAND xpt::Common::nonNLS»
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-«ENDDEFINE»
-
-«DEFINE getAccessibleEditPart FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.gef.AccessibleEditPart getAccessibleEditPart() {
- if (accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(org.eclipse.swt.accessibility.AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-«ENDDEFINE»
-
-«DEFINE getFontStyleOwnerView(viewmap : gmfgen::Viewmap) FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- private org.eclipse.gmf.runtime.notation.View getFontStyleOwnerView() {
- «IF viewmap.isFixedFont()-»
- return (org.eclipse.gmf.runtime.notation.View) getModel();
- «ELSE-»
- return getPrimaryView();
- «ENDIF-»
- }
-«ENDDEFINE»
-
-
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»Methods for advanced direct edition«ENDREM»
-
-«DEFINE getDirectEditionType(readOnly : Boolean) FOR gmfgen::GenCommonBase-»
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- «IF readOnly-»
- // The label is read-only (defined in GMFGen model)
- return org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition.NO_DIRECT_EDITION;
- «ELSE-»
- if (checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if (checkDefaultEdition()) {
- return org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition.NO_DIRECT_EDITION;
- «ENDIF-»
- }
-«ENDDEFINE»
-
-«DEFINE checkExtendedEditor FOR gmfgen::GenCommonBase-»
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if (resolveSemanticElement() != null) {
- return org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-«ENDDEFINE»
-
-«DEFINE checkDefaultEdition FOR gmfgen::GenCommonBase-»
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-«ENDDEFINE»
-
-«DEFINE initExtendedEditorConfiguration FOR gmfgen::GenCommonBase-»
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if (configuration == null) {
- final String languagePreferred = org.eclipse.papyrus.extensionpoints.editors.Activator.getDefault().getPreferenceStore().getString(org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if (languagePreferred != null && !languagePreferred.equals("")) {
- configuration = org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil.findEditorConfiguration(org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-«ENDDEFINE»
-
-«DEFINE updateExtendedEditorConfiguration FOR gmfgen::GenCommonBase-»
- /**
- * Updates the preference configuration
- * @generated
- */
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = org.eclipse.papyrus.extensionpoints.editors.Activator.getDefault().getPreferenceStore().getString(
- org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
- } else if (org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
- configuration = null;
- }
- }
-«ENDDEFINE»
-
-«DEFINE performDefaultDirectEditorEdit FOR gmfgen::GenCommonBase-»
- /**
- * Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final org.eclipse.gef.Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if (isActive() && isEditable()) {
- if (theRequest.getExtendedData().get(org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character) theRequest.getExtendedData().get(
- org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if ((theRequest instanceof org.eclipse.gef.requests.DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- org.eclipse.gef.requests.DirectEditRequest editRequest = (org.eclipse.gef.requests.DirectEditRequest) theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-«ENDDEFINE»
-«REM»END: PapyrusGenCode«ENDREM»
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/preferences/StandardPage.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/preferences/StandardPage.xpt
deleted file mode 100644
index 8adc5f8cc91..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/preferences/StandardPage.xpt
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2006, 2009 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/2009/GenModel'»
-
-«REM»DOCUMENTATION: PapyrusGencode«ENDREM»
-«REM»change the superclass and the initialization «ENDREM»
-
-«DEFINE Main FOR gmfgen::GenStandardPreferencePage-»
-«EXPAND xpt::Common::copyright FOR getDiagram().editorGen-»
-package «getDiagram().preferencesPackageName»;
-
-«EXPAND xpt::Common::generatedClassComment»
-public class «getClassName()»«EXPAND extendsList»«EXPAND implementsList» {
-
- «EXPAND xpt::Common::generatedMemberComment»
- public «getClassName()»() {
- setPreferenceStore(«getDiagram().editorGen.plugin.getActivatorQualifiedClassName()».getInstance().getPreferenceStore());
- «IF gmfgen::StandardPreferencePages::General = kind-»
- setPreferenceKey(«getDiagram().editPartsPackageName».«getDiagram().editPartClassName».MODEL_ID);
- «ENDIF»
- }
-}
-«ENDDEFINE»
-
-«DEFINE extendsList FOR gmfgen::GenStandardPreferencePage-»
-«IF gmfgen::StandardPreferencePages::General = kind-»
- extends org.eclipse.papyrus.infra.gmfdiag.preferences.pages.DiagramPreferencePage«-»
-«ELSEIF gmfgen::StandardPreferencePages::Appearance = kind-»
- extends org.eclipse.gmf.runtime.diagram.ui.preferences.AppearancePreferencePage«-»
-«ELSEIF gmfgen::StandardPreferencePages::Connections = kind-»
- extends org.eclipse.gmf.runtime.diagram.ui.preferences.ConnectionsPreferencePage«-»
-«ELSEIF gmfgen::StandardPreferencePages::Printing = kind-»
- extends org.eclipse.gmf.runtime.diagram.ui.preferences.PrintingPreferencePage«-»
-«ELSEIF gmfgen::StandardPreferencePages::RulersAndGrid = kind-»
- extends org.eclipse.gmf.runtime.diagram.ui.preferences.RulerGridPreferencePage«-»
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE implementsList FOR gmfgen::GenStandardPreferencePage»«REM»no-op«ENDREM»«ENDDEFINE»
-
-«DEFINE call_initDefaults(storeVarName : String) FOR gmfgen::GenStandardPreferencePage»«IF kind <> gmfgen::StandardPreferencePages::Pathmaps»«getQualifiedClassName()».initDefaults(«storeVarName»);«ENDIF»«ENDDEFINE»
-
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/Common.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/Common.xpt
deleted file mode 100644
index 44861a7ba45..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/Common.xpt
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Copyright (c) 2006, 2010 Borland Software Corporation and others
- *
- * 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/2009/GenModel'»
-
-«DEFINE visualIDConstant FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- public static final int VISUAL_ID = «visualID»;
-«ENDDEFINE»
-
-«DEFINE behaviour FOR gmfgen::GenCommonBase-»
- «EXPAND behaviour FOREACH behaviour-»
-«ENDDEFINE»
-
-«DEFINE behaviour FOR gmfgen::Behaviour-»
-«ENDDEFINE»
-
-«DEFINE behaviour FOR gmfgen::CustomBehaviour-»
-«IF editPolicyQualifiedClassName = null or editPolicyQualifiedClassName.trim().size() = 0-»
- removeEditPolicy(«key»); «IF key.startsWith('\"') and key.endsWith('\"')»«EXPAND xpt::Common::nonNLS»«ENDIF»
-«ELSE-»
- installEditPolicy(«key», new «getEditPolicyQualifiedClassName()»()); «IF key.startsWith('\"') and key.endsWith('\"')»«EXPAND xpt::Common::nonNLS»«ENDIF»
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE behaviour FOR gmfgen::OpenDiagramBehaviour-»
- installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.OPEN_ROLE,
- new «getEditPolicyQualifiedClassName()»());
-«ENDDEFINE»
-
-«DEFINE labelFigure FOR gmfgen::ParentAssignedViewmap-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.draw2d.IFigure createFigure() {
- // Parent should assign one using «EXPAND impl::diagram::editparts::TextAware::labelSetterName»() method
- return null;
- }
-«ENDDEFINE»
-
-«DEFINE labelFigure FOR gmfgen::Viewmap-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.draw2d.IFigure createFigure() {
- org.eclipse.draw2d.IFigure label = createFigurePrim();
- defaultText = getLabelTextHelper(label);
- return label;
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.draw2d.IFigure createFigurePrim() {
- «EXPAND labelFigurePrim FOR self-»
-«ENDDEFINE»
-
-«DEFINE labelFigurePrim FOR gmfgen::FigureViewmap-»
-«IF figureQualifiedClassName = null-»
- return new org.eclipse.draw2d.Label();
-«ELSE-»
- return new «figureQualifiedClassName»();
-«ENDIF-»
- }
-«ENDDEFINE»
-
-«DEFINE labelFigurePrim FOR gmfgen::SnippetViewmap-»
- return «body»;
- }
-«ENDDEFINE»
-
-«DEFINE labelFigurePrim FOR gmfgen::InnerClassViewmap-»
- return new «className»();
- }
-
- «classBody»
-«ENDDEFINE»
-
-«DEFINE labelFigurePrim FOR gmfgen::Viewmap-»
- «ERROR 'Unknown viewmap: ' + self.repr()-»
- }
-«ENDDEFINE»
-
-«DEFINE notationalListeners FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); «EXPAND xpt::Common::nonNLS»
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); «EXPAND xpt::Common::nonNLS»
- }
-«ENDDEFINE»
-
-«DEFINE handleBounds FOR gmfgen::GenCommonBase-»
- if (org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getSize_Width().equals(feature) ||
- org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getSize_Height().equals(feature) ||
- org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getLocation_X().equals(feature) ||
- org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
- refreshBounds();
- }
-«ENDDEFINE»
-
-«DEFINE handleText FOR gmfgen::GenCommonBase-»
- if (org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer) event.getNewValue();
- setFontColor(org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry.getInstance().getColor(c));
- } else if (org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if (org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if (org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) ||
- org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) ||
- org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) ||
- org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if (getParser() instanceof org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser) {
- org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser modelParser =
- (org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser) getParser();
- if (modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if (resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-«ENDDEFINE»
-
-«DEFINE installSemanticEditPolicy FOR gmfgen::GenCommonBase-»
- «IF sansDomain-»
-removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.SEMANTIC_ROLE);
- «ELSE-»
-installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.SEMANTIC_ROLE, new «getItemSemanticEditPolicyQualifiedClassName()»());
- «ENDIF-»
-«ENDDEFINE»
-
-«DEFINE installCanonicalEditPolicy FOR gmfgen::GenContainerBase-»
- «IF needsCanonicalEditPolicy()-»
-installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new «getCanonicalEditPolicyQualifiedClassName()»());
- «ENDIF-»
-«ENDDEFINE» \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/editparts/Common.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/editparts/Common.xpt
deleted file mode 100644
index 41548d13845..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/editparts/Common.xpt
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright (c) 2006, 2009 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
- * modified by Patrick Tessier (CEA LIST)
- */
-
-«REM»Documentation: PapyrusGenCode«ENDREM»
-«REM»This template has been modified in order to remove canonical ediPolicies«ENDREM»
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/emf/2002/Ecore'»
-«EXTENSION xpt::StringOperations»
-«EXTENSION xpt::editor::Utils»
-«EXTENSION xpt::GenModelUtils»
-«EXTENSION xpt::diagram::editpolicies::LinkUtils»
-«EXTENSION xpt::expressions::ValueExpression»
-
-
-«DEFINE visualIDConstant FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- public static final int VISUAL_ID = «visualID»;
-«ENDDEFINE»
-
-«DEFINE behaviour FOR gmfgen::GenCommonBase-»
- «EXPAND behaviour FOREACH behaviour-»
-«ENDDEFINE»
-
-«DEFINE behaviour FOR gmfgen::Behaviour-»
-«ENDDEFINE»
-
-«DEFINE behaviour FOR gmfgen::CustomBehaviour-»
-«IF editPolicyQualifiedClassName = null or editPolicyQualifiedClassName.trim().length() = 0-»
- removeEditPolicy(«key»); «IF key.startsWith('\"') and key.xpandEndsWith('\"')»«EXPAND xpt::Common::nonNLS»«ENDIF»
-«ELSE-»
- installEditPolicy(«key», new «getEditPolicyQualifiedClassName()»()); «IF key.startsWith('\"') and key.endsWith('\"')»«EXPAND xpt::Common::nonNLS»«ENDIF»
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE behaviour FOR gmfgen::OpenDiagramBehaviour-»
- installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.OPEN_ROLE,
- new «getEditPolicyQualifiedClassName()»());
-«ENDDEFINE»
-
-«DEFINE labelFigure FOR gmfgen::ParentAssignedViewmap-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.draw2d.IFigure createFigure() {
- // Parent should assign one using «EXPAND impl::diagram::editparts::TextAware::labelSetterName»() method
- return null;
- }
-«ENDDEFINE»
-
-«DEFINE labelFigure FOR gmfgen::Viewmap-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.draw2d.IFigure createFigure() {
- org.eclipse.draw2d.IFigure label = createFigurePrim();
- defaultText = getLabelTextHelper(label);
- return label;
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.draw2d.IFigure createFigurePrim() {
- «EXPAND labelFigurePrim FOR self-»
-«ENDDEFINE»
-
-«DEFINE labelFigurePrim FOR gmfgen::FigureViewmap-»
-«IF figureQualifiedClassName = null-»
- return new org.eclipse.draw2d.Label();
-«ELSE-»
- return new «figureQualifiedClassName»();
-«ENDIF-»
- }
-«ENDDEFINE»
-
-«DEFINE labelFigurePrim FOR gmfgen::SnippetViewmap-»
- return «body»;
- }
-«ENDDEFINE»
-
-«DEFINE labelFigurePrim FOR gmfgen::InnerClassViewmap-»
- return new «className»();
- }
-
- «classBody»
-«ENDDEFINE»
-
-«DEFINE labelFigurePrim FOR gmfgen::Viewmap-»
- «ERROR 'Unknown viewmap: ' + self.repr()-»
- }
-«ENDDEFINE»
-
-«DEFINE notationalListeners FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); «EXPAND xpt::Common::nonNLS»
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); «EXPAND xpt::Common::nonNLS»
- }
-«ENDDEFINE»
-
-«DEFINE handleBounds FOR gmfgen::GenCommonBase-»
- if (org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getSize_Width().equals(feature) ||
- org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getSize_Height().equals(feature) ||
- org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getLocation_X().equals(feature) ||
- org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
- refreshBounds();
- }
-«ENDDEFINE»
-
-«DEFINE handleText FOR gmfgen::GenCommonBase-»
- if (org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer) event.getNewValue();
- setFontColor(org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry.getInstance().getColor(c));
- } else if (org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if (org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if (org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) ||
- org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) ||
- org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) ||
- org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if (getParser() instanceof org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser) {
- org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser modelParser =
- (org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser) getParser();
- if (modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if (resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-«ENDDEFINE»
-
-«DEFINE installSemanticEditPolicy FOR gmfgen::GenCommonBase-»
- «IF sansDomain-»
-removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.SEMANTIC_ROLE);
- «ELSE-»
-installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.SEMANTIC_ROLE, new «getItemSemanticEditPolicyQualifiedClassName()»());
- «ENDIF-»
-«ENDDEFINE»
-
-«DEFINE installCanonicalEditPolicy FOR gmfgen::GenContainerBase-»
- «IF needsCanonicalEditPolicy()-»
- «REM»BEGIN: PapyrusGenCode«ENDREM»
- «REM»Used to remove at each time canonical editpolicies«ENDREM»
-//in Papyrus diagrams are not strongly synchronised
-//installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new «getCanonicalEditPolicyQualifiedClassName()»());
- «REM»END: PapyrusGenCode«ENDREM»
- «ENDIF-»
-«ENDDEFINE»
-
-«DEFINE installCreationEditPolicy FOR gmfgen::GenCommonBase-»
-installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CREATION_ROLE, «EXPAND _creationEditPolicyNewInstance»);
-«ENDDEFINE»
-«DEFINE _creationEditPolicyNewInstance FOR gmfgen::GenCommonBase-»
-new org.eclipse.papyrus.uml.diagram.common.editpolicies.PapyrusCreationEditPolicy()«-»
-«ENDDEFINE» \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/editparts/EditPartFactory.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/editparts/EditPartFactory.xpt
deleted file mode 100644
index 1f45d22a2af..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/editparts/EditPartFactory.xpt
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (c) 2006, 2010 Borland Software Corporation and others
- *
- * 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
- */
-«REM»DOCUMENTATION: PapyrusGencode«ENDREM»
-«REM»change to manage the figure of the comment«ENDREM»
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-
-«DEFINE EditPartFactory FOR gmfgen::GenDiagram-»
-«EXPAND xpt::Common::copyright FOR getDiagram().editorGen-»
-package «editPartsPackageName»;
-
-«EXPAND xpt::Common::generatedClassComment»
-public class «editPartFactoryClassName» implements org.eclipse.gef.EditPartFactory {
-
- «EXPAND createEditPartMethod-»
-
- «EXPAND createUnrecognizedEditPart-»
-
- «EXPAND getTextCellEditorLocator-»
-
- «EXPAND additions-»
-}
-«ENDDEFINE»
-
-«DEFINE createEditPartMethod FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
- public org.eclipse.gef.EditPart createEditPart(org.eclipse.gef.EditPart context, Object model) {
- if (model instanceof org.eclipse.gmf.runtime.notation.View) {
- org.eclipse.gmf.runtime.notation.View view = (org.eclipse.gmf.runtime.notation.View) model;
- switch («EXPAND xpt::editor::VisualIDRegistry::getVisualIDMethodCall»(view)) {
- «EXPAND createEditPart FOR self-»
- «FOREACH getAllNodes()->asSequence() AS node-»
- «EXPAND createEditPart FOR node-»
- «EXPAND createEditPart FOREACH node.labels-»
- «ENDFOREACH-»
- «EXPAND createEditPart FOREACH compartments-»
- «FOREACH links->asSequence() AS link-»
- «EXPAND createEditPart FOR link-»
- «EXPAND createEditPart FOREACH link.labels»
- «ENDFOREACH-»
- }
- }
- return createUnrecognizedEditPart(context, model);
- }
-«ENDDEFINE»
-
-«DEFINE createEditPart FOR gmfgen::GenCommonBase»
- «EXPAND xpt::Common::caseVisualID»
- return new «getEditPartQualifiedClassName()»(view);
-«ENDDEFINE»
-
-«DEFINE createUnrecognizedEditPart FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
- private org.eclipse.gef.EditPart createUnrecognizedEditPart(org.eclipse.gef.EditPart context, Object model) {
- // Handle creation of unrecognized child node EditParts here
- return null;
- }
-«ENDDEFINE»
-
-«DEFINE getTextCellEditorLocator FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
- public static org.eclipse.gef.tools.CellEditorLocator getTextCellEditorLocator(
- org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart source) {
- if (source.getFigure() instanceof org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure){
- return new MultilineCellEditorLocator(
- (org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure) source.getFigure());
- }
- else {
- return org.eclipse.gmf.tooling.runtime.directedit.locator.CellEditorLocatorAccess.INSTANCE.getTextCellEditorLocator(source);
-
- }
- }
-
-
- «EXPAND xpt::Common::generatedClassComment»
- static private class MultilineCellEditorLocator implements org.eclipse.gef.tools.CellEditorLocator {
-
- «EXPAND xpt::Common::generatedClassComment»
- private org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure multilineEditableFigure;
-
- «EXPAND xpt::Common::generatedClassComment»
- public MultilineCellEditorLocator(org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure figure) {
- this.multilineEditableFigure = figure;
- }
-
- «EXPAND xpt::Common::generatedClassComment»
- public org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure getMultilineEditableFigure() {
- return multilineEditableFigure;
- }
-
- «EXPAND xpt::Common::generatedClassComment»
- public void relocate(org.eclipse.jface.viewers.CellEditor celleditor) {
- org.eclipse.swt.widgets.Text text = (org.eclipse.swt.widgets.Text) celleditor.getControl();
- org.eclipse.draw2d.geometry.Rectangle rect = getMultilineEditableFigure().getBounds().getCopy();
- rect.x=getMultilineEditableFigure().getEditionLocation().x;
- rect.y=getMultilineEditableFigure().getEditionLocation().y;
- getMultilineEditableFigure().translateToAbsolute(rect);
- if (getMultilineEditableFigure().getText().length() > 0) {
- rect.setSize(new org.eclipse.draw2d.geometry.Dimension(text.computeSize(rect.width,
- SWT.DEFAULT)));
- }
- if (!rect.equals(new org.eclipse.draw2d.geometry.Rectangle(text.getBounds()))) {
- text.setBounds(rect.x, rect.y, rect.width, rect.height);
- }
- }
- }
-«ENDDEFINE»
-
-«DEFINE additions FOR gmfgen::GenDiagram-»
-«ENDDEFINE»
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/editpolicies/linkCommands.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/editpolicies/linkCommands.xpt
deleted file mode 100644
index e4a277e1f9d..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/editpolicies/linkCommands.xpt
+++ /dev/null
@@ -1,83 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * 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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - 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/papyrus/2009/papyrusgmfgenextension'»
-«EXTENSION xpt::diagram::editpolicies::Utils»
-«EXTENSION xpt::GenModelUtils»
-«EXTENSION xpt::diagram::editpolicies::linkCommands»
-
-
-«REM»
-We overwrite the reorientTypeLinkCommands to manages the links which use the ReorientCommand provided by the EditService
-«ENDREM»
-«AROUND reorientTypeLinkCommands FOR gmfgen::GenLinkEnd-»
-«EXPAND xpt::Common::generatedMemberComment(
- 'Returns command to reorient EClass based link. New link target or source\n' +
- 'should be the domain model element associated with this node.\n'
-)»
-protected org.eclipse.gef.commands.Command getReorientRelationshipCommand(
- org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- «EXPAND reorientLinkCommandWithService FOREACH getReroutableTypeLinks(self)-»
- «EXPAND callReorientCommand-»
- «EXPAND reorientLinkCommandWithoutService FOREACH getReroutableTypeLinks(self)-»
- }
- return super.getReorientRelationshipCommand(req);
- }
-«ENDAROUND»
-
-«REM»
-This function writes only : "case myLinkEditPart.VISUAL_ID:"
-for the link which uses the ReorientCommand provided by the EditService
-«ENDREM»
-«DEFINE reorientLinkCommandWithService FOR gmfgen::GenLink-»
- «IF papyrusgmfgenextension::EditPartUsingReorientService.allInstances()->select(v:papyrusgmfgenextension::EditPartUsingReorientService|v.genView->includes(self))->size()<>0-»
- «EXPAND xpt::Common::caseVisualID-»
- «ENDIF-»
-«ENDDEFINE»
-
-«REM»
-This function writes the code to call the ReorientCommand provided by the ReorientService
-«ENDREM»
-«DEFINE callReorientCommand FOR gmfgen::GenLinkEnd-»
- «LET papyrusgmfgenextension::EditPartUsingReorientService.allInstances() AS rServiceNodes-»
- «IF rServiceNodes->notEmpty()-»
- «IF rServiceNodes->asSequence()
- ->select(rServiceNode | rServiceNode.genView->select(view | getReroutableTypeLinks(self)->includes(view))->notEmpty())
- ->notEmpty()-»
- org.eclipse.papyrus.infra.services.edit.service.IElementEditService provider =org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils.getCommandProvider(req.getRelationship());
- if(provider == null) {
- return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;
- }
- // Retrieve re-orient command from the Element Edit service
- org.eclipse.gmf.runtime.common.core.command.ICommand reorientCommand = provider.getEditCommand(req);
- if(reorientCommand == null) {
- return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;
- }
- return getGEFWrapper(reorientCommand.reduce());
- «ENDIF-»
- «ENDIF-»
- «ENDLET-»
-«ENDDEFINE»
-
-«REM»
-This function writes the code for the Links which uses their own ReorientCommand (the initial code)
-«ENDREM»
-«DEFINE reorientLinkCommandWithoutService FOR gmfgen::GenLink-»
- «IF papyrusgmfgenextension::EditPartUsingReorientService.allInstances()->select(v:papyrusgmfgenextension::EditPartUsingReorientService|v.genView->includes(self))->size()=0-»
- «EXPAND xpt::diagram::editpolicies::linkCommands::reorientLinkCommand-»
- «ENDIF-»
-«ENDDEFINE»
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/preferences/PreferenceInitializer.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/preferences/PreferenceInitializer.xpt
deleted file mode 100644
index 212e96f713e..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/preferences/PreferenceInitializer.xpt
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2008 Atos Origin
- *
- * 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:
- * Thibault Landre (Atos Origin) - initial API and implementation
- * modified by Patrick Tessier
- */
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/emf/2002/Ecore'»
-
-«EXTENSION xpt::preferences::PrefsConstant»
-
-«DEFINE className FOR gmfgen::GenDiagram»DiagramPreferenceInitializer«ENDDEFINE»
-
-«AROUND PreferenceInitializer FOR gmfgen::GenDiagram-»
-
-package «preferencesPackageName»;
-
-«EXPAND xpt::Common::generatedClassComment»
-public class «EXPAND className» extends org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer {
-
- «EXPAND xpt::Common::generatedMemberComment»
- public void initializeDefaultPreferences() {
- org.eclipse.jface.preference.IPreferenceStore store = getPreferenceStore();
- «FOREACH getAllNodes().elementType.displayName->asSet() AS string -»
- «IF 'UNDEFINED' <> string.toUpper()»
- «self.preferencesPackageName».«string»PreferencePage.initDefaults(store);
- «ENDIF»
- «ENDFOREACH»
-
- «FOREACH links.elementType.displayName->asSet() AS string -»
- «IF 'UNDEFINED' <> string.toUpper()»
- «self.preferencesPackageName».«string»PreferencePage.initDefaults(store);
- «ENDIF»
- «ENDFOREACH»
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.jface.preference.IPreferenceStore getPreferenceStore() {
- return «editorGen.plugin.getActivatorQualifiedClassName()».getInstance().getPreferenceStore();
- }
-}
-«ENDAROUND»
-
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/preferences/extensions.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/preferences/extensions.xpt
deleted file mode 100644
index 5b5c6cc013e..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/preferences/extensions.xpt
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2009 Atos Origin
- *
- * 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:
- * Thibault Landre (Atos Origin) - initial API and implementation
- */
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/emf/2002/Ecore'»
-
-«EXTENSION xpt::diagram::Utils»
-«EXTENSION xpt::preferences::PrefsConstant»
-
-«AROUND extensions FOR gmfgen::GenDiagram-»
-
-«IF preferencePages->size() > 0-»
- <extension point="org.eclipse.ui.preferencePages" id="prefpages">
- «EXPAND xpt::Common::xmlGeneratedTag»
-«EXPAND papyrusPreferencePage FOREACH allPreferencePages(self)-»
- </extension>
-«ENDIF-»
-«ENDAROUND»
-
-«DEFINE papyrusPreferencePage FOR gmfgen::GenStandardPreferencePage-»
-«IF gmfgen::StandardPreferencePages::General = kind -»
- <page
- id="«getDiagramPreferencePageCategory()».«getDiagram().editorGen.modelID»"
- name="«getDiagram().editorGen.modelID» Diagram"
- category="«getDiagramPreferencePageCategory()»"
- class="«getQualifiedClassName()»">
- </page>
- «ELSEIF gmfgen::StandardPreferencePages::Printing = kind or gmfgen::StandardPreferencePages::RulersAndGrid = kind -»
- <page
- id="«getQualifiedClassName()»"
- name="%prefpage.«iD»"
- category="«getDiagramPreferencePageCategory()».«getDiagram().editorGen.modelID»"
- class="«getQualifiedClassName()»">
- </page>
-«ENDIF»
-«ENDDEFINE»
-
-«DEFINE papyrusPreferencePage FOR gmfgen::GenCustomPreferencePage-»
-«ENDDEFINE» \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/updater/DiagramUpdater.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/updater/DiagramUpdater.xpt
deleted file mode 100644
index 05587872452..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/updater/DiagramUpdater.xpt
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2007, 2009 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:
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Borland) - [243151] explicit source/target for links
- */
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension'»
-«EXTENSION xpt::EMFUtils»
-«EXTENSION xpt::diagram::updater::Utils»
-«EXTENSION xpt::diagram::editpolicies::LinkUtils»
-«EXTENSION xpt::GenModelUtils»
-«EXTENSION gmf::GenModelUtils»
-
-«REM»Mutating Canvas :: semantic children of diagram must select the correct features depending on the element that is the actual canvas«ENDREM»
-«REM»@author :: fjcano (C) 2008«ENDREM»
-«AROUND getSemanticChildrenOfView FOR gmfgen::GenContainerBase-»
- «REM»«IF GenDiagram.isInstance(this) && getReferencingObjects().typeSelect(AlternateCanvas).size() > 0»«ENDREM»
- «IF self.oclIsKindOf(gmfgen::GenDiagram) and papyrusgmfgenextension::AlternateCanvas.allInstances()->select(v:papyrusgmfgenextension::AlternateCanvas|v.diagram=self)->size()<>0»
-«REM»
- The switch that performs the correct job according to the canvas' EObject
-«ENDREM»
- «EXPAND createUpdaterSwitch FOR self»
- «REM»The canvas get method that depends on the Switch«ENDREM»
- «EXPAND xpt::Common::generatedMemberComment»
- public static java.util.List «EXPAND xpt::diagram::updater::DiagramUpdater::getSemanticChildrenMethodName»(org.eclipse.gmf.runtime.notation.View view) {
- «IF getSemanticChildrenChildFeatures(self)->size() > 0 or getPhantomNodes(self)->size() > 0-»
- «EXPAND defineModelElement-»
- aSwitch.setInfo(view);
- java.util.List<«editorGen.diagramUpdater.getNodeDescriptorQualifiedClassName()»> result = aSwitch.doSwitch(modelElement);
- if (result == null || result.size() <= 0) {
- return java.util.Collections.EMPTY_LIST;
- }
- «IF not getPhantomNodes(self)->isEmpty()-»
- org.eclipse.emf.ecore.resource.Resource resource = modelElement.eResource();
- for (java.util.Iterator semanticIterator = getPhantomNodesIterator(resource); semanticIterator.hasNext();) {
- org.eclipse.emf.ecore.EObject childElement = (org.eclipse.emf.ecore.EObject) semanticIterator.next();
- if (childElement == modelElement) {
- continue;
- }
- «EXPAND addNextIfPhantom FOREACH getPhantomNodes(self)-»
- }
- «ENDIF-»
- return result;
- «ELSE-»
- return java.util.Collections.EMPTY_LIST;
- «ENDIF-»
- }
- «ELSEIF papyrusgmfgenextension::SpecificDiagramUpdater.allInstances()->select(updater: papyrusgmfgenextension::SpecificDiagramUpdater | (updater.genNode = self) and (updater.classpath <> null))->size()<>0»
- «FOREACH papyrusgmfgenextension::SpecificDiagramUpdater.allInstances()->select(updater: papyrusgmfgenextension::SpecificDiagramUpdater | (updater.genNode = self) and (updater.classpath <> null)) AS updater»
- public static java.util.List «EXPAND xpt::diagram::updater::DiagramUpdater::getSemanticChildrenMethodName»(org.eclipse.gmf.runtime.notation.View view) {
- org.eclipse.papyrus.uml.diagram.common.part.ICustomDiagramUpdater customUpdater = new «updater.classpath»();
- return customUpdater.getSemanticChildren(view);
- }
- «ENDFOREACH»
- «ELSE»
- «targetDef.proceed()-»
- «ENDIF»
-«ENDAROUND»
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/views/Utils.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/views/Utils.xpt
deleted file mode 100644
index d609b158d19..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/views/Utils.xpt
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (c) 2007, 2009 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
- * Artem Tikhomirov (Borland) - [257119] Create views directly, not through ViewFactories
- */
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«EXTENSION xpt::diagram::ViewmapAttributesUtils»
-«EXTENSION xpt::diagram::Utils»
-
-«AROUND offset(String viewVar) FOR gmfgen::GenExternalNodeLabel»
-«IF labelOffsetX(viewmap, 0) <> 0 or labelOffsetY(viewmap, 0) <> 0-»
- «EXPAND xpt::diagram::views::Utils::offset(viewVar, labelOffsetX(viewmap, 0), labelOffsetY(viewmap, 0))-»
-«ELSE-»
- «targetDef.proceed()-»
-«ENDIF-»
-«ENDAROUND»
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/editor/Editor.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/editor/Editor.xpt
deleted file mode 100644
index 2b2d33efa11..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/editor/Editor.xpt
+++ /dev/null
@@ -1,594 +0,0 @@
-/*
- * Copyright (c) 2006, 2009 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:
- * Alexander Shatalin (Borland) - initial API and implementation
- * Emilien Perico (Atos Origin) - add code to refactor some classes
- */
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«EXTENSION xpt::editor::Utils»
-
-
-«AROUND Editor FOR gmfgen::GenEditorView-»
- «EXPAND xpt::Common::copyright FOR editorGen-»
-package «packageName»;
-
- «EXPAND xpt::Common::generatedClassComment»
-public class «className» extends org.eclipse.papyrus.uml.diagram.common.part.UmlGmfDiagramEditor«EXPAND implementsList FOR getEditorImplementsList(self)» {
-
- «EXPAND attributes-»
-
- «EXPAND _constructor-»
-
- «EXPAND getContextID-»
- «EXPAND createPaletteRoot FOR editorGen.diagram.palette-»
-
- «EXPAND getPreferencesHint-»
-
- «EXPAND getContributorId-»
- «EXPAND getAdapter-»
-
- «EXPAND getDocumentProvider-»
-
- «EXPAND getEditingDomain-»
-
- «EXPAND setDocumentProvider-»
- «IF isIDEMode(self)-»
-
- «EXPAND gotoMarker-»
-
- «EXPAND isSaveAsAllowed-»
-
- «EXPAND doSaveAs-»
-
- «EXPAND performSaveAs-»
-
- «EXPAND getShowInContext-»
- «EXPAND getNavigatorSelection FOR editorGen.navigator-»
- «ENDIF-»
-
- «EXPAND configureGraphicalViewer-»
-
- «IF editorGen.diagram.generateCreateShortcutAction()-»
-
- «EXPAND initializeGraphicalViewer-»
-
- «EXPAND DropTargetListener-»
- «ENDIF-»
-
- «EXPAND additions-»
-}
-«ENDAROUND»
-
-«DEFINE attributes FOR gmfgen::GenEditorView-»
- «EXPAND xpt::Common::generatedMemberComment»
-public static final String ID = "«iD»"; «EXPAND xpt::Common::nonNLS»
-
- «EXPAND xpt::Common::generatedMemberComment»
-public static final String CONTEXT_ID = "«contextID»"; «EXPAND xpt::Common::nonNLS»
-
-
- «REM»Documentation. adds listener for papyrus editors«ENDREM»
- «EXPAND xpt::Common::generatedMemberComment»
- private org.eclipse.gef.KeyHandler paletteKeyHandler = null;
-
- «EXPAND xpt::Common::generatedMemberComment»
- private org.eclipse.swt.events.MouseListener paletteMouseListener = null;
-
- «REM»Helps to handle correctly the dirty state«ENDREM»
- «EXPAND xpt::Common::generatedMemberComment»
- private org.eclipse.core.commands.operations.IUndoableOperation savedOperation = null;
-
- «EXPAND xpt::Common::generatedMemberComment»
- private org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain;
-
- «EXPAND xpt::Common::generatedMemberComment»
- private org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocumentProvider documentProvider;
-
-
- «REM»«ENDREM»
-«ENDDEFINE»
-
-«DEFINE _constructor FOR gmfgen::GenEditorView-»
- «EXPAND xpt::Common::generatedMemberComment»
- public «className»(org.eclipse.papyrus.infra.core.services.ServicesRegistry servicesRegistry, org.eclipse.gmf.runtime.notation.Diagram diagram) throws org.eclipse.papyrus.infra.core.services.ServiceException{
- super(servicesRegistry, diagram);
-
- «REM»Documentation. adds listener for papyrus palette service«ENDREM»
- // adds a listener to the palette service, which reacts to palette customizations
- org.eclipse.papyrus.uml.diagram.common.service.PapyrusPaletteService.getInstance().addProviderChangeListener(this);
-
- «REM»Share the same editing domain«ENDREM»
- // Share the same editing provider
- editingDomain = servicesRegistry.getService(org.eclipse.emf.transaction.TransactionalEditingDomain.class);
- documentProvider = new org.eclipse.papyrus.infra.gmfdiag.common.GmfMultiDiagramDocumentProvider(editingDomain);
-
- // overrides editing domain created by super constructor
- setDocumentProvider(documentProvider);
-
- «REM»end of listeners addition«ENDREM»
- }
-«ENDDEFINE»
-
-«DEFINE createPaletteRoot FOR gmfgen::Palette-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.gef.palette.PaletteRoot createPaletteRoot(org.eclipse.gef.palette.PaletteRoot existingPaletteRoot) {
- org.eclipse.gef.palette.PaletteRoot paletteRoot;
- if (existingPaletteRoot == null) {
- paletteRoot = org.eclipse.papyrus.uml.diagram.common.service.PapyrusPaletteService.getInstance().createPalette(this, getDefaultPaletteContent());
- } else {
- org.eclipse.papyrus.uml.diagram.common.service.PapyrusPaletteService.getInstance().updatePalette(existingPaletteRoot, this, getDefaultPaletteContent());
- paletteRoot = existingPaletteRoot;
- }
- applyCustomizationsToPalette(paletteRoot);
- return paletteRoot;
- }
-«ENDDEFINE»
-
-«DEFINE createPaletteCustomizer FOR gmfgen::GenEditorView-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.gef.ui.palette.PaletteCustomizer createPaletteCustomizer() {
- return new org.eclipse.papyrus.uml.diagram.common.part.PapyrusPaletteCustomizer(getPreferenceStore());
- }
-«ENDDEFINE»
-
-«DEFINE additions FOR gmfgen::GenEditorView-»
-
- «EXPAND createEditingDomain-»
-
- «EXPAND configureDiagramEditDomain-»
-
- «EXPAND doSave-»
-
- «EXPAND isDirty-»
-
- «REM»Documentation. adds method to handle palette changes«ENDREM»
- «EXPAND handlePaletteChange-»
-
- «EXPAND dispose-»
-
- «EXPAND getPaletteViewer-»
-
- «REM»Documentation: (RS) advanced customization abilities
- «EXPAND createPaletteCustomizer-»
- «ENDREM»
-
- «EXPAND constructPaletteViewer -»
-
- «EXPAND createPaletteviewerProvider-»
-
- «EXPAND getGraphicalViewer-»
-
- «EXPAND initializeGraphicalViewer-»
-
- «EXPAND selectionChanged-»
-«ENDDEFINE»
-
-«DEFINE handlePaletteChange FOR gmfgen::GenEditorView-»
- «EXPAND xpt::Common::generatedMemberComment»
- public void providerChanged(org.eclipse.gmf.runtime.common.core.service.ProviderChangeEvent event) {
- // update the palette if the palette service has changed
- if (org.eclipse.papyrus.uml.diagram.common.service.PapyrusPaletteService.getInstance().equals(event.getSource())) {
- org.eclipse.papyrus.uml.diagram.common.service.PapyrusPaletteService.getInstance().updatePalette(getPaletteViewer().getPaletteRoot(), this,
- getDefaultPaletteContent());
- }
- }
-«ENDDEFINE»
-
-«DEFINE constructPaletteViewer FOR gmfgen::GenEditorView-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.gef.ui.palette.PaletteViewer constructPaletteViewer() {
- return new org.eclipse.papyrus.uml.diagram.common.part.PapyrusPaletteViewer();
- }
-«ENDDEFINE»
-
-«DEFINE dispose FOR gmfgen::GenEditorView-»
- «EXPAND xpt::Common::generatedMemberComment»
- public void dispose() {
- // remove palette service listener
- // remove preference listener
- org.eclipse.papyrus.uml.diagram.common.service.PapyrusPaletteService.getInstance().removeProviderChangeListener(this);
-
- super.dispose();
- }
-«ENDDEFINE»
-
-«DEFINE getPaletteViewer FOR gmfgen::GenEditorView-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.gef.ui.palette.PaletteViewer getPaletteViewer() {
- return getEditDomain().getPaletteViewer();
- }
-«ENDDEFINE»
-
-«DEFINE implementsList FOR Sequence(String)-»
- implements org.eclipse.gmf.runtime.common.core.service.IProviderChangeListener
-«IF not self->isEmpty()», «EXPAND implementsListEntry FOREACH self SEPARATOR ', '»«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE implementsListEntry FOR String»«self»«ENDDEFINE»
-
-«DEFINE createPaletteviewerProvider FOR gmfgen::GenEditorView-»
-«EXPAND xpt::Common::generatedMemberComment»
-protected org.eclipse.gef.ui.palette.PaletteViewerProvider createPaletteViewerProvider() {
- getEditDomain().setPaletteRoot(createPaletteRoot(null));
- return new org.eclipse.gef.ui.palette.PaletteViewerProvider(getEditDomain()) {
-
- /**
- * Override to provide the additional behavior for the tools. Will intialize with a
- * PaletteEditPartFactory that has a TrackDragger that understand how to handle the
- * mouseDoubleClick event for shape creation tools. Also will initialize the palette
- * with a defaultTool that is the SelectToolEx that undestands how to handle the enter
- * key which will result in the creation of the shape also.
- */
- protected void configurePaletteViewer(org.eclipse.gef.ui.palette.PaletteViewer viewer) {
- super.configurePaletteViewer(viewer);
-
- // customize menu...
- viewer.setContextMenu(new org.eclipse.papyrus.uml.diagram.common.part.PapyrusPaletteContextMenuProvider(viewer));
-
- viewer.getKeyHandler().setParent(getPaletteKeyHandler());
- viewer.getControl().addMouseListener(getPaletteMouseListener());
-
- // Add a transfer drag target listener that is supported on
- // palette template entries whose template is a creation tool.
- // This will enable drag and drop of the palette shape creation
- // tools.
- viewer.addDragSourceListener(new org.eclipse.gmf.runtime.diagram.ui.internal.parts.PaletteToolTransferDragSourceListener(viewer));
- viewer.setCustomizer(createPaletteCustomizer());
- }
-
- public org.eclipse.gef.ui.palette.PaletteViewer createPaletteViewer(org.eclipse.swt.widgets.Composite parent) {
- org.eclipse.gef.ui.palette.PaletteViewer pViewer = constructPaletteViewer();
- pViewer.createControl(parent);
- configurePaletteViewer(pViewer);
- hookPaletteViewer(pViewer);
- return pViewer;
- }
-
- /**
- * @return Palette Key Handler for the palette
- */
- private org.eclipse.gef.KeyHandler getPaletteKeyHandler() {
-
- if (paletteKeyHandler == null) {
-
- paletteKeyHandler = new org.eclipse.gef.KeyHandler() {
-
- /**
- * Processes a <i>key released </i> event. This method is called by the Tool
- * whenever a key is released, and the Tool is in the proper state. Override
- * to support pressing the enter key to create a shape or connection
- * (between two selected shapes)
- *
- * @param event
- * the KeyEvent
- * @return <code>true</code> if KeyEvent was handled in some way
- */
- public boolean keyReleased(org.eclipse.swt.events.KeyEvent event) {
-
- if (event.keyCode == org.eclipse.swt.SWT.Selection) {
-
- org.eclipse.gef.Tool tool = getPaletteViewer().getActiveTool().createTool();
-
- if (toolSupportsAccessibility(tool)) {
-
- tool.keyUp(event, getDiagramGraphicalViewer());
-
- // deactivate current selection
- getPaletteViewer().setActiveTool(null);
-
- return true;
- }
-
- }
- return super.keyReleased(event);
- }
-
- };
-
- }
- return paletteKeyHandler;
- }
-
- /**
- * @return Palette Mouse listener for the palette
- */
- private org.eclipse.swt.events.MouseListener getPaletteMouseListener() {
-
- if (paletteMouseListener == null) {
-
- paletteMouseListener = new org.eclipse.swt.events.MouseListener() {
-
- /**
- * Flag to indicate that the current active tool should be cleared after a
- * mouse double-click event.
- */
- private boolean clearActiveTool = false;
-
- /**
- * Override to support double-clicking a palette tool entry to create a
- * shape or connection (between two selected shapes).
- *
- * @see org.eclipse.swt.events.MouseListener#mouseDoubleClick(org.eclipse.swt.events.MouseEvent)
- */
- public void mouseDoubleClick(org.eclipse.swt.events.MouseEvent e) {
- org.eclipse.gef.Tool tool = getPaletteViewer().getActiveTool().createTool();
-
- if (toolSupportsAccessibility(tool)) {
-
- tool.setViewer(getDiagramGraphicalViewer());
- tool.setEditDomain(getDiagramGraphicalViewer().getEditDomain());
- tool.mouseDoubleClick(e, getDiagramGraphicalViewer());
-
- // Current active tool should be deactivated,
- // but if it is down here it will get
- // reactivated deep in GEF palette code after
- // receiving mouse up events.
- clearActiveTool = true;
- }
- }
-
- public void mouseDown(org.eclipse.swt.events.MouseEvent e) {
- // do nothing
- }
-
- public void mouseUp(org.eclipse.swt.events.MouseEvent e) {
- // Deactivate current active tool here if a
- // double-click was handled.
- if (clearActiveTool) {
- getPaletteViewer().setActiveTool(null);
- clearActiveTool = false;
- }
-
- }
- };
-
- }
- return paletteMouseListener;
- }
-
- };
- }
-«ENDDEFINE»
-
-«REM»Not used«ENDREM»
-«DEFINE performSaveAs FOR gmfgen::GenEditorView-»
- «EXPAND xpt::Common::generatedMemberComment»
-protected void performSaveAs(org.eclipse.core.runtime.IProgressMonitor progressMonitor) {
- // Nothing
-}
-«ENDDEFINE»
-
-«REM»Share the same editing domain«ENDREM»
-«DEFINE getEditingDomain FOR gmfgen::GenEditorView-»
- «EXPAND xpt::Common::generatedMemberComment»
- public org.eclipse.emf.transaction.TransactionalEditingDomain getEditingDomain() {
- return editingDomain;
- }
-«ENDDEFINE»
-
-«DEFINE createEditingDomain FOR gmfgen::GenEditorView-»
-«EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.emf.transaction.TransactionalEditingDomain createEditingDomain() {
- // Already configured
- return editingDomain;
- }
-«ENDDEFINE»
-
-
-«DEFINE configureDiagramEditDomain FOR gmfgen::GenEditorView-»
-«EXPAND xpt::Common::generatedMemberComment»
- protected void configureDiagramEditDomain() {
- super.configureDiagramEditDomain();
- getDiagramEditDomain().getDiagramCommandStack().addCommandStackListener(new org.eclipse.gef.commands.CommandStackListener() {
-
- public void commandStackChanged(java.util.EventObject event) {
- firePropertyChange( org.eclipse.ui.IEditorPart.PROP_DIRTY);
- }
- });
- }
-«ENDDEFINE»
-
-«DEFINE doSave FOR gmfgen::GenEditorView-»
-«EXPAND xpt::Common::generatedMemberComment»
- public void doSave(org.eclipse.core.runtime.IProgressMonitor progressMonitor) {
- // The saving of the resource is done by the CoreMultiDiagramEditor
- savedOperation = getOperationHistory().getUndoOperation(getUndoContext());
- }
-«ENDDEFINE»
-
-«REM»Fix the dirty state«ENDREM»
-«DEFINE isDirty FOR gmfgen::GenEditorView-»
-«EXPAND xpt::Common::generatedMemberComment»
- public boolean isDirty() {
- org.eclipse.core.commands.operations.IUndoableOperation op = getOperationHistory().getUndoOperation(getUndoContext());
- return savedOperation != op;
- }
-«ENDDEFINE»
-
-«REM»Code refactoring moved in UMLDiagramEditor«ENDREM»
-«DEFINE getDocumentProvider FOR gmfgen::GenEditorView-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected final org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocumentProvider getDocumentProvider(org.eclipse.ui.IEditorInput input) {
- return documentProvider;
- }
-«ENDDEFINE»
-
-«DEFINE setDocumentProvider FOR gmfgen::GenEditorView-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected final void setDocumentProvider(org.eclipse.ui.IEditorInput input) {
- // Already set in the constructor
- }
-«ENDDEFINE»
-
-«DEFINE getGraphicalViewer FOR gmfgen::GenEditorView-»
-«EXPAND xpt::Common::generatedMemberComment»
- @Override
- public org.eclipse.gef.GraphicalViewer getGraphicalViewer() {
- return super.getGraphicalViewer();
- }
-«ENDDEFINE»
-
-
-«DEFINE initializeGraphicalViewer FOR gmfgen::GenEditorView-»
-«EXPAND xpt::Common::generatedMemberComment»
- @Override
- protected void initializeGraphicalViewer() {
- super.initializeGraphicalViewer();
-
- // Enable Drop
- getDiagramGraphicalViewer().addDropTargetListener(
- new org.eclipse.papyrus.uml.diagram.common.listeners.DropTargetListener(getDiagramGraphicalViewer(), org.eclipse.jface.util.LocalSelectionTransfer.getTransfer()) {
-
- @Override
- protected Object getJavaObject(org.eclipse.swt.dnd.TransferData data) {
- return LocalSelectionTransfer.getTransfer().getSelection();
- }
-
- @Override
- protected org.eclipse.emf.transaction.TransactionalEditingDomain getTransactionalEditingDomain() {
- return getEditingDomain();
- }
- });
-
- }
-«ENDDEFINE»
-
-«DEFINE selectionChanged FOR gmfgen::GenEditorView-»
-«EXPAND xpt::Common::generatedMemberComment»
- @Override
- public void selectionChanged(org.eclipse.ui.IWorkbenchPart part, org.eclipse.jface.viewers.ISelection selection) {
- if (getSite().getPage().getActiveEditor() instanceof org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor) {
- org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor editor = (org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor) getSite().getPage().getActiveEditor();
- // If not the active editor, ignore selection changed.
- if (this.equals(editor.getActiveEditor())) {
- updateActions(getSelectionActions());
- super.selectionChanged(part, selection);
- } else {
- super.selectionChanged(part, selection);
- }
- } else {
- super.selectionChanged(part, selection);
- }
- // from
- // org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor.selectionChanged(IWorkbenchPart,
- // ISelection)
- if (part == this) {
- rebuildStatusLine();
- }
- }
-«ENDDEFINE»
-
-«DEFINE getContextID FOR gmfgen::GenEditorView-»
- «EXPAND xpt::Common::generatedMemberComment»
-protected String getContextID() {
- return CONTEXT_ID;
-}
-«ENDDEFINE»
-
-«DEFINE getPreferencesHint FOR gmfgen::GenEditorView-»
- «EXPAND xpt::Common::generatedMemberComment»
-protected org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint getPreferencesHint() {
-«REM»
- XXX seems better we use preference store directly (in configureGraphicalViewer) instead all these indirect ids
-«ENDREM»«-»
- return «EXPAND xpt::plugin::Activator::preferenceHintAccess FOR editorGen»;
-}
-«ENDDEFINE»
-
-«DEFINE getContributorId FOR gmfgen::GenEditorView-»
- «EXPAND xpt::Common::generatedMemberComment»
-public String getContributorId() {
- return «editorGen.plugin.getActivatorQualifiedClassName()».ID;
-}
-«ENDDEFINE»
-
-«DEFINE getAdapter FOR gmfgen::GenEditorView-»
- «IF not hasPropertySheet(self) or hasNavigator(self)-»
-
- «EXPAND xpt::Common::generatedMemberComment»
-public Object getAdapter(Class type) {
- «IF not hasPropertySheet(self)-»
- if (type == org.eclipse.ui.views.properties.IPropertySheetPage.class) {
- return null;
- }
- «ENDIF-»
- «IF hasNavigator(self)-»
- if (type == org.eclipse.ui.part.IShowInTargetList.class) {
- return new org.eclipse.ui.part.IShowInTargetList() {
- public String[] getShowInTargetIds() {
- return new String[] { org.eclipse.ui.navigator.resources.ProjectExplorer.VIEW_ID };
- }
- };
- }
- «ENDIF-»
- return super.getAdapter(type);
-}
- «ENDIF-»
-«ENDDEFINE»
-
-«DEFINE gotoMarker FOR gmfgen::GenEditorView-»
- «EXPAND xpt::Common::generatedMemberComment»
-public void gotoMarker(org.eclipse.core.resources.IMarker marker) {
- org.eclipse.gmf.runtime.common.ui.services.marker.MarkerNavigationService.getInstance().gotoMarker(this, marker);
-}
-«ENDDEFINE»
-
-«DEFINE isSaveAsAllowed FOR gmfgen::GenEditorView-»
- «EXPAND xpt::Common::generatedMemberComment»
-public boolean isSaveAsAllowed() {
- return true;
-}
-«ENDDEFINE»
-
-«DEFINE doSaveAs FOR gmfgen::GenEditorView-»
- «EXPAND xpt::Common::generatedMemberComment»
-public void doSaveAs() {
- performSaveAs(new org.eclipse.core.runtime.NullProgressMonitor());
-}
-«ENDDEFINE»
-
-«DEFINE getShowInContext FOR gmfgen::GenEditorView-»
- «EXPAND xpt::Common::generatedMemberComment»
-public org.eclipse.ui.part.ShowInContext getShowInContext() {
- return new org.eclipse.ui.part.ShowInContext(getEditorInput(), «IF hasNavigator(self)»getNavigatorSelection()«ELSE»getGraphicalViewer().getSelection()«ENDIF»);
-}
-«ENDDEFINE»
-«DEFINE getNavigatorSelection FOR gmfgen::GenNavigator-»
-
- «EXPAND xpt::Common::generatedMemberComment»
-private org.eclipse.jface.viewers.ISelection getNavigatorSelection() {
- org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument document = getDiagramDocument();
- «EXPAND xpt::navigator::NavigatorLinkHelper::findSelectionBody-»
-}
-«ENDDEFINE»
-«DEFINE configureGraphicalViewer FOR gmfgen::GenEditorView-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void configureGraphicalViewer() {
- super.configureGraphicalViewer();
- «EXPAND xpt::editor::DiagramEditorContextMenuProvider::qualifiedClassName FOR editorGen.diagram» provider =
- new «EXPAND xpt::editor::DiagramEditorContextMenuProvider::qualifiedClassName FOR editorGen.diagram»(this, getDiagramGraphicalViewer());
- getDiagramGraphicalViewer().setContextMenu(provider);
- getSite().registerContextMenu(org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds.DIAGRAM_EDITOR_CONTEXT_MENU, provider, getDiagramGraphicalViewer());
- }
-«ENDDEFINE»
-
-«DEFINE DropTargetListener FOR gmfgen::GenEditorView-»
- «EXPAND xpt::Common::generatedClassComment»
-private abstract class DropTargetListener extends org.eclipse.gmf.runtime.diagram.ui.parts.DiagramDropTargetListener {
-
- «EXPAND DTL_constructor-»
-
- «EXPAND DTL_getObjectsBeingDropped-»
-
- «EXPAND DTL_getJavaObject-»
-
- «EXPAND DTL_additions-»
-}
-«ENDDEFINE»
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/plugin/Activator.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/plugin/Activator.xpt
deleted file mode 100644
index 2996685cf1a..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/plugin/Activator.xpt
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * Copyright (c) 2007, 2009 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/2009/GenModel'»
-
-«DEFINE Activator FOR gmfgen::GenPlugin-»
-«EXPAND xpt::Common::copyright FOR editorGen-»
-package «editorGen.editor.packageName»;
-
-«EXPAND xpt::Common::generatedClassComment»
-public class «activatorClassName» extends org.eclipse.ui.plugin.AbstractUIPlugin {
-
- «EXPAND xpt::Common::generatedMemberComment»
- public static final String ID = "«iD»"; //$NON-NLS-1$
-
- «EXPAND xpt::Common::generatedMemberComment»
- public static final org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint DIAGRAM_PREFERENCES_HINT =
- new org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint(ID);
-
- «EXPAND xpt::Common::generatedMemberComment»
- private static «activatorClassName» instance;
-
- «EXPAND xpt::Common::generatedMemberComment»
- private org.eclipse.emf.edit.provider.ComposedAdapterFactory adapterFactory;
-
- «EXPAND xpt::Common::generatedMemberComment»
- private «editorGen.diagram.getDocumentProviderQualifiedClassName()» documentProvider;
-
-«IF editorGen.diagram.links->exists(not sansDomain)-»
- «EXPAND xpt::Common::generatedMemberComment»
- private «editorGen.diagram.getLinkCreationConstraintsQualifiedClassName()» linkConstraints;
-
-«ENDIF-»
-
- «EXPAND xpt::Common::generatedMemberComment»
- private «editorGen.diagram.getElementInitializersPackageName()».«editorGen.diagram.getElementInitializersClassName()» initializers;
-
-«IF not editorGen.expressionProviders.oclIsUndefined() -»
-«FOREACH editorGen.expressionProviders.providers[gmfgen::GenExpressionInterpreter] AS p-»
- «EXPAND xpt::Common::generatedMemberComment»
- private «p.getQualifiedClassName()» «p.language»Factory;
-«ENDFOREACH-»
-«ENDIF-»
-
- «EXPAND xpt::Common::generatedMemberComment»
- public «activatorClassName»() {
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- public void start(org.osgi.framework.BundleContext context) throws Exception {
- super.start(context);
- instance = this;
- org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint.registerPreferenceStore(DIAGRAM_PREFERENCES_HINT, getPreferenceStore());
- adapterFactory = createAdapterFactory();
- «self.editorGen.diagram.preferencesPackageName».DiagramPreferenceInitializer diagramPreferenceInitializer = new «self.editorGen.diagram.preferencesPackageName».DiagramPreferenceInitializer();
- diagramPreferenceInitializer.initializeDefaultPreferences();
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- public void stop(org.osgi.framework.BundleContext context) throws Exception {
- adapterFactory.dispose();
- adapterFactory = null;
-«IF editorGen.diagram.links->exists(not sansDomain)-»
- linkConstraints = null;
-«ENDIF-»
- initializers = null;
-«IF not editorGen.expressionProviders.oclIsUndefined() -»
-«FOREACH editorGen.expressionProviders.providers[gmfgen::GenExpressionInterpreter] AS p-»
- «p.language»Factory = null;
-«ENDFOREACH-»
-«ENDIF-»
- instance = null;
- super.stop(context);
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- public static «activatorClassName» getInstance() {
- return instance;
- }
- «EXPAND xpt::Common::generatedMemberComment»
- public org.eclipse.jface.preference.IPreferenceStore getPreferenceStore() {
- org.eclipse.jface.preference.IPreferenceStore store=org.eclipse.papyrus.infra.gmfdiag.preferences.Activator.getDefault().getPreferenceStore();
- return store;
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.emf.edit.provider.ComposedAdapterFactory createAdapterFactory() {
- «EXPAND CodeStyle::newGenericInstance('factories', 'java.util.ArrayList', 'org.eclipse.emf.common.notify.AdapterFactory') FOR editorGen.diagram»();
- fillItemProviderFactories(factories);
- return new org.eclipse.emf.edit.provider.ComposedAdapterFactory(factories);
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- protected void fillItemProviderFactories(«EXPAND CodeStyle::G('java.util.List', 'org.eclipse.emf.common.notify.AdapterFactory') FOR editorGen.diagram» factories) {
-«EXPAND MetaModel::PopulateItemProviderFactories('factories') FOR editorGen-»
- factories.add(new org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory());
- factories.add(new org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory());
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- public org.eclipse.emf.common.notify.AdapterFactory getItemProvidersAdapterFactory() {
- return adapterFactory;
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- public org.eclipse.jface.resource.ImageDescriptor getItemImageDescriptor(Object item) {
- org.eclipse.emf.edit.provider.IItemLabelProvider labelProvider =
- (org.eclipse.emf.edit.provider.IItemLabelProvider) adapterFactory.adapt(
- item, org.eclipse.emf.edit.provider.IItemLabelProvider.class);
- if (labelProvider != null) {
- return org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry.getInstance().getImageDescriptor(
- labelProvider.getImage(item));
- }
- return null;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path.
- *
- * @generated
- * @param path the path
- * @return the image descriptor
- */
- public static org.eclipse.jface.resource.ImageDescriptor getBundledImageDescriptor(String path) {
- return org.eclipse.ui.plugin.AbstractUIPlugin.imageDescriptorFromPlugin(ID, path);
- }
-
- /**
- * Respects images residing in any plug-in. If path is relative,
- * then this bundle is looked up for the image, otherwise, for absolute
- * path, first segment is taken as id of plug-in with image
- *
- * @generated
- * @param path the path to image, either absolute (with plug-in id as first segment), or relative for bundled images
- * @return the image descriptor
- */
- public static org.eclipse.jface.resource.ImageDescriptor findImageDescriptor(String path) {
- final org.eclipse.core.runtime.IPath p = new org.eclipse.core.runtime.Path(path);
- if (p.isAbsolute() && p.segmentCount() > 1) {
- return org.eclipse.ui.plugin.AbstractUIPlugin.imageDescriptorFromPlugin(
- p.segment(0), p.removeFirstSegments(1).makeAbsolute().toString());
- } else {
- return getBundledImageDescriptor(p.makeAbsolute().toString());
- }
- }
-
- /**
- * Returns an image for the image file at the given plug-in relative path.
- * Client do not need to dispose this image. Images will be disposed automatically.
- *
- * @generated
- * @param path the path
- * @return image instance
- */
- public org.eclipse.swt.graphics.Image getBundledImage(String path) {
- org.eclipse.swt.graphics.Image image = getImageRegistry().get(path);
- if (image == null) {
- getImageRegistry().put(path, getBundledImageDescriptor(path));
- image = getImageRegistry().get(path);
- }
- return image;
- }
-
- /**
- * Returns string from plug-in's resource bundle
- *
- * @generated
- */
- public static String getString(String key) {
- return org.eclipse.core.runtime.Platform.getResourceString(
- getInstance().getBundle(), "%" + key); //$NON-NLS-1$
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- public «editorGen.diagram.getDocumentProviderQualifiedClassName()» getDocumentProvider() {
- if (documentProvider == null) {
- documentProvider = new «editorGen.diagram.getDocumentProviderQualifiedClassName()»();
- }
- return documentProvider;
- }
-
-«IF editorGen.diagram.links->exists(not sansDomain) -»
- «EXPAND xpt::Common::generatedMemberComment»
- public «editorGen.diagram.getLinkCreationConstraintsQualifiedClassName()» getLinkConstraints() {
- return linkConstraints;
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- public void setLinkConstraints(«editorGen.diagram.getLinkCreationConstraintsQualifiedClassName()» lc) {
- this.linkConstraints = lc;
- }
-
-«ENDIF-»
- «EXPAND xpt::Common::generatedMemberComment»
- public «editorGen.diagram.getElementInitializersPackageName()».«editorGen.diagram.getElementInitializersClassName()» getElementInitializers() {
- return initializers;
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- public void setElementInitializers(«editorGen.diagram.getElementInitializersPackageName()».«editorGen.diagram.getElementInitializersClassName()» i) {
- this.initializers = i;
- }
-
-«IF not editorGen.expressionProviders.oclIsUndefined() -»
-«FOREACH editorGen.expressionProviders.providers[gmfgen::GenExpressionInterpreter] AS p-»
- «EXPAND xpt::Common::generatedMemberComment»
- public «p.getQualifiedClassName()» get«p.className»() {
- return «p.language»Factory;
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- public void set«p.className»(«p.getQualifiedClassName()» f) {
- this.«p.language»Factory = f;
- }
-
-«ENDFOREACH-»
-«ENDIF-»
-
- «EXPAND xpt::Common::generatedMemberComment»
- public void logError(String error) {
- logError(error, null);
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- public void logError(String error, Throwable throwable) {
- if (error == null && throwable != null) {
- error = throwable.getMessage();
- }
- getLog().log(new org.eclipse.core.runtime.Status(
- org.eclipse.core.runtime.IStatus.ERROR,
- «activatorClassName».ID,
- org.eclipse.core.runtime.IStatus.OK,
- error, throwable));
- debug(error, throwable);
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- public void logInfo(String message) {
- logInfo(message, null);
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- public void logInfo(String message, Throwable throwable) {
- if (message == null && throwable != null) {
- message = throwable.getMessage();
- }
- getLog().log(new org.eclipse.core.runtime.Status(
- org.eclipse.core.runtime.IStatus.INFO,
- «activatorClassName».ID,
- org.eclipse.core.runtime.IStatus.OK,
- message, throwable));
- debug(message, throwable);
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- private void debug(String message, Throwable throwable) {
- if (!isDebugging()) {
- return;
- }
- if (message != null) {
- System.err.println(message);
- }
- if (throwable != null) {
- throwable.printStackTrace();
- }
- }
- «EXPAND additions-»
-}
-«ENDDEFINE»
-
-// Perhaps, xpt:editor::Editor or some xpt::CommonCode would be better place for
-// this accessor.
-// XXX besides, consider using preference store directly, without a hint (see comment in Editor.xpt#getPreferencesHint)
-«DEFINE preferenceHintAccess FOR gmfgen::GenEditorGenerator»«plugin.getActivatorQualifiedClassName()».DIAGRAM_PREFERENCES_HINT«ENDDEFINE»
-
-«DEFINE additions FOR gmfgen::GenPlugin»«ENDDEFINE»
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/plugin/manifest.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/plugin/manifest.xpt
deleted file mode 100644
index 3d15b4ed920..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/plugin/manifest.xpt
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2007, 2009 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
- * Thibault Landre (Atos Origin) - add Papyrus dependencies to Papyrus GMF diagram*
- * Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr : add the dependencyorg.eclipse.papyrus.infra.services.edit
- */
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/emf/2002/Ecore'»
-«IMPORT 'http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension'»
-«EXTENSION xpt::diagram::Utils»
-
-«DEFINE manifest FOR gmfgen::GenPlugin-»
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: «iD»; singleton:=true
-Bundle-Version: «version»
-Bundle-ClassPath: .
-Bundle-Activator: «getActivatorQualifiedClassName()»
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: «editorGen.diagram.editPartsPackageName»,
- «editorGen.editor.packageName»,
- «editorGen.diagram.providersPackageName»
-Require-Bundle: org.eclipse.core.runtime,
-«IF editorGen.application = null-»
- org.eclipse.core.resources,
-«ENDIF-»
-«IF editorGen.diagram.generateShortcutIcon() or (editorGen.navigator <> null and editorGen.navigator.generateDomainModelNavigator)-»
- org.eclipse.core.expressions,
-«ENDIF-»
- org.eclipse.jface,
-«IF editorGen.application = null-»
- org.eclipse.ui.ide,
-«ENDIF-»
- org.eclipse.ui.views,
-«IF editorGen.navigator <> null-»
- org.eclipse.ui.navigator,
- org.eclipse.ui.navigator.resources,
-«ENDIF-»
- org.eclipse.emf.ecore,
- org.eclipse.emf.ecore.xmi,
- org.eclipse.emf.edit.ui,
- org.eclipse.gmf.runtime.emf.core,
- org.eclipse.gmf.runtime.emf.commands.core,
- org.eclipse.gmf.runtime.emf.ui.properties,
- org.eclipse.gmf.runtime.diagram.ui,
- org.eclipse.papyrus.uml.diagram.common,
- org.eclipse.papyrus.infra.gmfdiag.common,
- org.eclipse.papyrus.uml.service.types,
- org.eclipse.papyrus.infra.widgets,
-«IF printingEnabled-»
- org.eclipse.gmf.runtime.diagram.ui.printing,
- org.eclipse.gmf.runtime.diagram.ui.printing.render,
-«ENDIF-»
-«IF editorGen.propertySheet <> null-»
- org.eclipse.gmf.runtime.diagram.ui.properties,
-«ENDIF-»
- org.eclipse.gmf.runtime.diagram.ui.providers,
-«IF editorGen.application = null-»
- org.eclipse.gmf.runtime.diagram.ui.providers.ide,
-«ENDIF-»
- org.eclipse.gmf.runtime.diagram.ui.render,
- org.eclipse.gmf.runtime.diagram.ui.resources.editor,
-«IF editorGen.application = null-»
- org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide,
-«ENDIF-»
-«FOREACH getAllRequiredPlugins()->asSequence() AS id-»
- «id»;visibility:=reexport,
-«ENDFOREACH-»
- org.eclipse.gef,
- org.eclipse.papyrus.infra.gmfdiag.preferences,
- org.eclipse.papyrus.extensionpoints.editors
-«IF papyrusgmfgenextension::EditPartUsingDeleteService.allInstances()->size()<>0 or papyrusgmfgenextension::EditPartUsingReorientService.allInstances()->size()<>0-»
- ,org.eclipse.papyrus.infra.services.edit
-«ENDIF-»
-Eclipse-LazyStart: true
-«ENDDEFINE» \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/plugin/plugin.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/plugin/plugin.xpt
deleted file mode 100644
index 3f759357173..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/plugin/plugin.xpt
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
- * Copyright (c) 2007, 2009 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
- * Thibault Landre (Atos Origin) - initial API and implementation
- */
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/emf/2002/Ecore'»
-«IMPORT 'http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension'»
-«EXTENSION xpt::diagram::Utils»
-«EXTENSION xpt::GenEditorGenerator»
-
-«EXTENSION xpt::preferences::PrefsConstant»
-«EXTENSION xpt::editor::palette::Utils»
-
-«DEFINE category FOR gmfgen::GenDiagram»«getDiagramPreferencePageCategory()».«editorGen.modelID»«ENDDEFINE»
-
-
-
-«AROUND plugin FOR gmfgen::GenPlugin-»
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-«EXPAND xpt::Common::xcopyright FOR editorGen-»
-<plugin>
-«REM»YT (not used): «EXPAND fileTypes-»«ENDREM»
-«REM»YT (not used): «EXPAND extension_parser-»«ENDREM»
-«EXPAND xpt::editor::extensions::extensions FOR editorGen-»
-«REM» global actions handled in the diagram.common plugin
-«EXPAND xpt::plugin::plugin::menu-»«ENDREM»
-«EXPAND xpt::plugin::plugin::validation FOR editorGen.diagram-»
-«EXPAND xpt::plugin::plugin::metrics FOR editorGen.metrics-»
-«REM»RS: redefine palette generation«ENDREM»
-«EXPAND palettePredefinedEntries FOR editorGen-»
-«EXPAND paletteEntries FOR editorGen-»
-«EXPAND xpt::diagram::preferences::extensions::extensions FOR editorGen.diagram-»
-«EXPAND xpt::propsheet::extensions::extensions FOR editorGen.propertySheet-»
-«EXPAND preferencePages FOR editorGen.diagram-»
-«EXPAND preferencePageInitializer FOR editorGen.diagram-»
-«EXPAND xpt::providers::extensions::extensions FOR editorGen.diagram-»
-«EXPAND xpt::navigator::extensions::extensions FOR editorGen.navigator-»
-«EXPAND xpt::application::extensions::extensions FOR editorGen.application-»
-«EXPAND xpt::ConstraintProviders::extensions FOR editorGen-»
-«EXPAND xpt::diagram::updater::extensions::extensions FOR editorGen.diagramUpdater-»
-«EXPAND impl::actions::extensions::Main FOR editorGen-»
-«EXPAND xpt::plugin::plugin::additions-»
-«EXPAND xpt::plugin::plugin::notationTypesMap FOR editorGen»
-</plugin>
-«ENDAROUND»
-
-«DEFINE fileTypes FOR gmfgen::GenPlugin»
- <extension point="org.eclipse.team.core.fileTypes" id="repo-ftype">
- «EXPAND xpt::Common::xmlGeneratedTag»
- <fileTypes type="text" extension="«editorGen.diagramFileExtension»"/>
- </extension>
-«ENDDEFINE»
-
-«DEFINE extension_parser FOR gmfgen::GenPlugin»
- <extension point="org.eclipse.emf.ecore.extension_parser" id="resource-factory">
- «EXPAND xpt::Common::xmlGeneratedTag»
- <parser
- type="«editorGen.diagramFileExtension»"
- class="org.eclipse.gmf.runtime.emf.core.resources.GMFResourceFactory">
- </parser>
- </extension>
-«ENDDEFINE»
-
-«DEFINE menu FOR gmfgen::GenPlugin»
- <extension point="org.eclipse.gmf.runtime.common.ui.services.action.globalActionHandlerProviders" id="global-actions">
- «EXPAND xpt::Common::xmlGeneratedTag»
- <GlobalActionHandlerProvider
- class="org.eclipse.papyrus.uml.diagram.common.providers.PapyrusGlobalActionHandlerProvider"
- id="«editorGen.modelID»Presentation">
- <Priority name="Highest"/>
- <ViewId id="org.eclipse.papyrus.infra.core.papyrusEditor">
- <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
- <GlobalActionId actionId="delete"/>
- </ElementType>
- <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart">
- <GlobalActionId actionId="save"/>
- </ElementType>
- </ViewId>
- </GlobalActionHandlerProvider>
-«IF printingEnabled-»
- <GlobalActionHandlerProvider
- class="org.eclipse.gmf.runtime.diagram.ui.printing.render.providers.DiagramWithPrintGlobalActionHandlerProvider"
- id="«editorGen.modelID»PresentationPrint">
- <Priority name="Low"/>
- <ViewId id="org.eclipse.papyrus.infra.core.papyrusEditor">
- <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
- <GlobalActionId actionId="print"/>
- </ElementType>
- </ViewId>
- </GlobalActionHandlerProvider>
-«ENDIF-»
-«IF null = editorGen.application-»
- <GlobalActionHandlerProvider
- class="org.eclipse.gmf.runtime.diagram.ui.providers.ide.providers.DiagramIDEGlobalActionHandlerProvider"
- id="«editorGen.modelID»PresentationIDE">
- <Priority name="Low"/>
- <ViewId id="org.eclipse.papyrus.infra.core.papyrusEditor">
- <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
- <GlobalActionId actionId="bookmark"/>
- </ElementType>
- </ViewId>
- </GlobalActionHandlerProvider>
-«ENDIF-»
- <GlobalActionHandlerProvider
- class="org.eclipse.papyrus.uml.diagram.common.providers.PapyrusGlobalActionHandlerProvider"
- id="«editorGen.modelID»Render">
- <Priority name="Highest"/>
- <ViewId id="org.eclipse.papyrus.infra.core.papyrusEditor">
- <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
- <GlobalActionId actionId="cut"/>
- <GlobalActionId actionId="copy"/>
- <GlobalActionId actionId="paste"/>
- </ElementType>
- </ViewId>
- </GlobalActionHandlerProvider>
- </extension>
-
-«ENDDEFINE»
-
-«DEFINE metrics FOR gmfgen::GenMetricContainer-»
-«IF metrics->size() > 0»
- <extension id="metrics-view" point="org.eclipse.ui.views">
- «EXPAND xpt::Common::xmlGeneratedTag»
- <view class="«editorGen.diagram.getMetricProviderQualifiedClassName()»$ResultView"
- id="«editorGen.diagram.getMetricViewID()»"
- name="«editorGen.modelID» Diagram Metrics"/>
- </extension>
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE validation FOR gmfgen::GenDiagram-»
-«IF validationEnabled or hasAudits(editorGen)-»
-«IF null = editorGen.application-»
-
- <extension point="org.eclipse.gmf.runtime.common.ui.services.markerNavigationProviders" id="markers-navigation">
- «EXPAND xpt::Common::xmlGeneratedTag»
- <MarkerNavigationProvider class="«getMarkerNavigationProviderQualifiedClassName()»">
- <MarkerType name="«editorGen.plugin.iD + '.' + getValidationDiagnosticMarkerType()»"/>
- <Priority name="«markerNavigationProviderPriority»"/>
- </MarkerNavigationProvider>
- </extension>
-
- <extension id="«getValidationDiagnosticMarkerType()»" name="«editorGen.plugin.name» problems" point="org.eclipse.core.resources.markers">
- «EXPAND xpt::Common::xmlGeneratedTag»
- <super type="org.eclipse.core.resources.problemmarker"/>
- <super type="org.eclipse.gmf.runtime.common.ui.services.marker"/>
- <persistent value="true"/>
- </extension>
-«ENDIF-»
-«IF validationDecorators-»
-
- <extension id="validationDecoratorProvider" name="ValidationDecorations" point="org.eclipse.gmf.runtime.diagram.ui.decoratorProviders">
- «EXPAND xpt::Common::xmlGeneratedTag»
- <decoratorProvider class="«getValidationDecoratorProviderQualifiedClassName()»">
- <Priority name="«validationDecoratorProviderPriority»"/>
- <object class="org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart(org.eclipse.gmf.runtime.diagram.ui)" id="PRIMARY_VIEW"/>
- <context decoratorTargets="PRIMARY_VIEW"/>
- </decoratorProvider>
- </extension>
-«ENDIF-»
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE additions FOR gmfgen::GenPlugin»«ENDDEFINE»
-
-«DEFINE preferencePageInitializer FOR gmfgen::GenDiagram»
- <extension point="org.eclipse.core.runtime.preferences">
- «EXPAND xpt::Common::xmlGeneratedTag»
- <initializer class="«preferencesPackageName».DiagramPreferenceInitializer"/>
- </extension>
-«ENDDEFINE»
-
-«DEFINE preferencePages FOR gmfgen::GenDiagram»
-«REM»Generate Diagram Preference Page«ENDREM»
-«EXPAND xpt::Common::xmlGeneratedTag»
-<extension point="org.eclipse.ui.preferencePages">
-
-«REM»Generate Nodes Preference Pages«ENDREM»
-«FOREACH getAllNodes().elementType.displayName->asSet() AS node -»
- «EXPAND preferencePageNodeExtension(self) FOR node-»
-«ENDFOREACH»
-«REM»Generate Links Preference Pages«ENDREM»
-«FOREACH links.elementType.displayName->asSet() AS link -»
- «EXPAND preferencePageLinkExtension(self) FOR link-»
-«ENDFOREACH»
-</extension>
-«ENDDEFINE»
-
-«DEFINE preferencePageNodeExtension(gmfgen::GenDiagram diagram) FOR String-»
-«IF 'UNDEFINED' <> self.toUpper()»
- «EXPAND xpt::Common::xmlGeneratedTag»
- <page category="«EXPAND category FOR diagram»"
- class="«diagram.preferencesPackageName».«self»«getPreferencePageSuffix()»"
- id="«diagram.preferencesPackageName».«self»«getPreferencePageSuffix()»"
- name="«self» Node" />
-«ENDIF»
-«ENDDEFINE»
-«DEFINE preferencePageLinkExtension(gmfgen::GenDiagram diagram) FOR String-»
-
-«IF 'UNDEFINED' <> self.toUpper()»
- «EXPAND xpt::Common::xmlGeneratedTag»
- <page category="«EXPAND category FOR diagram»"
- class="«diagram.preferencesPackageName».«self»«getPreferencePageSuffix()»"
- id="«diagram.preferencesPackageName».«self»«getPreferencePageSuffix()»"
- name="«self» Link" />
-«ENDIF»
-«ENDDEFINE»
-«DEFINE preferencePageExtension(gmfgen::GenDiagram diagram) FOR gmfgen::GenLink-»
-«IF "UNDEFINED" <> self.elementType.displayName.toUpper()»
- «EXPAND xpt::Common::xmlGeneratedTag»
- <page category="«EXPAND category FOR diagram»"
- class="«diagram.preferencesPackageName».«self»«getPreferencePageSuffix()»"
- id="«diagram.preferencesPackageName».«self»«getPreferencePageSuffix()»"
- name="«self.elementType.displayName» Link" />
-«ENDIF»
-«ENDDEFINE»
-
-«REM»RS: redefine palette generation, using predefined entries«ENDREM»
-«DEFINE palettePredefinedEntries FOR gmfgen::GenEditorGenerator»
- «EXPAND xpt::Common::xmlGeneratedTag»
- <extension
- id="«plugin.name».palettedefinition"
- name="«plugin.name» Predefined Entries"
- point="org.eclipse.gmf.runtime.diagram.ui.paletteProviders">
-
- «EXPAND xpt::Common::xmlGeneratedTag»
- <paletteProvider class="org.eclipse.gmf.runtime.diagram.ui.providers.DefaultPaletteProvider">
- <Priority name="Lowest"/>
- <contribution
- factoryClass="«self.diagram.palette.packageName».«self.diagram.palette.factoryClassName»">
- <predefinedEntry id="standardGroup/noteStack/noteTool" remove="true"/>
- <predefinedEntry id="standardGroup/noteStack/textTool" remove="true"/>
- <predefinedEntry id="standardGroup/noteStack/noteattachmentTool" remove="true"/>
- «EXPAND predefinedEntryDefinition FOREACH collectTools(diagram.palette)»
- </contribution>
- </paletteProvider>
-
- </extension>
-«ENDDEFINE»
-
-«DEFINE predefinedEntryDefinition FOR gmfgen::AbstractToolEntry-»
- <entry
- defineOnly="true"
- description="«self.description»"
- id=«IF id.isQuoted('\"')»«id»«ELSE»"«id»"«ENDIF»
- kind="tool"
- label="«self.title»"
- large_icon="«largeIconPath»"
- path=""
- small_icon="«smallIconPath»">
- </entry>
-«ENDDEFINE»
-
-«REM»RS: redefine palette generation, using predefined entries«ENDREM»
-«DEFINE paletteEntries FOR gmfgen::GenEditorGenerator»
- «EXPAND xpt::Common::xmlGeneratedTag»
- <extension
- id="«plugin.name».standard"
- name="«plugin.name» Standard Palette"
- point="org.eclipse.gmf.runtime.diagram.ui.paletteProviders">
-
- «EXPAND xpt::Common::xmlGeneratedTag»
- <paletteProvider class="org.eclipse.gmf.runtime.diagram.ui.providers.DefaultPaletteProvider">
- <Priority name="Low"/>
- <contribution
- factoryClass="«self.diagram.palette.packageName».«self.diagram.palette.factoryClassName»">
- <predefinedEntry id="standardGroup/noteStack/noteTool" remove="true"/>
- <predefinedEntry id="standardGroup/noteStack/textTool" remove="true"/>
- <predefinedEntry id="standardGroup/noteStack/noteattachmentTool" remove="true"/>
- «EXPAND groupUsage FOREACH collectGroups(diagram.palette)»
- </contribution>
- <editor id="«plugin.iD»"/>
- </paletteProvider>
-
- </extension>
-«ENDDEFINE»
-
-«DEFINE groupUsage FOR gmfgen::ToolGroup-»
- <entry
- description="«self.description»"
- id=«IF id.isQuoted('\"')»«id»«ELSE»"«id»"«ENDIF»
- kind="drawer"
- label="«self.title»"
- large_icon="«largeIconPath»"
- path="/"
- small_icon="«smallIconPath»">
- <expand
- force="true">
- </expand>
- </entry>
- «REM» TODO: call sub entries...«ENDREM»
- «EXPAND toolUsage(self) FOREACH self.entries»
-«ENDDEFINE»
-
-«DEFINE toolUsage (gmfgen::ToolGroup group) FOR gmfgen::ToolEntry-»
- <predefinedEntry
- id=«IF id.isQuoted('\"')»«id»«ELSE»"«id»"«ENDIF»
- path="«group.id.getToolPath()»">
- </predefinedEntry>
-«ENDDEFINE»
-
-«DEFINE notationTypesMap FOR gmfgen::GenEditorGenerator»
- <extension point="org.eclipse.papyrus.infra.gmfdiag.common.notationTypesMapping">
- <diagramMappings diagramID="«modelID»">
- <mapping type="«modelID»" humanReadableType="«modelID.replaceAll('Papyrus|UML|Diagram', '')»Diagram"/>
- «EXPAND compartmentToTypeMap FOREACH diagram.compartments»
- «EXPAND linksToTypeMap FOREACH diagram.links»
- </diagramMappings>
- </extension>
-«ENDDEFINE»
-
-«DEFINE linksToTypeMap FOR gmfgen::GenLink»
- «EXPAND linkLabelToTypeMap FOREACH labels»
-«ENDDEFINE»
-
-«DEFINE linkLabelToTypeMap FOR gmfgen::GenLinkLabel»«IF papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->exists(linkLabels->includes(self))»
- <mapping
- humanReadableType="«papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label : papyrusgmfgenextension::LabelVisibilityPreference | label.linkLabels->includes(self))->asSequence()->first().role»"
- type="«visualID»">
- </mapping>
-«ENDIF»«ENDDEFINE»
-
-«DEFINE compartmentToTypeMap FOR gmfgen::GenCompartment»
- <mapping
- humanReadableType="«title.replaceAll('Compartment', '')»"
- type="«visualID»">
- </mapping>
-«ENDDEFINE»
-
-
-
-
-
-
-
-
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/providers/ViewProvider.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/providers/ViewProvider.xpt
deleted file mode 100644
index ca7aefa4505..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/providers/ViewProvider.xpt
+++ /dev/null
@@ -1,686 +0,0 @@
-/*
- * Copyright (c) 2009 Atos Origin
- *
- * 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:
- * Thibault Landre (Atos Origin) - initial API and implementation
- * Vincent Lorenzo (CEA-LIST) Add a line to initialize the display of the compartments to true
- * Vincent Lorenzo (CEA-LIST) - Add lines to initialize the display of the labels - Bug 335987 [General][Enhancement] Show/Hide Connectors Labels and External Nodes Labels
- */
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/emf/2002/Ecore'»
-«IMPORT 'http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension'»
-
-«EXTENSION xpt::preferences::PrefsConstant»
-«EXTENSION xpt::diagram::Utils»
-«EXTENSION xpt::diagram::ViewmapAttributesUtils»
-«EXTENSION xpt::diagram::editpolicies::LinkUtils»
-
-
-«AROUND ViewProvider FOR gmfgen::GenDiagram-»
-«EXPAND xpt::Common::copyright FOR getDiagram().editorGen-»
-package «providersPackageName»;
-
-«EXPAND xpt::Common::generatedClassComment»
-public class «notationViewProviderClassName»«EXPAND xpt::providers::ViewProvider::extendsList»«EXPAND xpt::providers::ViewProvider::implementsList» {
-
- «EXPAND xpt::Common::generatedMemberComment»
- public final boolean provides(org.eclipse.gmf.runtime.common.core.service.IOperation operation) {
- if (operation instanceof org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewForKindOperation) {
- return provides((org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewForKindOperation) operation);
- }
- «EXPAND xpt::Common::_assert('operation instanceof org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewOperation')-»
- if (operation instanceof org.eclipse.gmf.runtime.diagram.core.services.view.CreateDiagramViewOperation) {
- return provides((org.eclipse.gmf.runtime.diagram.core.services.view.CreateDiagramViewOperation) operation);
- } else if (operation instanceof org.eclipse.gmf.runtime.diagram.core.services.view.CreateEdgeViewOperation) {
- return provides((org.eclipse.gmf.runtime.diagram.core.services.view.CreateEdgeViewOperation) operation);
- } else if (operation instanceof org.eclipse.gmf.runtime.diagram.core.services.view.CreateNodeViewOperation) {
- return provides((org.eclipse.gmf.runtime.diagram.core.services.view.CreateNodeViewOperation) operation);
- }
- return false;
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- protected boolean provides(org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewForKindOperation op) {
-/*
- if (op.getViewKind() == Node.class)
- return getNodeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null;
- if (op.getViewKind() == Edge.class)
- return getEdgeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null;
-*/
-
- // check Diagram Type should be the class diagram
- String modelID = «EXPAND xpt::editor::VisualIDRegistry::getModelIDMethodCall»(op.getContainerView());
- if(!getDiagramProvidedId().equals(modelID)) {
- return false;
- }
-
- int visualID = «EXPAND xpt::editor::VisualIDRegistry::getVisualIDMethodCall»(op.getSemanticHint());
- if(org.eclipse.gmf.runtime.notation.Node.class.isAssignableFrom(op.getViewKind())) {
- return «EXPAND xpt::editor::VisualIDRegistry::canCreateNodeMethodCall»(op.getContainerView(), visualID);
- }
-
- return true;
- }
-
-
-«EXPAND xpt::Common::generatedMemberComment»
- protected String getDiagramProvidedId() {
- /*
- * Indicates for which diagram this provider works for.
- * <p>
- * This method can be overloaded when diagram editor inherits from another one, but should never be <code>null</code>
- * </p>
- *
- * @return the unique identifier of the diagram for which views are provided.
- */
- return «EXPAND xpt::editor::VisualIDRegistry::modelID»;
- }
-
-
- «EXPAND xpt::Common::generatedMemberComment»«REM»When diagram domain element is null only diagram kind is checked«ENDREM»
- protected boolean provides(org.eclipse.gmf.runtime.diagram.core.services.view.CreateDiagramViewOperation op) {
- return «EXPAND xpt::editor::VisualIDRegistry::modelID».equals(op.getSemanticHint())«IF domainDiagramElement <> null» && «EXPAND xpt::editor::VisualIDRegistry::getDiagramVisualIDMethodCall»(getSemanticElement(op.getSemanticAdapter())) != -1«ENDIF»;
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- protected boolean provides(org.eclipse.gmf.runtime.diagram.core.services.view.CreateNodeViewOperation op) {
- if (op.getContainerView() == null) {
- return false;
- }
- org.eclipse.gmf.runtime.emf.type.core.IElementType elementType = getSemanticElementType(op.getSemanticAdapter());
- org.eclipse.emf.ecore.EObject domainElement = getSemanticElement(op.getSemanticAdapter());
- int visualID;
- if (op.getSemanticHint() == null) {
- // Semantic hint is not specified. Can be a result of call from CanonicalEditPolicy.
- // In this situation there should be NO elementType, visualID will be determined
- // by VisualIDRegistry.getNodeVisualID() for domainElement.
- if (elementType != null || domainElement == null) {«REM»XXX Perhaps, better to fix CanonicalEP instead of this hack?«ENDREM»
- return false;
- }
- visualID = «EXPAND xpt::editor::VisualIDRegistry::getNodeVisualIDMethodCall»(op.getContainerView(), domainElement);
- } else {
- visualID = «EXPAND xpt::editor::VisualIDRegistry::getVisualIDMethodCall»(op.getSemanticHint());
- if (elementType != null) {«REM»
- Semantic hint is specified together with element type.
- Both parameters should describe exactly the same diagram element.
- In addition we check that visualID returned by VisualIDRegistry.getNodeVisualID() for
- domainElement (if specified) is the same as in element type.«ENDREM»
- if(elementType instanceof org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType) {
- org.eclipse.gmf.runtime.emf.type.core.IElementType closestNonExtendedType = org.eclipse.papyrus.infra.extendedtypes.util.ElementTypeUtils.getClosestDiagramType(elementType);
- if(!«getElementTypesQualifiedClassName()».isKnownElementType(closestNonExtendedType) || (!(closestNonExtendedType instanceof org.eclipse.gmf.runtime.emf.type.core.IHintedType))) {
- return false; // foreign element type.
- }
- } else {
- if (!«getElementTypesQualifiedClassName()».isKnownElementType(elementType) || (!(elementType instanceof org.eclipse.gmf.runtime.emf.type.core.IHintedType))) {
- return false; // foreign element type
- }
- }
- String elementTypeHint = ((org.eclipse.gmf.runtime.emf.type.core.IHintedType) elementType).getSemanticHint();
- if (!op.getSemanticHint().equals(elementTypeHint)) {
- return false; // if semantic hint is specified it should be the same as in element type
- }
- if (domainElement != null && visualID != «EXPAND xpt::editor::VisualIDRegistry::getNodeVisualIDMethodCall»(op.getContainerView(), domainElement)) {
- return false; // visual id for node EClass should match visual id from element type
- }
- } else {«REM»
- Element type is not specified. Domain element should be present (except pure design elements).
- This method is called with EObjectAdapter as parameter from:
- - ViewService.createNode(View container, EObject eObject, String type, PreferencesHint preferencesHint)
- - generated ViewFactory.decorateView() for parent element«ENDREM»
-«IF getAllTypedElements()->select(e | e.elementType <> null)->size() > 0-»
- if (!«EXPAND xpt::editor::VisualIDRegistry::modelID».equals(«EXPAND xpt::editor::VisualIDRegistry::getModelIDMethodCall»(op.getContainerView()))) {
- return false; // foreign diagram
- }
- switch (visualID) {
- «IF getAllNodes().elementType[gmfgen::NotationType]->size() > 0-»
- «EXPAND caseVisualID FOREACH getAllNodes().elementType[gmfgen::NotationType]-»
- break; // pure design element
- «ENDIF-»
- «IF getAllNodes().elementType[gmfgen::MetamodelType]->size() > 0 or getAllNodes().elementType[gmfgen::SpecializationType]->size() > 0-»
- «EXPAND xpt::providers::ViewProvider::caseVisualID FOREACH getAllNodes().elementType[gmfgen::MetamodelType]-»
- «EXPAND xpt::providers::ViewProvider::caseVisualID FOREACH getAllNodes().elementType[gmfgen::SpecializationType]-»
- if (domainElement == null || visualID != «EXPAND xpt::editor::VisualIDRegistry::getNodeVisualIDMethodCall»(op.getContainerView(), domainElement)) {
- return false; // visual id in semantic hint should match visual id for domain element
- }
- break;«REM»FIXME: Perhaps, can return true or false right away, without any further check?«ENDREM»
- «ENDIF-»
- default:
- return false;
- }
-«ELSE-»
- return false;
-«ENDIF-»
- }
- }
- «IF papyrusgmfgenextension::GenerateUsingElementTypeCreationCommand.allInstances()->size()>0-»
- return «EXPAND xpt::editor::VisualIDRegistry::canCreateNodeMethodCall»(op.getContainerView(), visualID);
- «ELSE-»
- return «FOREACH getAllNodes() AS n SEPARATOR '||'»«EXPAND xpt::editor::VisualIDRegistry::visualID FOR n» == visualID«ENDFOREACH»;
- «ENDIF»
- }
-
- «EXPAND xpt::Common::generatedMemberComment»«REM»XXX: unlike createNode, we don't check op.containerView() for null here. On purpose?«ENDREM»
- protected boolean provides(org.eclipse.gmf.runtime.diagram.core.services.view.CreateEdgeViewOperation op) {
- org.eclipse.gmf.runtime.emf.type.core.IElementType elementType = getSemanticElementType(op.getSemanticAdapter());
- //RS: add code for extended types creation
- if(elementType instanceof org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType) {
- org.eclipse.gmf.runtime.emf.type.core.IElementType closestNonExtendedType = org.eclipse.papyrus.infra.extendedtypes.util.ElementTypeUtils.getClosestDiagramType(elementType);
- if(!«getElementTypesQualifiedClassName()».isKnownElementType(closestNonExtendedType) || (!(closestNonExtendedType instanceof org.eclipse.gmf.runtime.emf.type.core.IHintedType))) {
- return false; // foreign element type.
- }
- } else {
- if (!«getElementTypesQualifiedClassName()».isKnownElementType(elementType) || (!(elementType instanceof org.eclipse.gmf.runtime.emf.type.core.IHintedType))) {
- return false; // foreign element type
- }
- }
- //if (!«getElementTypesQualifiedClassName()».isKnownElementType(elementType) || (!(elementType instanceof org.eclipse.gmf.runtime.emf.type.core.IHintedType))) {
- // return false; // foreign element type
- //}
- // END R.S.
- String elementTypeHint = ((org.eclipse.gmf.runtime.emf.type.core.IHintedType) elementType).getSemanticHint();
- if (elementTypeHint == null || (op.getSemanticHint() != null && !elementTypeHint.equals(op.getSemanticHint()))) {
- return false; // our hint is visual id and must be specified, and it should be the same as in element type
- }
- int visualID = «EXPAND xpt::editor::VisualIDRegistry::getVisualIDMethodCall»(elementTypeHint);
- org.eclipse.emf.ecore.EObject domainElement = getSemanticElement(op.getSemanticAdapter());
- if (domainElement != null && visualID != «EXPAND xpt::editor::VisualIDRegistry::getLinkWithClassVisualIDMethodCall»(domainElement)) {
- return false; // visual id for link EClass should match visual id from element type
- }
- return true; «REM»Does it make sense to check visualID here, like we did for nodes?«ENDREM»
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- public org.eclipse.gmf.runtime.notation.Diagram createDiagram(org.eclipse.core.runtime.IAdaptable semanticAdapter, String diagramKind, org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint preferencesHint) {
- org.eclipse.gmf.runtime.notation.Diagram diagram = org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createDiagram();«REM»FIXME instantiate diagramRunTimeClass instead«ENDREM»
- diagram.getStyles().add(org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createDiagramStyle());
- «EXPAND xpt::diagram::views::Utils::addCustomStyles('diagram.getStyles()')-»
- diagram.setType(«EXPAND xpt::editor::VisualIDRegistry::modelID»);
- diagram.setElement(«IF domainDiagramElement <> null»getSemanticElement(semanticAdapter)«ELSE»null«ENDIF»);
-«IF units <> null-»
- diagram.setMeasurementUnit(org.eclipse.gmf.runtime.notation.MeasurementUnit.«units.toUpper()»_LITERAL);
-«ENDIF-»
-«IF styles->notEmpty()-»
- // initializeFromPreferences
- org.eclipse.jface.preferences.IPreferenceStore store = (org.eclipse.jface.preferences.IPreferenceStore) preferencesHint.getPreferenceStore();
- «EXPAND initializeStyles('diagram', 'store', false, false, false)-»
-«ENDIF-»
- return diagram;
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- public org.eclipse.gmf.runtime.notation.Node createNode(org.eclipse.core.runtime.IAdaptable semanticAdapter, org.eclipse.gmf.runtime.notation.View containerView, String semanticHint, int index, boolean persisted, org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint preferencesHint) {
- final org.eclipse.emf.ecore.EObject domainElement = getSemanticElement(semanticAdapter);
- final int visualID;
- if (semanticHint == null) {
- visualID = «EXPAND xpt::editor::VisualIDRegistry::getNodeVisualIDMethodCall»(containerView, domainElement);
- } else {
- visualID = «EXPAND xpt::editor::VisualIDRegistry::getVisualIDMethodCall»(semanticHint);
- }
- switch(visualID) {
- «FOREACH getAllNodes() AS n-»
- «EXPAND xpt::Common::caseVisualID FOR n» return create«n.getUniqueIdentifier()»(domainElement, containerView, index, persisted, preferencesHint);
- «ENDFOREACH-»
- }
- // can't happen, provided #provides(CreateNodeViewOperation) is correct
- return null;
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- public org.eclipse.gmf.runtime.notation.Edge createEdge(org.eclipse.core.runtime.IAdaptable semanticAdapter, org.eclipse.gmf.runtime.notation.View containerView, String semanticHint, int index, boolean persisted, org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint preferencesHint) {
- org.eclipse.gmf.runtime.emf.type.core.IElementType elementType = getSemanticElementType(semanticAdapter);
- String elementTypeHint = ((org.eclipse.gmf.runtime.emf.type.core.IHintedType) elementType).getSemanticHint();
- switch («EXPAND xpt::editor::VisualIDRegistry::getVisualIDMethodCall»(elementTypeHint)) {
- «FOREACH links AS link-»
- «EXPAND xpt::Common::caseVisualID FOR link» return create«link.getUniqueIdentifier()»(«IF link.isTypeLink()» getSemanticElement(semanticAdapter), «ENDIF»containerView, index, persisted, preferencesHint);
- «ENDFOREACH-»
- }
- // can never happen, provided #provides(CreateEdgeViewOperation) is correct
- return null;
- }
-
-«EXPAND xpt::providers::ViewProvider::createNodeMethod FOREACH getAllNodes()»
-«EXPAND xpt::providers::ViewProvider::createEdgeMethod FOREACH links»
-
-«IF topLevelNodes->notEmpty()»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void stampShortcut(org.eclipse.gmf.runtime.notation.View containerView, org.eclipse.gmf.runtime.notation.Node target) {
- if (!«EXPAND xpt::editor::VisualIDRegistry::modelID».equals(«EXPAND xpt::editor::VisualIDRegistry::getModelIDMethodCall»(containerView))) {
- «EXPAND xpt::Common::addShortcutAnnotation('target')-»
- }
- }
-«ENDIF-»
-
-«IF links.labels->notEmpty() or topLevelNodes.labels->notEmpty() or childNodes.labels->notEmpty()»
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.gmf.runtime.notation.Node createLabel(org.eclipse.gmf.runtime.notation.View owner, String hint) {
- org.eclipse.gmf.runtime.notation.DecorationNode rv = org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createDecorationNode();
- rv.setType(hint);
- org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.insertChildView(owner, rv, org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.APPEND, true);
- return rv;
- }
-«ENDIF-»
-
-«IF getAllNodes().compartments->notEmpty()»
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.gmf.runtime.notation.Node createCompartment(org.eclipse.gmf.runtime.notation.View owner, String hint, boolean canCollapse, boolean hasTitle, boolean canSort, boolean canFilter) {
- //SemanticListCompartment rv = NotationFactory.eINSTANCE.createSemanticListCompartment();
- //rv.setShowTitle(showTitle);
- //rv.setCollapsed(isCollapsed);
- org.eclipse.gmf.runtime.notation.Node rv;
- if (canCollapse) {
- rv = org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createBasicCompartment();
- } else {
- rv = org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createDecorationNode();
- }
- rv.setLayoutConstraint(org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createBounds());
-
- if (hasTitle) {
- org.eclipse.gmf.runtime.notation.TitleStyle ts = org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createTitleStyle();
- rv.getStyles().add(ts);
- }
- if (canSort) {
- rv.getStyles().add(org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createSortingStyle());
- }
- if (canFilter) {
- rv.getStyles().add(org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createFilteringStyle());
- }
- rv.setType(hint);
- org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.insertChildView(owner, rv, org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.APPEND, true);
- return rv;
- }
-«ENDIF-»
- «EXPAND xpt::providers::ViewProvider::getSemanticElementMethod»
- «EXPAND xpt::providers::ViewProvider::getSemanticElementTypeMethod-»
- «EXPAND xpt::providers::ViewProvider::additions-»
-}
-«ENDAROUND»
-
-«DEFINE createNodeMethod FOR gmfgen::GenNode-»
- «EXPAND xpt::Common::generatedMemberComment»
- public org.eclipse.gmf.runtime.notation.Node create«getUniqueIdentifier()»(org.eclipse.emf.ecore.EObject domainElement, org.eclipse.gmf.runtime.notation.View containerView, int index, boolean persisted, org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint preferencesHint) {
-«IF viewmap.canUseShapeStyle()-»
- org.eclipse.gmf.runtime.notation.Shape node = org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createShape();
-«ELSE-»
- org.eclipse.gmf.runtime.notation.Node node = org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createShape();
- node.getStyles().add(org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createDescriptionStyle());«REM»FIXME Contionally add this style, whether toolsmith needs Notes or not«ENDREM»
- «EXPAND xpt::diagram::views::Utils::addFontLineFillStylesConditionally('node.getStyles()') FOR viewmap-»
-«ENDIF-»
- «EXPAND xpt::diagram::views::Utils::addLinkedDiagramStyle('node.getStyles()')-»
- «EXPAND xpt::diagram::views::Utils::addCustomStyles('node.getStyles()')-»
- node.setLayoutConstraint(org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createBounds());
- node.setType(«EXPAND xpt::editor::VisualIDRegistry::typeMethodCall»);
- org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
-«IF self.oclIsTypeOf(gmfgen::GenTopLevelNode)-»
- stampShortcut(containerView, node);
-«ENDIF-»
- // initializeFromPreferences «REM»XXX Perhaps, do init only once, for complete figure?«ENDREM»
- final org.eclipse.jface.preference.IPreferenceStore prefStore = (org.eclipse.jface.preference.IPreferenceStore) preferencesHint.getPreferenceStore();
- «EXPAND initializeStyles('node', 'prefStore', not viewmap.isFixedForeground(), not viewmap.isFixedBackground(), not viewmap.isFixedFont())-»
- «EXPAND initLabel('node', 'prefStore') FOREACH labels-»
- «EXPAND initCompartment('node', 'prefStore') FOREACH compartments-»
- «REM» BEGIN Papyrus Modification «ENDREM»
-«IF compartments->size() <> 0-»
- org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(«'node'», «'prefStore'», "«elementType.displayName»");
-«ENDIF-»
- «REM» END Papyrus Modification «ENDREM»
- return node;
- }
-«ENDDEFINE»
-
-// Location as layoutConstraint, no children
-«DEFINE createNodeMethod FOR gmfgen::GenChildLabelNode-»
- «EXPAND xpt::Common::generatedMemberComment»
- public org.eclipse.gmf.runtime.notation.Node create«getUniqueIdentifier()»(org.eclipse.emf.ecore.EObject domainElement, org.eclipse.gmf.runtime.notation.View containerView, int index, boolean persisted, org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint preferencesHint) {
- org.eclipse.gmf.runtime.notation.Node node = org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createShape();
- node.setLayoutConstraint(org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createLocation());«REM»[artem] XXX not sure, why LabelNode needs location«ENDREM»
- «EXPAND xpt::diagram::views::Utils::addLinkedDiagramStyle('node.getStyles()')-»
- «EXPAND xpt::diagram::views::Utils::addCustomStyles('node.getStyles()')-»
- node.setType(«EXPAND xpt::editor::VisualIDRegistry::typeMethodCall»);
- org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
-
- final org.eclipse.jface.preference.IPreferenceStore prefStore = (org.eclipse.jface.preference.IPreferenceStore) preferencesHint.getPreferenceStore();
- «EXPAND initFontFromPrefs('node', 'prefStore')-»
- «EXPAND initForegroundFromPrefs('node', 'prefStore')-»
- return node;
- }
-«ENDDEFINE»
-
-// looks for Font/Line/Fill styles in customStyles and initializes, if any (may be forced with boolean params)
-// params has*Style are to force respective style initialization (when callee knows certain style was added)
-«DEFINE initializeStyles(String viewVar, String prefStoreVar, Boolean hasLineStyle, Boolean hasFillStyle, Boolean hasFontStyle) FOR gmfgen::GenCommonBase-»
-«IF hasLineStyle or self.hasLineStyleInCustom()-»
- «REM»FIXME ColorAttributes is deprecated, should remove and clean the second branch of the disjunction«ENDREM»
- «IF viewmap.isFixedForeground() or viewmap.attributes[gmfgen::ColorAttributes]->notEmpty()-»
- «EXPAND xpt::diagram::views::Utils::foregroundColour(viewVar) FOR viewmap-»
- «ELSE-»
- «EXPAND initForegroundFromPrefs(viewVar, prefStoreVar)-»
- «ENDIF-»
-«ENDIF-»
-«IF (hasFontStyle or self.hasFontStyleInCustom()) and not viewmap.isFixedFont()-»
- «EXPAND initFontFromPrefs(viewVar, prefStoreVar)-»
-«ENDIF-»
-«IF hasFillStyle or self.hasFillStyleInCustom()-»
- «IF viewmap.isFixedBackground() or viewmap.attributes[gmfgen::ColorAttributes]->notEmpty()-»
- «EXPAND xpt::diagram::views::Utils::backgroundColour(viewVar) FOR viewmap-»
- «ELSE-»
- «EXPAND initBackgroundFromPrefs(viewVar, prefStoreVar)-»
- «ENDIF-»
-«ENDIF-»
-«ENDDEFINE»
-
-// FIXME check if there's need for a variable name, see initCompartment for a hint
-«DEFINE initLabel(String nodeVar, String prefStoreVar) FOR gmfgen::GenLabel-»
-«LET 'label' + self.visualID.repr() AS labelVar-»
- org.eclipse.gmf.runtime.notation.Node «labelVar» = createLabel(«nodeVar», «EXPAND xpt::editor::VisualIDRegistry::typeMethodCall»);
- «EXPAND xpt::diagram::views::Utils::addTextStyle(labelVar + '.getStyles()') FOR modelFacet-»
- «EXPAND xpt::diagram::views::Utils::addCustomStyles(labelVar + '.getStyles()')-»
-«IF self.oclIsKindOf(gmfgen::GenExternalNodeLabel) or self.oclIsKindOf(gmfgen::GenLinkLabel)-»
- «labelVar».setLayoutConstraint(org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createLocation());
- «EXPAND xpt::diagram::views::Utils::offset(labelVar)-»
-«ENDIF-»
- «EXPAND initializeStyles(labelVar, prefStoreVar, false, false, false)-»
-«ENDLET-»
-«ENDDEFINE»
-
-«DEFINE initCompartment(String nodeVar, String prefStoreVar) FOR gmfgen::GenCompartment-»
-«LET 'compartment' + self.visualID.repr() AS compartmentVar-»
- «IF styles->notEmpty() or isStoringChildPositions(getLayoutType())»org.eclipse.gmf.runtime.notation.Node «compartmentVar» = «ENDIF»createCompartment(«nodeVar», «EXPAND xpt::editor::VisualIDRegistry::typeMethodCall», «canCollapse», «needsTitle», «listLayout», «listLayout»);
- «EXPAND xpt::diagram::views::Utils::addCustomStyles(compartmentVar + '.getStyles()')-»
-«IF isStoringChildPositions(getLayoutType())-»
- «IF viewmap.canUseShapeStyle()-»
- «compartmentVar».add(org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createShapeStyle());
- «ELSE-»
-«REM»Intentionally not adding Description style, as it deemed to be useless for compartments (can't avoid for ShapeStyle - benefits of a single style overwheight drawbacks of Description presence)«ENDREM»
- «EXPAND xpt::diagram::views::Utils::addFontLineFillStylesConditionally(compartmentVar + '.getStyles()') FOR viewmap-»
- «ENDIF-»
- «compartmentVar».setLayoutConstraint(org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createBounds());
- «EXPAND initializeStyles(compartmentVar, prefStoreVar, not viewmap.isFixedForeground(), not viewmap.isFixedBackground(), not viewmap.isFixedFont())-»
-«ELSE-»
- «EXPAND initializeStyles(compartmentVar, prefStoreVar, false, false, false)-»
-«ENDIF-»
-«ENDLET-»
-«ENDDEFINE»
-
-«DEFINE initForegroundFromPrefs(String viewVar, String prefStoreVar) FOR gmfgen::GenCommonBase-»
- org.eclipse.swt.graphics.RGB lineRGB = org.eclipse.jface.preference.PreferenceConverter.getColor(«prefStoreVar», org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_COLOR);
- 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.RGBToInteger(lineRGB));
-«ENDDEFINE»
-
-«DEFINE initBackgroundFromPrefs(String viewVar, String prefStoreVar) FOR gmfgen::GenCommonBase-»
- org.eclipse.swt.graphics.RGB fillRGB = org.eclipse.jface.preference.PreferenceConverter.getColor(«prefStoreVar», org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_FILL_COLOR);
- 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.RGBToInteger(fillRGB));
-«ENDDEFINE»
-
-«DEFINE initFontFromPrefs(String viewVar, String prefStoreVar) FOR gmfgen::GenCommonBase-»
- org.eclipse.gmf.runtime.notation.FontStyle «viewVar»FontStyle = (org.eclipse.gmf.runtime.notation.FontStyle) «viewVar».getStyle(org.eclipse.gmf.runtime.notation.NotationPackage.Literals.FONT_STYLE);
- if («viewVar»FontStyle != null) {«REM»Given this template is invoked only when FontStyle is present, no need to check fontStyle for null, but at least this gives a scope for fontData var«ENDREM»
- org.eclipse.swt.graphics.FontData fontData = org.eclipse.jface.preference.PreferenceConverter.getFontData(«prefStoreVar», org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_DEFAULT_FONT);
- «viewVar»FontStyle.setFontName(fontData.getName());
- «viewVar»FontStyle.setFontHeight(fontData.getHeight());
- «viewVar»FontStyle.setBold((fontData.getStyle() & org.eclipse.swt.SWT.BOLD) != 0);
- «viewVar»FontStyle.setItalic((fontData.getStyle() & org.eclipse.swt.SWT.ITALIC) != 0);
- org.eclipse.swt.graphics.RGB fontRGB = org.eclipse.jface.preference.PreferenceConverter.getColor(«prefStoreVar», org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_FONT_COLOR);
- «viewVar»FontStyle.setFontColor(org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities.RGBToInteger(fontRGB).intValue());
- }
-«ENDDEFINE»
-
-
-«DEFINE createEdgeMethod FOR gmfgen::GenLink-»
- «EXPAND xpt::Common::generatedMemberComment»
- public org.eclipse.gmf.runtime.notation.Edge create«getUniqueIdentifier()»(«IF isTypeLink()»org.eclipse.emf.ecore.EObject domainElement, «ENDIF»org.eclipse.gmf.runtime.notation.View containerView, int index, boolean persisted, org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint preferencesHint) {
- «IF viewmap.isFixedForeground()-»
- org.eclipse.gmf.runtime.notation.Edge edge = org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createEdge();
- edge.getStyles().add(org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createRoutingStyle());
- «ELSE-»
- org.eclipse.gmf.runtime.notation.Connector edge = org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createConnector();
- «ENDIF-»
- «IF not viewmap.isFixedFont()-»
- edge.getStyles().add(org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createFontStyle());
- «ENDIF-»
- «EXPAND xpt::diagram::views::Utils::addCustomStyles('edge.getStyles()')-»
- org.eclipse.gmf.runtime.notation.RelativeBendpoints bendpoints = org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createRelativeBendpoints();
- «EXPAND CodeStyle::newGenericInstance('points', 'java.util.ArrayList', 'org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint')»(2);
- points.add(new org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint());
- points.add(new org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint());
- bendpoints.setPoints(points);
- edge.setBendpoints(bendpoints);
- org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.insertChildView(containerView, edge, index, persisted);
- edge.setType(«EXPAND xpt::editor::VisualIDRegistry::typeMethodCall»);
- edge.setElement(«IF isTypeLink()»domainElement«ELSE»null«ENDIF»);
- // initializePreferences
- final org.eclipse.jface.preference.IPreferenceStore prefStore = (org.eclipse.jface.preference.IPreferenceStore) preferencesHint.getPreferenceStore();
- «EXPAND initializeStyles('edge', 'prefStore', not viewmap.isFixedForeground(), false, not viewmap.isFixedFont())-»
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
- «EXPAND initRountingFromPrefs('edge', 'prefStore')-»
- «EXPAND initLabel('edge', 'prefStore') FOREACH labels-»
- «EXPAND initLabelVisibility('edge', 'prefStore') FOR self-»
- return edge;
- }
-«ENDDEFINE»
-
-«DEFINE extendsList FOR gmfgen::GenDiagram» extends org.eclipse.gmf.runtime.common.core.service.AbstractProvider«ENDDEFINE»
-«DEFINE implementsList FOR gmfgen::GenDiagram» implements org.eclipse.gmf.runtime.diagram.core.providers.IViewProvider«ENDDEFINE»
-
-«DEFINE caseVisualID FOR gmfgen::ElementType»«EXPAND xpt::Common::caseVisualID FOR diagramElement»«ENDDEFINE»
-
-«DEFINE getSemanticElementMethod FOR gmfgen::GenDiagram»
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.emf.ecore.EObject getSemanticElement(org.eclipse.core.runtime.IAdaptable semanticAdapter) {
- if (semanticAdapter == null) {
- return null;
- }
- org.eclipse.emf.ecore.EObject eObject = (org.eclipse.emf.ecore.EObject) semanticAdapter.getAdapter(org.eclipse.emf.ecore.EObject.class);
- if (eObject != null) {
- return org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil.resolve(org.eclipse.emf.transaction.util.TransactionUtil.getEditingDomain(eObject), eObject);
- }
- return null;
- }
-«ENDDEFINE»
-
-«DEFINE getSemanticElementTypeMethod FOR gmfgen::GenDiagram»
-«EXPAND xpt::Common::generatedMemberComment»
-protected org.eclipse.gmf.runtime.emf.type.core.IElementType getSemanticElementType(org.eclipse.core.runtime.IAdaptable semanticAdapter) {
- if (semanticAdapter == null) {
- return null;
- }
- return (org.eclipse.gmf.runtime.emf.type.core.IElementType) semanticAdapter.getAdapter(org.eclipse.gmf.runtime.emf.type.core.IElementType.class);
-}
-«ENDDEFINE»
-
-«DEFINE additions FOR gmfgen::GenDiagram»«ENDDEFINE»
-
-
-«AROUND additions FOR gmfgen::GenDiagram»
-
- «EXPAND xpt::Common::generatedMemberComment»
- private void initFontStyleFromPrefs(org.eclipse.gmf.runtime.notation.View view, final org.eclipse.jface.preference.IPreferenceStore store, String elementName)
- {
- String fontConstant = org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.FONT);
- String fontColorConstant = org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FONT);
-
- org.eclipse.gmf.runtime.notation.FontStyle viewFontStyle = (org.eclipse.gmf.runtime.notation.FontStyle) view.getStyle(org.eclipse.gmf.runtime.notation.NotationPackage.Literals.FONT_STYLE);
- if (viewFontStyle != null)
- {
- org.eclipse.swt.graphics.FontData fontData = org.eclipse.jface.preference.PreferenceConverter.getFontData(store, fontConstant);
- viewFontStyle.setFontName(fontData.getName());
- viewFontStyle.setFontHeight(fontData.getHeight());
- viewFontStyle.setBold((fontData.getStyle() & org.eclipse.swt.SWT.BOLD) != 0);
- viewFontStyle.setItalic((fontData.getStyle() & org.eclipse.swt.SWT.ITALIC) != 0);
-
- org.eclipse.swt.graphics.RGB fontRGB = org.eclipse.jface.preference.PreferenceConverter.getColor(store, fontColorConstant);
- viewFontStyle.setFontColor(org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities.RGBToInteger(fontRGB).intValue());
- }
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- private void initForegroundFromPrefs(org.eclipse.gmf.runtime.notation.View view, final org.eclipse.jface.preference.IPreferenceStore store, String elementName)
- {
- String lineColorConstant = org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE);
- org.eclipse.swt.graphics.RGB lineRGB = org.eclipse.jface.preference.PreferenceConverter.getColor(store, lineColorConstant);
- org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(view, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getLineStyle_LineColor(), org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities.RGBToInteger(lineRGB));
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- private void initBackgroundFromPrefs(org.eclipse.gmf.runtime.notation.View view, final org.eclipse.jface.preference.IPreferenceStore store, String elementName)
- {
- String fillColorConstant = org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL);
- String gradientColorConstant = org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT);
- String gradientPolicyConstant = org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName,org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY);
-
-
- org.eclipse.swt.graphics.RGB fillRGB = org.eclipse.jface.preference.PreferenceConverter.getColor(store, fillColorConstant);
- org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(view, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getFillStyle_FillColor(), org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities.RGBToInteger(fillRGB));
-
-
- org.eclipse.gmf.runtime.notation.FillStyle fillStyle = (org.eclipse.gmf.runtime.notation.FillStyle) view
- .getStyle(org.eclipse.gmf.runtime.notation.NotationPackage.Literals.FILL_STYLE);
- fillStyle
- .setFillColor(FigureUtilities.RGBToInteger(fillRGB).intValue());
-
- ;
- if (store.getBoolean(gradientPolicyConstant)) {
- org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
- store.getString(gradientColorConstant));
- fillStyle.setGradient(gradientPreferenceConverter.getGradientData());
- fillStyle
- .setTransparency(gradientPreferenceConverter.getTransparency());
- }
- }
-
-
-«ENDAROUND»
-
-«AROUND initFontFromPrefs(String viewVar, String prefStoreVar) FOR gmfgen::GenCommonBase-»
- «EXPAND specificInitFontFromPrefs(viewVar, prefStoreVar) FOR self-»
-«ENDAROUND»
-
-«DEFINE specificInitFontFromPrefs(String viewVar, String prefStoreVar) FOR gmfgen::GenNode-»
- «IF "UNDEFINED" <> elementType.displayName.toUpper()»
- org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper.initFontStyleFromPrefs(«viewVar», «prefStoreVar», "«elementType.displayName»");
- «ENDIF»
-«ENDDEFINE»
-
-«DEFINE specificInitFontFromPrefs(String viewVar, String prefStoreVar) FOR gmfgen::GenChildNode-»
-«IF "UNDEFINED" <> elementType.displayName.toUpper()»
- org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper.initFontStyleFromPrefs(«viewVar», «prefStoreVar», "«elementType.displayName»");
- «ENDIF»
-«ENDDEFINE»
-
-«DEFINE specificInitFontFromPrefs(String viewVar, String prefStoreVar) FOR gmfgen::GenLink-»
- «IF "UNDEFINED" <> elementType.displayName.toUpper()»
- org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper.initFontStyleFromPrefs(«viewVar», «prefStoreVar», "«elementType.displayName»");
- «ENDIF»
-«ENDDEFINE»
-
-«DEFINE specificInitFontFromPrefs(String viewVar, String prefStoreVar) FOR gmfgen::GenCommonBase-»
-«IF "UNDEFINED" <> elementType.displayName.toUpper()»
- org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper.initFontStyleFromPrefs(«viewVar», «prefStoreVar», "«elementType.displayName»");
- «ENDIF»
-«ENDDEFINE»
-
-
-
-«AROUND initForegroundFromPrefs(String viewVar, String prefStoreVar) FOR gmfgen::GenCommonBase-»
- «EXPAND specificInitForegroundFromPrefs(viewVar, prefStoreVar) FOR self-»
-«ENDAROUND»
-
-«DEFINE specificInitForegroundFromPrefs(String viewVar, String prefStoreVar) FOR gmfgen::GenNode-»
- «IF "UNDEFINED" <> elementType.displayName.toUpper()»
- org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper.initForegroundFromPrefs(«viewVar», «prefStoreVar», "«elementType.displayName»");
- «ENDIF»
-«ENDDEFINE»
-
-«DEFINE specificInitForegroundFromPrefs(String viewVar, String prefStoreVar) FOR gmfgen::GenChildNode-»
- «IF "UNDEFINED" <> elementType.displayName.toUpper()»
- org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper.initForegroundFromPrefs(«viewVar», «prefStoreVar», "«elementType.displayName»");
- «ENDIF»
-«ENDDEFINE»
-
-«DEFINE specificInitForegroundFromPrefs(String viewVar, String prefStoreVar) FOR gmfgen::GenLink-»
- «IF "UNDEFINED" <> elementType.displayName.toUpper()»
- org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper.initForegroundFromPrefs(«viewVar», «prefStoreVar», "«elementType.displayName»");
- «ENDIF»
-«ENDDEFINE»
-
-«DEFINE specificInitForegroundFromPrefs(String viewVar, String prefStoreVar) FOR gmfgen::GenCommonBase»
-«ENDDEFINE»
-
-
-
-
-
-«AROUND initBackgroundFromPrefs(String viewVar, String prefStoreVar) FOR gmfgen::GenCommonBase-»
- «EXPAND specificInitBackgroundFromPrefs(viewVar, prefStoreVar) FOR self-»
-«ENDAROUND»
-
-«DEFINE specificInitBackgroundFromPrefs(String viewVar, String prefStoreVar) FOR gmfgen::GenNode»
- «IF "UNDEFINED" <> elementType.displayName.toUpper()»
- org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper.initBackgroundFromPrefs(«viewVar», «prefStoreVar», "«elementType.displayName»");
- «ENDIF»
-«ENDDEFINE»
-
-«DEFINE specificInitBackgroundFromPrefs(String viewVar, String prefStoreVar) FOR gmfgen::GenChildNode»
- «IF "UNDEFINED" <> elementType.displayName.toUpper()»
- org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper.initBackgroundFromPrefs(«viewVar», «prefStoreVar», "«elementType.displayName»");
- «ENDIF»
-«ENDDEFINE»
-
-«DEFINE specificInitBackgroundFromPrefs(String viewVar, String prefStoreVar) FOR gmfgen::GenLink»
- «IF "UNDEFINED" <> elementType.displayName.toUpper()»
- org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper.initBackgroundFromPrefs(«viewVar», «prefStoreVar», "«elementType.displayName»");
- «ENDIF»
-«ENDDEFINE»
-
-«DEFINE specificInitBackgroundFromPrefs(String viewVar, String prefStoreVar) FOR gmfgen::GenCommonBase»
-«ENDDEFINE»
-
-
-«DEFINE initRountingFromPrefs(String viewVar, String prefStoreVar) FOR gmfgen::GenCommonBase-»
- «EXPAND specificInitRountingFromPrefs(viewVar, prefStoreVar) FOR self-»
-«ENDDEFINE»
-
-«DEFINE specificInitRountingFromPrefs(String viewVar, String prefStoreVar) FOR gmfgen::GenNode»
- «IF "UNDEFINED" <> elementType.displayName.toUpper()»
- org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper.initRountingFromPrefs(«viewVar», «prefStoreVar», "«elementType.displayName»");
- «ENDIF»
-«ENDDEFINE»
-
-«DEFINE specificInitRountingFromPrefs(String viewVar, String prefStoreVar) FOR gmfgen::GenChildNode»
- «IF "UNDEFINED" <> elementType.displayName.toUpper()»
- org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper.initRountingFromPrefs(«viewVar», «prefStoreVar», "«elementType.displayName»");
- «ENDIF»
-«ENDDEFINE»
-
-«DEFINE specificInitRountingFromPrefs(String viewVar, String prefStoreVar) FOR gmfgen::GenLink»
- «IF "UNDEFINED" <> elementType.displayName.toUpper()»
- org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper.initRountingFromPrefs(«viewVar», «prefStoreVar», "«elementType.displayName»");
- «ENDIF»
-«ENDDEFINE»
-
-«DEFINE specificInitRountingFromPrefs(String viewVar, String prefStoreVar) FOR gmfgen::GenCommonBase»
-«ENDDEFINE»
-
-«REM» write the line to initialize the property isVisible for the label of the link «ENDREM»
-«DEFINE initLabelVisibility(String viewVar, String prefStoreVar) FOR gmfgen::GenLink»
- «IF self.labels->exists(lbl : gmfgen::GenLinkLabel | (papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label : papyrusgmfgenextension::LabelVisibilityPreference | label.linkLabels->includes(lbl))->size()<>0))»
- org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper.initLabelVisibilityFromPrefs(«viewVar», «prefStoreVar», "«elementType.displayName»");
- «ENDIF»
-«ENDDEFINE»
-
-«REM» write the line to initialize the property isVisible for the label of the link «ENDREM»
-«DEFINE initLabelVisibility(String viewVar, String prefStoreVar) FOR gmfgen::GenNode»
- «IF self.labels->exists(lbl : gmfgen::GenExternalNodeLabel | (papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label : papyrusgmfgenextension::LabelVisibilityPreference | label.externalNodeLabels->includes(lbl))->size()<>0))»
- org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper.initLabelVisibilityFromPrefs(«viewVar», «prefStoreVar», "«elementType.displayName»");
- «ENDIF»
-«ENDDEFINE» \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/commands/CreateLinkUtils.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/commands/CreateLinkUtils.xpt
deleted file mode 100644
index f8788ab488d..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/commands/CreateLinkUtils.xpt
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright (c) 2007, 2010 Borland Software Corporation and others
- *
- * 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/2009/GenModel'»
-
-«EXTENSION xpt::diagram::Utils»
-
-«REM»
- Check whether link may be created.
-«ENDREM»
-«DEFINE canCreate(link : gmfgen::GenLink) FOR gmfgen::LinkModelFacet-»
-
- «EXPAND xpt::Common::generatedMemberComment»
- public boolean canExecute() {
- if (source == null && target == null) {
- return false;
- }
- if (source != null && «EXPAND MetaModel::NotInstance('source') FOR getSourceType()») {
- return false;
- }
- if (target != null && «EXPAND MetaModel::NotInstance('target') FOR getTargetType()») {
- return false;
- }
- if (getSource() == null) {
- return true; // link creation is in progress; source is not defined yet
- }
- // target may be null here but it's possible to check constraint
- «EXPAND canCreateElement(link)-»
- }
-«ENDDEFINE»
-
-«DEFINE canCreateElement(link : gmfgen::GenLink) FOR gmfgen::LinkModelFacet-»
-«ENDDEFINE»
-
-«DEFINE canCreateElement(link : gmfgen::GenLink) FOR gmfgen::TypeLinkModelFacet-»
-«IF hasContainerOtherThanSource(self)-»
- if (getContainer() == null) {
- return false;
- }
-«ENDIF-»
- return «EXPAND xpt::diagram::editpolicies::BaseItemSemanticEditPolicy::canCreateCall(link, 'getContainer()', 'getSource()', 'getTarget()')»;
-«ENDDEFINE»
-
-«DEFINE canCreateElement(link : gmfgen::GenLink) FOR gmfgen::FeatureLinkModelFacet-»
- return «EXPAND xpt::diagram::editpolicies::BaseItemSemanticEditPolicy::canCreateCall(link, 'getSource()', 'getTarget()')»;
-«ENDDEFINE»
-
-«REM»
- Fields of command that creates link.
-«ENDREM»
-«DEFINE fields FOR gmfgen::LinkModelFacet»
- «EXPAND xpt::Common::generatedMemberComment»
- protected final org.eclipse.emf.ecore.EObject source;
-
- «EXPAND xpt::Common::generatedMemberComment»
- protected final org.eclipse.emf.ecore.EObject target;
-«ENDDEFINE»
-
-«DEFINE fields FOR gmfgen::TypeLinkModelFacet»
- «EXPAND xpt::Common::generatedMemberComment»
- protected final org.eclipse.emf.ecore.EObject source;
-
- «EXPAND xpt::Common::generatedMemberComment»
- protected final org.eclipse.emf.ecore.EObject target;
-«IF hasContainerOtherThanSource(self)»
-
- «EXPAND xpt::Common::generatedMemberComment»
- protected «EXPAND MetaModel::QualifiedClassName FOR containmentMetaFeature.genClass» container;
-«ENDIF-»
-«ENDDEFINE»
-
-«REM»
- Field accessors of command that creates link.
-«ENDREM»
-«DEFINE accessors FOR gmfgen::LinkModelFacet-»
-
- «EXPAND xpt::Common::generatedMemberComment»
- protected «EXPAND MetaModel::QualifiedClassName FOR getSourceType()» getSource() {
- return «EXPAND MetaModel::CastEObject('source') FOR getSourceType()»;
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- protected «EXPAND MetaModel::QualifiedClassName FOR getTargetType()» getTarget() {
- return «EXPAND MetaModel::CastEObject('target') FOR getTargetType()»;
- }
- «EXPAND containerAccessor-»
-«ENDDEFINE»
-
-«DEFINE containerAccessor FOR gmfgen::LinkModelFacet»«ENDDEFINE»
-
-«DEFINE containerAccessor FOR gmfgen::TypeLinkModelFacet-»
-«IF hasContainerOtherThanSource(self)-»
-
- «EXPAND xpt::Common::generatedMemberComment»
- public «EXPAND MetaModel::QualifiedClassName FOR containmentMetaFeature.genClass» getContainer() {
- return container;
- }
-
- «EXPAND xpt::Common::generatedMemberComment(
- 'Default approach is to traverse ancestors of the source to find instance of container.\n' +
- 'Modify with appropriate logic.'
- )»
- protected «EXPAND MetaModel::QualifiedClassName FOR containmentMetaFeature.genClass» deduceContainer(org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EObject target) {
- // Find container element for the new link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for (org.eclipse.emf.ecore.EObject element = source; element != null; element = element.eContainer()) {
- if («EXPAND MetaModel::IsInstance('element') FOR containmentMetaFeature.genClass») {
- return «EXPAND MetaModel::CastEObject('element') FOR containmentMetaFeature.genClass»;
- }
- }
- return null;
- }
-«ENDIF-»
-
-«ENDDEFINE»
-
-«REM»
- Part of the constructor that performs initialization.
-«ENDREM»
-«DEFINE _init FOR gmfgen::LinkModelFacet-»
- this.source = source;
- this.target = target;
-«ENDDEFINE»
-
-«DEFINE _init FOR gmfgen::TypeLinkModelFacet-»
- this.source = source;
- this.target = target;
-«IF hasContainerOtherThanSource(self)-»
- container = deduceContainer(source, target);
-«ENDIF-»
-«ENDDEFINE» \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/commands/CreateNodeCommand.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/commands/CreateNodeCommand.xpt
deleted file mode 100644
index aa60a52deed..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/commands/CreateNodeCommand.xpt
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Copyright (c) 2007, 2009 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:
- * Alexander Shatalin (Borland) - initial API and implementation
- * modified by Patrick Tessier (CEA LIST)
- */
-
-«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::GenModelUtils»
-«EXTENSION xpt::diagram::Utils»
-«EXTENSION xpt::diagram::commands::file»
-«EXTENSION xpt::diagram::commands::NodeConstraintUtils»
-«EXTENSION xpt::OclMigrationProblems»
-
-«DEFINE CreateNodeCommand FOR gmfgen::GenNode-»
-«EXPAND xpt::Common::copyright FOR getDiagram().editorGen-»
-package «getDiagram().editCommandsPackageName»;
-«EXPAND xpt::Common::generatedClassComment»
-public class «createCommandClassName» extends org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand {
- «REM» Mutating canvas auxiliary «ENDREM»
- «EXPAND xpt::Common::generatedMemberComment-»
- private org.eclipse.gmf.runtime.notation.Diagram diagram = null;
- «EXPAND xpt::Common::generatedMemberComment-»
- private org.eclipse.emf.ecore.EObject eObject = null;
- «REM» Mutating canvas auxiliary constructor «ENDREM»
- «EXPAND xpt::Common::generatedMemberComment-»
- public «createCommandClassName»(org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest req, org.eclipse.emf.ecore.EObject eObject, org.eclipse.gmf.runtime.notation.Diagram diagram) {
- super(req.getLabel(), null, req);
- this.eObject = eObject;
- this.diagram = diagram;
- }
- «REM» Mutating canvas auxiliary builder «ENDREM»
- «EXPAND xpt::Common::generatedMemberComment-»
- public static «createCommandClassName» create(org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest req, org.eclipse.emf.ecore.EObject eObject, org.eclipse.gmf.runtime.notation.Diagram diagram) {
- return new «createCommandClassName»(req, eObject, diagram);
- }
- «EXPAND _constructor-»
- «EXPAND getElementToEdit-»
- «EXPAND canExecuteMethod-»
- «EXPAND doExecuteWithResultMethod»
- «EXPAND doConfigureMethod»
-}
-«ENDDEFINE»
-«DEFINE _constructor FOR gmfgen::GenNode-»
- «EXPAND xpt::Common::generatedMemberComment»
- public «createCommandClassName»(org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest req, org.eclipse.gmf.runtime.notation.Diagram diagram) {
- super(req.getLabel(), null, req);
- this.diagram = diagram;
- }
-«ENDDEFINE»
-/*
- * TODO: either use setElementToEdit, or generate downcasted version (which may be troublesome if containment and child features point to a different parent)
- */
-«DEFINE getElementToEdit FOR gmfgen::GenNode-»
- «EXPAND xpt::Common::generatedMemberComment('FIXME: replace with setElementToEdit()')»
-protected org.eclipse.emf.ecore.EObject getElementToEdit() {
-
- «REM» Mutating canvas helper «ENDREM»
- org.eclipse.emf.ecore.EObject container =
- ((org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest) getRequest()).getContainer();
- if (container instanceof org.eclipse.gmf.runtime.notation.View) {
- container = ((org.eclipse.gmf.runtime.notation.View) container).getElement();
- }
- if (container != null) {
- return container;
- }
- return eObject;
-}
-«ENDDEFINE»
-
-«REM» [AbstractElement] Modified for Abstract domain element «ENDREM»
-«DEFINE doExecuteWithResultMethod FOR gmfgen::GenNode-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.gmf.runtime.common.core.command.CommandResult doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.core.runtime.IAdaptable info) throws org.eclipse.core.commands.ExecutionException {
-«REM» [AbstractElement] START «ENDREM»
-
-«IF modelFacet.metaClass.ecoreClass._abstract <> true-»
-«REM» [AbstractElement] END «ENDREM»
-«IF modelFacet.isPhantomElement()-»
- «EXPAND phantomElementCreation(self, 'newElement') FOR modelFacet»
-«ELSE-»
- «EXPAND normalElementCreation(self, 'newElement') FOR modelFacet»
-«ENDIF»
- «EXPAND initialize(self, 'newElement') FOR modelFacet-»
-«IF true/*FIXME boolean needsExternalConfiguration*/»
- doConfigure(newElement, monitor, info);
-«ENDIF»
- ((org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest) getRequest()).setNewElement(«EXPAND MetaModel::DowncastToEObject('newElement') FOR modelFacet.metaClass»);
- return org.eclipse.gmf.runtime.common.core.command.CommandResult.newOKCommandResult(newElement);
- }
-«REM» [AbstractElement] START «ENDREM»
-«ELSE-»
- throw new UnsupportedOperationException("Unimplemented operation (abstract domain element).");
- }
-«ENDIF»
-«REM» [AbstractElement] END «ENDREM»
-«ENDDEFINE»
-/*
- * Unlike original CreateElementCommand, we don't keep track of IStatus from configureCommand.execute,
- * nor allow status setting from doDefaultCreation. The reason is ICommandProxy#execute implementation,
- * which ignores any status from wrapped ICommand. Besides, both CommandResult and IStatus seems too much to me.
- */
-«DEFINE doConfigureMethod FOR gmfgen::GenNode-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected void doConfigure(«EXPAND MetaModel::QualifiedClassName FOR modelFacet.metaClass» newElement, org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.core.runtime.IAdaptable info) throws org.eclipse.core.commands.ExecutionException {
- org.eclipse.gmf.runtime.emf.type.core.IElementType elementType = ((org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest) getRequest()).getElementType();
- org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest configureRequest = new org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest(getEditingDomain(), «EXPAND MetaModel::DowncastToEObject('newElement') FOR modelFacet.metaClass», elementType);
- configureRequest.setClientContext(((org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest) getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- org.eclipse.gmf.runtime.common.core.command.ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if (configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-«ENDDEFINE»
-«DEFINE canExecuteMethod FOR gmfgen::GenNode-»
- «EXPAND xpt::Common::generatedMemberComment»
- public boolean canExecute() {
-«IF modelFacet.isPhantomElement()-»
- return true;
-«ELSE-»
- «EXPAND canExecute_Normal FOR modelFacet»
-«ENDIF-»
- }
-«ENDDEFINE»
-«DEFINE canExecute_Normal FOR gmfgen::TypeModelFacet-»
-
-«IF not containmentMetaFeature.oclIsUndefined()-»
- «IF not containmentMetaFeature.ecoreFeature.oclIsUndefined()-»
- «IF not isUnbounded(containmentMetaFeature.ecoreFeature) or (childMetaFeature <> containmentMetaFeature and not isUnbounded(childMetaFeature.ecoreFeature))-»
- «IF not isUnbounded(containmentMetaFeature.ecoreFeature)-»
- «EXPAND MetaModel::DeclareAndAssign('container', 'getElementToEdit()') FOR containmentMetaFeature.genClass-»
- «IF isSingleValued(containmentMetaFeature.ecoreFeature)»
- if («EXPAND MetaModel::getFeatureValue('container', containmentMetaFeature.genClass) FOR containmentMetaFeature» != null) {
- «ELSE-»
- if («EXPAND MetaModel::getFeatureValue('container', containmentMetaFeature.genClass) FOR containmentMetaFeature».size() >= «containmentMetaFeature.ecoreFeature.upperBound») {
- «ENDIF-»
- return false;
- }
- «ENDIF-»
- «IF childMetaFeature <> containmentMetaFeature and not isUnbounded(childMetaFeature.ecoreFeature)-»
- «IF isSingleValued(childMetaFeature.ecoreFeature)-»
- if («EXPAND MetaModel::getFeatureValue('container', containmentMetaFeature.genClass) FOR childMetaFeature» != null) {
- «ELSE-»
- if («EXPAND MetaModel::getFeatureValue('container', containmentMetaFeature.genClass) FOR childMetaFeature».size() >= «childMetaFeature.ecoreFeature.upperBound») {
- «ENDIF-»
- return false;
- }
- «ENDIF-»
- «ENDIF-»
- «ENDIF-»
-«ENDIF-»
-
- org.eclipse.emf.ecore.EObject target = getElementToEdit();
- org.eclipse.papyrus.infra.viewpoints.policy.ModelAddData data = org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), «EXPAND MetaModel::MetaClass FOR metaClass»);
- return data.isPermitted();
-«ENDDEFINE»
-
-«DEFINE phantomElementCreation(node : gmfgen::GenNode, varName : String) FOR gmfgen::TypeModelFacet-»
- // Uncomment to put "phantom" objects into the diagram file.
- // org.eclipse.emf.ecore.resource.Resource resource =
- // ((org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest) getRequest()).getContainer().eResource();
- // if (resource == null) {
- // return null;
- // }
- org.eclipse.emf.ecore.resource.Resource resource = getElementToEdit().eResource();
- «EXPAND MetaModel::NewInstance(varName) FOR metaClass»
- resource.getContents().add(«EXPAND MetaModel::DowncastToEObject(varName) FOR metaClass»);
-«ENDDEFINE»
-
-«DEFINE normalElementCreation(node : gmfgen::GenNode, varName : String) FOR gmfgen::TypeModelFacet-»
- «EXPAND MetaModel::NewInstance(varName) FOR metaClass»
- org.eclipse.emf.ecore.EObject target = getElementToEdit();
- org.eclipse.papyrus.infra.viewpoints.policy.ModelAddData data = org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker.getCurrent().getChildAddData(diagram, target, «varName»);
- if (data.isPermitted()) {
- if (data.isPathDefined()) {
- if (!data.execute(target, «varName»))
- return org.eclipse.gmf.runtime.common.core.command.CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
- } else {
-«IF not containmentMetaFeature.oclIsUndefined()-»
- «EXPAND MetaModel::DeclareAndAssign('qualifiedTarget', 'target') FOR containmentMetaFeature.genClass»
- «EXPAND MetaModel::modifyFeature('qualifiedTarget', containmentMetaFeature.genClass, varName) FOR containmentMetaFeature-»
-«ELSE-»
- //
- // FIXME no containment feature found in the genmodel, toolsmith need to manually write code here to add «varName» to a parent
- //
-«ENDIF»
- }
- } else {
- return org.eclipse.gmf.runtime.common.core.command.CommandResult.newErrorCommandResult("The active policy restricts the addition of this element");
- }
-
-«IF hasExplicitChildFeature(self)-»
- «EXPAND MetaModel::DeclareAndAssign('childHolder', 'getElementToEdit()') FOR childMetaFeature.genClass»
- «EXPAND MetaModel::modifyFeature('childHolder', childMetaFeature.genClass, varName) FOR childMetaFeature»
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE initialize(node : gmfgen::GenNode, newElementVar : String) FOR gmfgen::TypeModelFacet»«EXPAND xpt::providers::ElementInitializers::initMethodCall(self, newElementVar) FOR node»«ENDDEFINE»
-
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/commands/NodeConstraintUtils.qvto b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/commands/NodeConstraintUtils.qvto
deleted file mode 100644
index bfae168b26d..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/commands/NodeConstraintUtils.qvto
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2010 CEA LIST
- *
- * 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:
- * Yann Tanguy (CEA LIST) - initial API and implementation
- *
- */
-
-modeltype gmfgen uses "http://www.eclipse.org/gmf/2009/GenModel";
-modeltype papyrusgmfgenextension uses "http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension";
-
-library NodeConstraintUtils;
-
-helper gmfgen::GenNode::hasNodeCreationConstraint() : Boolean {
- return papyrusgmfgenextension::GenNodeConstraint.allInstances()
- ->select(v : papyrusgmfgenextension::GenNodeConstraint
- | v.genNode->includes(self) and v.genConstraint <> null)
- ->size()<>0
-}
-
-helper gmfgen::GenNode::getNodeCreationConstraint() : papyrusgmfgenextension::GenNodeConstraint {
-
- if(self.hasNodeCreationConstraint()) then {
- return papyrusgmfgenextension::GenNodeConstraint.allInstances()
- ->select(v : papyrusgmfgenextension::GenNodeConstraint
- | v.genNode->includes(self) and v.genConstraint <> null)
- ->asSequence()->first()
- } endif;
-
- return null;
-}
-
-helper gmfgen::TypeModelFacet::getOwningGenNode() : gmfgen::GenNode {
- return gmfgen::GenNode.allInstances()
- ->select(v : gmfgen::GenNode | v.modelFacet = self)
- ->asSequence()->first()
-}
-
-helper gmfgen::GenNode::getNodeCreationConstraintBody() : String {
- let nodeConstraint = self.getNodeCreationConstraint() in
- if (self.hasNodeCreationConstraint() <> null) then {
- if ((nodeConstraint.genConstraint <> null) and (nodeConstraint.genConstraint._body <> null)) then {
- return nodeConstraint.genConstraint._body;
- } endif;
- } endif;
-
- return "No GenNodeConstraint found.";
-} \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/commands/file.qvto b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/commands/file.qvto
deleted file mode 100644
index fa442a72f11..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/commands/file.qvto
+++ /dev/null
@@ -1,9 +0,0 @@
-import library qvtlib.SampleLibrary;
-
-library file;
-modeltype ecore uses "http://www.eclipse.org/emf/2002/Ecore";
-
-
-helper dump(model: ecore::EPackage): OclAny {
- model.dumpErr('model: ');
-} \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/edithelpers/BaseEditHelper.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/edithelpers/BaseEditHelper.xpt
deleted file mode 100644
index 30781e0be44..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/edithelpers/BaseEditHelper.xpt
+++ /dev/null
@@ -1,65 +0,0 @@
-«REM»DOCUMENTATION: PapyrusGencode«ENDREM»
-«REM»this template is a copy of the original«ENDREM»
-
-/*
- * Copyright (c) 2006, 2009, 2012 Borland Software Corporation and others
- *
- * 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
- * Michael Golubev (Montages) - #368169 - extract common code to GMFT-specific runtime
- */
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-
-«DEFINE extendsClause FOR gmfgen::GenDiagram»extends «EXPAND superClass»«ENDDEFINE»
-«DEFINE superClass FOR gmfgen::GenDiagram»org.eclipse.gmf.tooling.runtime.edit.helpers.GeneratedEditHelperBase«ENDDEFINE»
-
-«DEFINE BaseEditHelper FOR gmfgen::GenDiagram-»
-«EXPAND xpt::Common::copyright FOR editorGen-»
-package «editHelpersPackageName»;
-
-«EXPAND xpt::Common::generatedClassComment»
-public class «baseEditHelperClassName» «EXPAND extendsClause» {
-
- «EXPAND attributes-»
-
- «EXPAND getEditHelperAdvice-»
-
- «EXPAND getInsteadCommand-»
-
- «EXPAND getCreateCommand-»
-
- «EXPAND getCreateRelationshipCommand-»
-
- «EXPAND getDestroyElementCommand-»
-
- «EXPAND getDestroyReferenceCommand-»
-
- «EXPAND additions-»
-}
-«ENDDEFINE»
-
-«DEFINE editPolicyCommandConstant FOR gmfgen::GenDiagram»org.eclipse.gmf.tooling.runtime.edit.helpers.GeneratedEditHelperBase.EDIT_POLICY_COMMAND«ENDDEFINE»
-
-«DEFINE contextElementTypeConstant FOR gmfgen::GenDiagram»org.eclipse.gmf.tooling.runtime.edit.helpers.GeneratedEditHelperBase.CONTEXT_ELEMENT_TYPE«ENDDEFINE»
-
-«DEFINE attributes FOR gmfgen::GenDiagram-»
-«ENDDEFINE»
-
-«REM»
-All empty DEFINE's below are still here for backward compatibilty of AROUND's.
-However we don't have anything to generate here since common code had extracted to GMFT-runtime as part of #368169
-«ENDREM»
-«DEFINE getEditHelperAdvice FOR gmfgen::GenDiagram»«ENDDEFINE»
-«DEFINE getInsteadCommand FOR gmfgen::GenDiagram»«ENDDEFINE»
-«DEFINE getCreateCommand FOR gmfgen::GenDiagram»«ENDDEFINE»
-«DEFINE getCreateRelationshipCommand FOR gmfgen::GenDiagram»«ENDDEFINE»
-«DEFINE getDestroyElementCommand FOR gmfgen::GenDiagram»«ENDDEFINE»
-«DEFINE getDestroyReferenceCommand FOR gmfgen::GenDiagram»«ENDDEFINE»
-
-«DEFINE additions FOR gmfgen::GenDiagram»«ENDDEFINE»
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/edithelpers/EditHelper.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/edithelpers/EditHelper.xpt
deleted file mode 100644
index 6179f525e54..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/edithelpers/EditHelper.xpt
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2006, 2009 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/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension'»
-«EXTENSION xpt::diagram::edithelpers::EditHelperUtils»
-
-«DEFINE EditHelper FOR gmfgen::MetamodelType-»
-«EXPAND xpt::Common::copyright FOR diagramElement.getDiagram().editorGen-»
-package «diagramElement.getDiagram().editHelpersPackageName»;
-
-«EXPAND xpt::Common::generatedClassComment»
-public class «editHelperClassName» extends «getBaseEditHelperFullName(diagramElement.getDiagram())» {
- «EXPAND additions-»
-}
-«ENDDEFINE»
-
-«DEFINE additions FOR gmfgen::MetamodelType»«ENDDEFINE»
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/edithelpers/EditHelperUtils.qvto b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/edithelpers/EditHelperUtils.qvto
deleted file mode 100644
index 961d3c2adc1..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/edithelpers/EditHelperUtils.qvto
+++ /dev/null
@@ -1,17 +0,0 @@
-modeltype gmfgen uses "http://www.eclipse.org/gmf/2009/GenModel";
-modeltype gmfgenextension uses "http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension";
-
-library EditHelperUtils;
-
-/*
- */
-helper getBaseEditHelperFullName(diagram : gmfgen::GenDiagram) : String {
- if (gmfgenextension::AdditionalEditPartCandies.allInstances()->notEmpty()) then {
- return gmfgenextension::AdditionalEditPartCandies.allInstances()
- ->asSequence()
- ->first().baseEditHelperPackage + '.' + diagram.baseEditHelperClassName;
- } endif;
-
- return diagram.getBaseEditHelperQualifiedClassName();
-}
-
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/BaseItemSemanticEditPolicy.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/BaseItemSemanticEditPolicy.xpt
deleted file mode 100644
index a91ee8002a8..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/BaseItemSemanticEditPolicy.xpt
+++ /dev/null
@@ -1,607 +0,0 @@
-/*
- * Copyright (c) 2007, 2009 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:
- * Alexander Shatalin (Borland) - initial API and implementation
- * modified by Patrick Tessier (CEA LIST)
- */
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/emf/2002/Ecore'»
-«IMPORT 'http://www.eclipse.org/emf/2002/GenModel'»
-«IMPORT 'http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension'»
-«EXTENSION xpt::diagram::editpolicies::Utils»
-«EXTENSION xpt::diagram::Utils»
-«EXTENSION xpt::GenModelUtils»
-«EXTENSION xpt::expressions::ValueExpression»
-«EXTENSION xpt::StringOperations»
-«EXTENSION xpt::OclMigrationProblems»
-
-«REM»Documentation: PapyrusGenCode«ENDREM»
-«REM»This tamplate has been modified in order to allow the moving command«ENDREM»
-«DEFINE BaseItemSemanticEditPolicy FOR gmfgen::GenDiagram-»
-«EXPAND xpt::Common::copyright FOR editorGen-»
-package «getDiagram().editPoliciesPackageName»;
-«EXPAND xpt::Common::generatedClassComment»
-public class «baseItemSemanticEditPolicyClassName» extends org.eclipse.gmf.runtime.diagram.ui.editpolicies.SemanticEditPolicy {
- «EXPAND attributes-»
-
- «EXPAND _constructor-»
- «EXPAND xpt::Common::generatedMemberComment(
- 'Extended request data key to hold editpart visual id.\n' +
- 'Add visual id of edited editpart to extended data of the request\n' +
- 'so command switch can decide what kind of diagram element is being edited.\n' +
- 'It is done in those cases when it\'s not possible to deduce diagram\n' +
- 'element kind from domain element.\n' +
- 'Add the reoriented view to the request extended data so that the view\n ' +
- 'currently edited can be distinguished from other views of the same element\n ' +
- 'and these latter possibly removed if they become inconsistent after reconnect\n'
- )»
- @SuppressWarnings("unchecked")
- public org.eclipse.gef.commands.Command getCommand(org.eclipse.gef.Request request) {
- if (request instanceof org.eclipse.gef.requests.ReconnectRequest) {
- Object view = ((org.eclipse.gef.requests.ReconnectRequest) request).getConnectionEditPart().getModel();
- if (view instanceof org.eclipse.gmf.runtime.notation.View) {
- Integer id = new Integer(«EXPAND xpt::editor::VisualIDRegistry::getVisualIDMethodCall»((org.eclipse.gmf.runtime.notation.View) view));
- request.getExtendedData().put(VISUAL_ID_KEY, id);
- request.getExtendedData().put(GRAPHICAL_RECONNECTED_EDGE, (org.eclipse.gmf.runtime.notation.View)view);
- }
- }
- return super.getCommand(request);
- }
-
- «EXPAND xpt::Common::generatedMemberComment('Returns visual id from request parameters.')»
- protected int getVisualID(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest request) {
- Object id = request.getParameter(VISUAL_ID_KEY);
- return id instanceof Integer ? ((Integer) id).intValue() : -1;
- }
- «EXPAND semanticPart-»
- «EXPAND xpt::Common::generatedMemberComment('Returns editing domain from the host edit part.')»
- protected org.eclipse.emf.transaction.TransactionalEditingDomain getEditingDomain() {
- return ((org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) getHost()).getEditingDomain();
- }
- «EXPAND addDestroyShortcutsCommand-»
-
-«IF links->exists(not sansDomain) -»
- «EXPAND linkConstraints-»
-«ENDIF-»
-
- «EXPAND additions-»
-}
-«ENDDEFINE»
-«DEFINE attributes FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment('Extended request data key to hold editpart visual id.')»
- public static final String VISUAL_ID_KEY = "visual_id"; «EXPAND xpt::Common::nonNLS»
- «EXPAND xpt::Common::generatedMemberComment('Extended request data key to hold the edge view during a reconnect request.')»
- public static final String GRAPHICAL_RECONNECTED_EDGE = "graphical_edge"; «EXPAND xpt::Common::nonNLS»
- «EXPAND xpt::Common::generatedMemberComment»
- private final org.eclipse.gmf.runtime.emf.type.core.IElementType myElementType;
-«ENDDEFINE»
-«DEFINE _constructor FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected «baseItemSemanticEditPolicyClassName»(org.eclipse.gmf.runtime.emf.type.core.IElementType elementType) {
- myElementType = elementType;
- }
-«ENDDEFINE»
-«DEFINE addDestroyShortcutsCommand FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment('Clean all shortcuts to the host element from the same diagram')»
- protected void addDestroyShortcutsCommand(org.eclipse.gmf.runtime.common.core.command.ICompositeCommand cmd, org.eclipse.gmf.runtime.notation.View view) {
- «EXPAND xpt::Common::_assert('view.getEAnnotation(\"Shortcut\") == null')-»
- for (java.util.Iterator it = view.getDiagram().getChildren().iterator(); it.hasNext();) {
- org.eclipse.gmf.runtime.notation.View nextView = (org.eclipse.gmf.runtime.notation.View) it.next();
- if (nextView.getEAnnotation("Shortcut") == null || !nextView.isSetElement() || nextView.getElement() != view.getElement()) {«EXPAND xpt::Common::nonNLS»
- continue;
- }
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), nextView));
- }
- }
-«ENDDEFINE»
-«DEFINE semanticPart FOR gmfgen::GenDiagram-»
- «EXPAND getSemanticCommand-»
-
- «EXPAND addDeleteViewCommand-»
-
- «EXPAND getEditHelperCommand-»
-
- «EXPAND getContextElementType-»
-
- «EXPAND getSemanticCommandSwitch-»
-
- «EXPAND getConfigureCommand-»
- «EXPAND getCreateRelationshipCommand-»
- «EXPAND getCreateCommand-»
- // RS: add code for extended types
- «EXPAND getCreateExtendedTypeCommand-»
- «EXPAND getExtendedStartCreateRelationshipCommand-»
- «EXPAND getExtendedCompleteCreateRelationshipCommand-»
- // RS: End of add code for extended types
- «EXPAND getCreateSemanticServiceEditCommand-»
- «EXPAND getSetCommand-»
- «EXPAND getEditContextCommand-»
- «EXPAND getDestroyElementCommand-»
- «EXPAND getDestroyReferenceCommand-»
- «EXPAND getDuplicateCommand-»
- «EXPAND getMoveCommand-»
- «EXPAND getReorientReferenceRelationshipCommand-»
- «EXPAND getReorientRelationshipCommand-»
-
- «EXPAND getGEFWrapper-»
-
-«ENDDEFINE»
-«DEFINE getEditHelperCommand FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
- private org.eclipse.gef.commands.Command getEditHelperCommand(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest request, org.eclipse.gef.commands.Command editPolicyCommand) {
- if (editPolicyCommand != null) {
- org.eclipse.gmf.runtime.common.core.command.ICommand command = editPolicyCommand instanceof org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy ? ((org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy) editPolicyCommand).getICommand() : new org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy(editPolicyCommand);
- request.setParameter(«EXPAND xpt::diagram::edithelpers::BaseEditHelper::editPolicyCommandConstant», command);
- }
- org.eclipse.gmf.runtime.emf.type.core.IElementType requestContextElementType = getContextElementType(request);
- request.setParameter(«EXPAND xpt::diagram::edithelpers::BaseEditHelper::contextElementTypeConstant», requestContextElementType);
- org.eclipse.gmf.runtime.common.core.command.ICommand command = requestContextElementType.getEditCommand(request);
- request.setParameter(«EXPAND xpt::diagram::edithelpers::BaseEditHelper::editPolicyCommandConstant», null);
- request.setParameter(«EXPAND xpt::diagram::edithelpers::BaseEditHelper::contextElementTypeConstant», null);
- if (command != null) {
- if (!(command instanceof org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand)) {
- command = new org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand(getEditingDomain(), command.getLabel()).compose(command);
- }
- return new org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy(command);
- }
- return editPolicyCommand;
- }
-«ENDDEFINE»
-«DEFINE getContextElementType FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.gmf.runtime.emf.type.core.IElementType getContextElementType(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest request) {
- org.eclipse.gmf.runtime.emf.type.core.IElementType requestContextElementType = «getElementTypesQualifiedClassName()».getElementType(getVisualID(request));
- return requestContextElementType != null ? requestContextElementType : myElementType;
- }
-«ENDDEFINE»
-«DEFINE getSemanticCommand FOR gmfgen::GenDiagram-»
-«EXPAND xpt::Common::generatedMemberComment»
-protected org.eclipse.gef.commands.Command getSemanticCommand(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest request) {
- org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest completedRequest = completeRequest(request);
- org.eclipse.gef.commands.Command semanticCommand = getSemanticCommandSwitch(completedRequest);
- semanticCommand = getEditHelperCommand(completedRequest, semanticCommand);
- if (completedRequest instanceof org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest) {
- org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest destroyRequest = (org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest) completedRequest;
- return shouldProceed(destroyRequest) ? addDeleteViewCommand(semanticCommand, destroyRequest) : null;
- }
- return semanticCommand;
- }
-«ENDDEFINE»
-«DEFINE addDeleteViewCommand FOR gmfgen::GenDiagram-»
-«EXPAND xpt::Common::generatedMemberComment»
-protected org.eclipse.gef.commands.Command addDeleteViewCommand(org.eclipse.gef.commands.Command mainCommand, org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest completedRequest){
- org.eclipse.gef.commands.Command deleteViewCommand = getGEFWrapper(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), (org.eclipse.gmf.runtime.notation.View) getHost().getModel()));
- return mainCommand == null ? deleteViewCommand : mainCommand.chain(deleteViewCommand);
-}
-«ENDDEFINE»
-«DEFINE getSemanticCommandSwitch FOR gmfgen::GenDiagram-»
-«EXPAND xpt::Common::generatedMemberComment»
-protected org.eclipse.gef.commands.Command getSemanticCommandSwitch(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest req) {
- if (req instanceof org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest) {
- return getCreateRelationshipCommand((org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest) req);
- } else if (req instanceof org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest) {
- return getCreateCommand((org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest) req);
- } else if (req instanceof org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest) {
- return getConfigureCommand((org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest) req);
- } else if (req instanceof org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest) {
- return getDestroyElementCommand((org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest) req);
- } else if (req instanceof org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest) {
- return getDestroyReferenceCommand((org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest) req);
- } else if (req instanceof org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest) {
- return getDuplicateCommand((org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest) req);
- } else if (req instanceof org.eclipse.gmf.runtime.emf.type.core.requests.GetEditContextRequest) {
- return getEditContextCommand((org.eclipse.gmf.runtime.emf.type.core.requests.GetEditContextRequest) req);
- } else if (req instanceof org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest) {
- return getMoveCommand((org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest) req);
- } else if (req instanceof org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest) {
- return getReorientReferenceRelationshipCommand((org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest) req);
- } else if (req instanceof org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest) {
- return getReorientRelationshipCommand((org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest) req);
- } else if (req instanceof org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest) {
- return getSetCommand((org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest) req);
- }
- return null;
-}
-«ENDDEFINE»
-«DEFINE getConfigureCommand FOR gmfgen::GenDiagram-»
-«EXPAND xpt::Common::generatedMemberComment»
-protected org.eclipse.gef.commands.Command getConfigureCommand(org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest req) {
- return null;
-}
-«ENDDEFINE»
-«DEFINE getCreateRelationshipCommand FOR gmfgen::GenDiagram-»
-«EXPAND xpt::Common::generatedMemberComment»
-protected org.eclipse.gef.commands.Command getCreateRelationshipCommand(org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest req) {
- «IF papyrusgmfgenextension::GenerateUsingElementTypeCreationCommand.allInstances()->size()<1-»
- return null;
- «ENDIF»
- «IF papyrusgmfgenextension::GenerateUsingElementTypeCreationCommand.allInstances()->size()>0-»
- org.eclipse.papyrus.infra.services.edit.service.IElementEditService commandService = org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils.getCommandProvider(((org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart)getHost()).resolveSemanticElement());
- if(req.getElementType() != null) {
- commandService = org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils.getCommandProvider(req.getElementType());
- }
-
- if(commandService == null) {
- return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;
- }
-
- org.eclipse.gmf.runtime.common.core.command.ICommand semanticCommand = commandService.getEditCommand(req);
-
- if((semanticCommand != null) && (semanticCommand.canExecute())) {
- return getGEFWrapper(semanticCommand);
- }
- return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;
- «ENDIF»
-}
-«ENDDEFINE»
-«DEFINE getCreateCommand FOR gmfgen::GenDiagram-»
-«EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.gef.commands.Command getCreateCommand(org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest req) {
- // no more usage of the extended types here.
- return null;
- }
-«ENDDEFINE»
-«DEFINE getCreateExtendedTypeCommand FOR gmfgen::GenDiagram-»
-«EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.gef.commands.Command getExtendedTypeCreationCommand(org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest request, org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType requestElementType) {
- org.eclipse.papyrus.infra.services.edit.service.IElementEditService provider = org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils.getCommandProvider(request.getContainer());
- if(provider == null) {
- return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;
- }
- // Retrieve create command from the Element Edit service
- org.eclipse.gmf.runtime.common.core.command.ICommand createGMFCommand = provider.getEditCommand(request);
- return getGEFWrapper(createGMFCommand);
- }
-«ENDDEFINE»
-«DEFINE getExtendedStartCreateRelationshipCommand FOR gmfgen::GenDiagram-»
-«EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.gef.commands.Command getExtendedStartCreateRelationshipCommand(org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest request, org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType requestElementType) {
- org.eclipse.papyrus.infra.services.edit.service.IElementEditService provider = org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils.getCommandProvider(requestElementType);
- if(provider == null) {
- return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;
- }
- // Retrieve create command from the Element Edit service
- org.eclipse.gmf.runtime.common.core.command.ICommand createGMFCommand = provider.getEditCommand(request);
- return getGEFWrapper(createGMFCommand);
-}
-«ENDDEFINE»
-«DEFINE getExtendedCompleteCreateRelationshipCommand FOR gmfgen::GenDiagram-»
-«EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.gef.commands.Command getExtendedCompleteCreateRelationshipCommand(org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest request, org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType requestElementType) {
- org.eclipse.papyrus.infra.services.edit.service.IElementEditService provider = org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils.getCommandProvider(requestElementType);
- if(provider == null) {
- return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;
- }
- // Retrieve create command from the Element Edit service
- org.eclipse.gmf.runtime.common.core.command.ICommand createGMFCommand = provider.getEditCommand(request);
- return getGEFWrapper(createGMFCommand);
-}
-«ENDDEFINE»
-«DEFINE getSetCommand FOR gmfgen::GenDiagram-»
-«EXPAND xpt::Common::generatedMemberComment»
-protected org.eclipse.gef.commands.Command getSetCommand(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest req) {
- return null;
-}
-«ENDDEFINE»
-«DEFINE getEditContextCommand FOR gmfgen::GenDiagram-»
-«EXPAND xpt::Common::generatedMemberComment»
-protected org.eclipse.gef.commands.Command getEditContextCommand(org.eclipse.gmf.runtime.emf.type.core.requests.GetEditContextRequest req) {
- return null;
-}
-«ENDDEFINE»
-«DEFINE getDestroyElementCommand FOR gmfgen::GenDiagram-»
-«EXPAND xpt::Common::generatedMemberComment»
-protected org.eclipse.gef.commands.Command getDestroyElementCommand(org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest req) {
- return null;
-}
-«ENDDEFINE»
-«DEFINE getDestroyReferenceCommand FOR gmfgen::GenDiagram-»
-«EXPAND xpt::Common::generatedMemberComment»
-protected org.eclipse.gef.commands.Command getDestroyReferenceCommand(org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest req) {
- return null;
-}
-«ENDDEFINE»
-«DEFINE getDuplicateCommand FOR gmfgen::GenDiagram-»
-«EXPAND xpt::Common::generatedMemberComment»
-protected org.eclipse.gef.commands.Command getDuplicateCommand(org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest req) {
- return null;
-}
-«ENDDEFINE»
-«DEFINE getMoveCommand FOR gmfgen::GenDiagram-»
-«EXPAND xpt::Common::generatedMemberComment»
-protected org.eclipse.gef.commands.Command getMoveCommand(org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest req) {
- «REM»BEGIN: PapyrusGenCode«ENDREM»
- «REM»add move command«ENDREM»
- org.eclipse.emf.ecore.EObject targetCEObject = req.getTargetContainer();
- if(targetCEObject != null) {
- org.eclipse.papyrus.infra.services.edit.service.IElementEditService provider = org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils.getCommandProvider(targetCEObject);
- if(provider != null) {
- org.eclipse.gmf.runtime.common.core.command.ICommand moveCommand = provider.getEditCommand(req);
- if(moveCommand != null) {
- return new org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy(moveCommand);
- }
- }
- return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;
- } else {
- return getGEFWrapper(new org.eclipse.gmf.runtime.emf.type.core.commands.MoveElementsCommand(req));
- }
- «REM»END: PapyrusGenCode«ENDREM»
-
-}
-«ENDDEFINE»
-«DEFINE getReorientReferenceRelationshipCommand FOR gmfgen::GenDiagram-»
-«EXPAND xpt::Common::generatedMemberComment»
-protected org.eclipse.gef.commands.Command getReorientReferenceRelationshipCommand(org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest req) {
- return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;
-}
-«ENDDEFINE»
-«DEFINE getReorientRelationshipCommand FOR gmfgen::GenDiagram-»
-«EXPAND xpt::Common::generatedMemberComment»
-protected org.eclipse.gef.commands.Command getReorientRelationshipCommand(org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest req) {
- return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;
-}
-«ENDDEFINE»
-«DEFINE getGEFWrapper FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected final org.eclipse.gef.commands.Command getGEFWrapper(org.eclipse.gmf.runtime.common.core.command.ICommand cmd) {
- return new org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy(cmd);
- }
-«ENDDEFINE»
-
-«DEFINE _accessLinkConstraints FOR gmfgen::GenDiagram-»
-«getBaseItemSemanticEditPolicyQualifiedClassName()».getLinkConstraints()«-»
-«ENDDEFINE»
-
-«DEFINE canExistCall(gmfgen::GenLink link, String sourceVar, String targetVar) FOR gmfgen::FeatureLinkModelFacet-»
-«EXPAND _accessLinkConstraints FOR link.diagram».canExist«link.getUniqueIdentifier()»(«sourceVar», «targetVar»)«-»
-«ENDDEFINE»
-// NOTE, containerVar will be used only when link has other container than its source. It's safe to pass variable/method name that doesn't exist
-«DEFINE canExistCall(gmfgen::GenLink link, String containerVar, String linkVar, String sourceVar, String targetVar) FOR gmfgen::TypeLinkModelFacet-»
-«EXPAND _accessLinkConstraints FOR link.diagram».canExist«link.getUniqueIdentifier()»(«IF hasContainerOtherThanSource(self)»«containerVar», «ENDIF»«linkVar», «sourceVar», «targetVar»)«-»
-«ENDDEFINE»
-
-«DEFINE canCreateCall(gmfgen::GenLink link, String sourceVar, String targetVar) FOR gmfgen::FeatureLinkModelFacet-»
-«EXPAND _accessLinkConstraints FOR link.diagram».canCreate«link.getUniqueIdentifier()»(«sourceVar», «targetVar»)«-»
-«ENDDEFINE»
-// NOTE, containerVar will be used only when link has other container than its source. It's safe to pass variable/method name that doesn't exist
-// Yes, this is sorta hack, but no idea of better approach right now. Perhaps, CreateLinkUtils may always define getContainer() for TypeLinkModelFacet, and use getSource() by default?
-«DEFINE canCreateCall(gmfgen::GenLink link, String containerVar, String sourceVar, String targetVar) FOR gmfgen::TypeLinkModelFacet-»
-«EXPAND _accessLinkConstraints FOR link.diagram».canCreate«link.getUniqueIdentifier()»(«IF hasContainerOtherThanSource(self)»«containerVar», «ENDIF»«sourceVar», «targetVar»)«-»
-«ENDDEFINE»
-
-
-
-«REM»
- FIXME need to check constraint's provider to ensure we don't generate a field
- for e.g. Java (or Literal, which is unlikely, though) expressions
-
- [Papyrus Quick Fix] Do not generate field when the expression is provided
- by a GenJavaExpressionProvider.
-«ENDREM»
-«DEFINE linkConstraints FOR gmfgen::GenDiagram-»
-
- «EXPAND xpt::Common::generatedMemberComment»
- public static «getLinkCreationConstraintsClassName()» getLinkConstraints() {
- «getLinkCreationConstraintsClassName()» cached = «EXPAND plugin::Activator::instanceAccess FOR editorGen».getLinkConstraints();
- if (cached == null) {
- «EXPAND plugin::Activator::instanceAccess FOR editorGen».setLinkConstraints(cached = new «getLinkCreationConstraintsClassName()»());
- }
- return cached;
- }
-
-
-«EXPAND xpt::Common::generatedClassComment»
-public static class «getLinkCreationConstraintsClassName()» {
-
-«EXPAND xpt::Common::generatedMemberComment»
- public «getLinkCreationConstraintsClassName()»() {«REM»package-local for the BaseItemSemanticEditPolicy to instantiate. Perhaps, protected is better (i.e. if someone subclasses it?)«ENDREM»
- // use static method #getLinkConstraints() to access instance
- }
-
- «EXPAND canCreate FOREACH links-»
- «EXPAND canExist FOREACH links-»
-}
-«ENDDEFINE»
-«DEFINE canCreate FOR gmfgen::GenLink»
-«EXPAND xpt::Common::generatedMemberComment»
-public boolean canCreate«getUniqueIdentifier()»(«EXPAND canCreateParameters FOR modelFacet») {
- «EXPAND checkEMFConstraints FOR modelFacet-»
- return canExist«getUniqueIdentifier()»(«EXPAND canCreateValues FOR modelFacet»);
-}
-
-«ENDDEFINE»
-
-«REM»
- XXX for now, both constraints are injected into single method
- which may not be suitable for modification especially when mixing
- java and ocl constraints (former requires manual code).
- Better approach would be:
- if either is non-null and providers are not the same - introduce two methods,
- to check source and target separately. Otherwize, do it inplace.
-«ENDREM»
-«DEFINE canExist FOR gmfgen::GenLink»
- «EXPAND xpt::Common::generatedMemberComment»
- public boolean canExist«getUniqueIdentifier()»(«EXPAND canExistParameters FOR modelFacet») {
-«IF creationConstraints <> null and (creationConstraints.isValid() and null <> getDiagram().editorGen.expressionProviders)-»
- try {
-«IF null <> creationConstraints.sourceEnd-»
- «EXPAND _checkAdditionalConstraint(creationConstraints.sourceEnd, 'source', 'target', creationConstraints.getSourceEndContextClass(), creationConstraints.getTargetEndContextClass()) FOR creationConstraints.sourceEnd.provider-»
-«ENDIF-»
-«IF null <> creationConstraints.targetEnd-»
- «EXPAND _checkAdditionalConstraint(creationConstraints.targetEnd, 'target', 'source', creationConstraints.getTargetEndContextClass(), creationConstraints.getSourceEndContextClass()) FOR creationConstraints.targetEnd.provider-»
-«ENDIF-»
- return true;
- } catch(Exception e) {
- «EXPAND plugin::Activator::instanceAccess FOR getDiagram().editorGen».logError("Link constraint evaluation error", e);«EXPAND xpt::Common::nonNLS»
- return false;
- }
-«ELSE-»
- return true;
-«ENDIF-»
- }
-«ENDDEFINE»
-
-// FIXME mark as private (_) and move to impl::<find proper place>::LinkConstraints.xpt
-«DEFINE canCreateParameters FOR gmfgen::LinkModelFacet»«EXPAND sourceTargetParameters»«ENDDEFINE»// source and target are reasonable defaults
-«DEFINE canCreateParameters FOR gmfgen::TypeLinkModelFacet»«IF hasContainerOtherThanSource(self)»«EXPAND MetaModel::QualifiedClassName FOR containmentMetaFeature.genClass» container, «ENDIF»«EXPAND sourceTargetParameters»«ENDDEFINE»
-
-«DEFINE canExistParameters FOR gmfgen::LinkModelFacet»«EXPAND sourceTargetParameters»«ENDDEFINE»// source and target are reasonable defaults
-«DEFINE canExistParameters FOR gmfgen::TypeLinkModelFacet»«IF hasContainerOtherThanSource(self)»«EXPAND MetaModel::QualifiedClassName FOR containmentMetaFeature.genClass» container, «ENDIF»«EXPAND MetaModel::QualifiedClassName FOR metaClass» linkInstance, «EXPAND sourceTargetParameters»«ENDDEFINE»
-
-«DEFINE sourceTargetParameters FOR gmfgen::LinkModelFacet»«EXPAND MetaModel::QualifiedClassName FOR getSourceType()» source, «EXPAND MetaModel::QualifiedClassName FOR getTargetType()» target«ENDDEFINE»
-
-// these are in fact 'canExist' values
-«DEFINE canCreateValues FOR gmfgen::LinkModelFacet»source, target«ENDDEFINE» // defaults
-«DEFINE canCreateValues FOR gmfgen::TypeLinkModelFacet»«IF hasContainerOtherThanSource(self)»container, «ENDIF»null, source, target«ENDDEFINE»
-
-
-«DEFINE checkEMFConstraints FOR gmfgen::LinkModelFacet»«ERROR 'Unrecognized link model facet in checkEMFConstraints: ' + self.repr()»«ENDDEFINE»
-
-
-«DEFINE checkEMFConstraints FOR gmfgen::TypeLinkModelFacet-»
-«IF not containmentMetaFeature.ecoreFeature.oclIsUndefined()-»
- «LET childMetaFeature <> containmentMetaFeature and not isUnbounded(childMetaFeature.ecoreFeature) AS checkChildFeatureBounds-»
- «IF not isUnbounded(containmentMetaFeature.ecoreFeature) or checkChildFeatureBounds-»
-if («getContainerVariable(self)» != null) {
- «EXPAND checkEMFConstraints(self) FOR containmentMetaFeature-»
- «IF checkChildFeatureBounds-»
- «EXPAND checkEMFConstraints(self) FOR childMetaFeature-»
- «ENDIF-»
-}
- «ENDIF-»
- «ENDLET-»
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE checkEMFConstraints(modelFacet : gmfgen::TypeLinkModelFacet) FOR genmodel::GenFeature-»
-«IF not containmentMetaFeature.ecoreFeature.oclIsUndefined()-»
-«IF not isUnbounded(ecoreFeature)-»
-if («EXPAND featureBoundComparator(getContainerVariable(modelFacet), modelFacet.getSourceType())») {
- return false;
-}
-«ENDIF-»
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE checkEMFConstraints FOR gmfgen::FeatureLinkModelFacet-»
-if (source != null) {
- if («EXPAND featureBoundsConditionClause('source', getSourceType()) FOR metaFeature») {
- return false;
- }
- «IF isContains(metaFeature)-»
- if (source == target) {
- return false;
- }
- «ENDIF-»
-}
-«IF getReverse(metaFeature) <> null-»
-if (target != null && («EXPAND featureBoundsConditionClause('target', getTargetType()) FOR getReverse(metaFeature)»)) {
- return false;
-}
-«ENDIF»
-«ENDDEFINE»
-
-«DEFINE featureBoundsConditionClause(targetVar : String, targetType : genmodel::GenClass) FOR genmodel::GenFeature-»
-«REM»Checking upper bounds if was specified in MM«ENDREM»«-»
-«IF not ecoreFeature.oclIsUndefined()»
- «IF not isUnbounded(ecoreFeature)»«EXPAND featureBoundComparator(targetVar, targetType)»«ENDIF-»
- «REM»Checking uniqueness in addition if upper bounds != 1«ENDREM»«-»
- «IF not isSingleValued(ecoreFeature) and not isUnbounded(ecoreFeature)» || «ENDIF-»
- «REM»Checking uniqueness in if upper bounds !- 1«ENDREM»«-»
- «IF not isSingleValued(ecoreFeature)»«EXPAND featureUniquenessComparator(targetVar, targetType)»«ENDIF»
-«ENDIF»
-«ENDDEFINE»
-
-«DEFINE featureBoundComparator(featureVar : String, featureVarGenClass : genmodel::GenClass) FOR genmodel::GenFeature»«EXPAND MetaModel::getFeatureValue(featureVar, featureVarGenClass)»«IF ecoreFeature.upperBound.oclAsType(Integer) = 1» != null«ELSE».size() >= «ecoreFeature.upperBound.oclAsType(Integer)»«ENDIF»«ENDDEFINE»
-«DEFINE featureUniquenessComparator(featureVar : String, featureVarGenClass : genmodel::GenClass) FOR genmodel::GenFeature»«EXPAND MetaModel::getFeatureValue(featureVar, featureVarGenClass) FOR self».contains(target)«ENDDEFINE»
-
-
-«DEFINE _checkAdditionalConstraint(gmfgen::ValueExpression valueExpr, String sourceEndVar, String targetEndVar, genmodel::GenClass context, genmodel::GenClass oppositeEndContext) FOR gmfgen::GenExpressionProviderBase»
-«ERROR 'Have no idea what extra constraints to check for ' + self.repr()»
-«ENDDEFINE»
-
-«DEFINE _checkAdditionalConstraint(gmfgen::ValueExpression valueExpr, String sourceEndVar, String targetEndVar, genmodel::GenClass context, genmodel::GenClass oppositeEndContext) FOR gmfgen::GenExpressionInterpreter-»
- if («sourceEndVar» == null) {
- return true;
- } else {«REM»else is important here as it gives scope for the env variable«ENDREM»
- java.util.Map«EXPAND CodeStyle::G2('String', 'org.eclipse.emf.ecore.EClassifier') FOR container.editorGen.diagram» env = java.util.Collections.«EXPAND CodeStyle::G2('String', 'org.eclipse.emf.ecore.EClassifier') FOR container.editorGen.diagram»singletonMap(«EXPAND oppositeEndVariableNameValue», «EXPAND MetaModel::MetaClass FOR oppositeEndContext»);«EXPAND xpt::Common::nonNLS»
- Object «sourceEndVar»Val = «EXPAND xpt::expressions::getExpression::getExpression(valueExpr, context, 'env')».evaluate(«sourceEndVar», java.util.Collections.singletonMap(«EXPAND oppositeEndVariableNameValue», «targetEndVar»));«EXPAND xpt::Common::nonNLS»
- if (false == «sourceEndVar»Val instanceof Boolean || !((Boolean) «sourceEndVar»Val).booleanValue()) {
- return false;
- } // else fall-through
- }
-«ENDDEFINE»
-
-«DEFINE _checkAdditionalConstraint(gmfgen::ValueExpression valueExpr, String sourceEndVar, String targetEndVar, genmodel::GenClass context, genmodel::GenClass oppositeEndContext) FOR gmfgen::GenJavaExpressionProvider-»
-«IF injectExpressionBody and (valueExpr.body <> null and valueExpr.body.size() <> 0)-»
- «valueExpr.body»
-«ELSEIF throwException or (injectExpressionBody and (valueExpr.body = null or valueExpr.body.size() = 0))-»
- // TODO: implement this method, using «sourceEndVar» and «targetEndVar»
- // to access link source and target, respectively
- // Ensure that you remove @generated or mark it @generated NOT
- if (Boolean.TRUE.booleanValue()) {
- throw new java.lang.UnsupportedOperationException("No java implementation provided");«EXPAND xpt::Common::nonNLS»
- }
-«ELSE-»
- if (Boolean.TRUE.booleanValue()) {«REM»just in case there are two consecutive java expression with neither throw nor inject - avoid unreachable code.«ENDREM»
- return false;
- }
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE oppositeEndVariableNameValue FOR OclAny»"oppositeEnd"«ENDDEFINE»
-
-«DEFINE additions FOR gmfgen::GenDiagram»«ENDDEFINE»
-
-«DEFINE defaultConstructor FOR gmfgen::GenCommonBase-»
- «EXPAND xpt::Common::generatedMemberComment»
- public «itemSemanticEditPolicyClassName»() {
- «EXPAND defaultConstructorBody-»
- }
-«ENDDEFINE»
-
-«REM»
- This method should be called only with diagram, node or link used as a parameter
- (then elementType != null)
-«ENDREM»
-«DEFINE defaultConstructorBody FOR gmfgen::GenCommonBase-»
- «IF elementType = null-»
- «ERROR 'No element type in the passed node. Only diagram, node or link are supported in this template: ' + self.repr()-»
- «ENDIF-»
- super(«EXPAND xpt::providers::ElementTypes::accessElementType»);
-«ENDDEFINE»
-
-«REM»
- Generate generic method if using semantic creation command based on element types framework.
-«ENDREM»
-«DEFINE getCreateSemanticServiceEditCommand FOR gmfgen::GenDiagram-»
-«IF papyrusgmfgenextension::GenerateUsingElementTypeCreationCommand.allInstances()->size()>0-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.gmf.runtime.common.core.command.ICommand getSemanticCreationCommand(org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest req) {
- org.eclipse.papyrus.infra.services.edit.service.IElementEditService commandService = org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils.getCommandProvider(req.getContainer());
- if(commandService == null) {
- return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
- }
- return commandService.getEditCommand(req);
- }
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE getCreateSemanticServiceEditCommand FOR gmfgen::GenDiagram-»
-«IF papyrusgmfgenextension::GenerateUsingElementTypeCreationCommand.allInstances()->size()>0-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.gmf.runtime.common.core.command.ICommand getSemanticCreationCommand(org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest req) {
- org.eclipse.papyrus.infra.services.edit.service.IElementEditService commandService = org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils.getCommandProvider(req.getContainer());
- if(commandService == null) {
- return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
- }
- return commandService.getEditCommand(req);
- }
-«ENDIF-»
-«ENDDEFINE» \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/CompartmentItemSemanticEditPolicy.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/CompartmentItemSemanticEditPolicy.xpt
deleted file mode 100644
index e80a84c36c8..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/CompartmentItemSemanticEditPolicy.xpt
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (c) 2006, 2009 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:
- * Alexander Shatalin (Borland) - initial API and implementation
- * modified by Arthur Daussyt - arthur.daussy@atos.net (Atos)
- */
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension'»
-
-«DEFINE CompartmentItemSemanticEditPolicy FOR gmfgen::GenCompartment-»
- «EXPAND xpt::Common::copyright FOR getDiagram().editorGen-»
-package «getDiagram().editPoliciesPackageName»;
-
- «EXPAND xpt::Common::generatedClassComment»
-public class «itemSemanticEditPolicyClassName» extends «getDiagram().getBaseItemSemanticEditPolicyQualifiedClassName()» {
-
- «EXPAND _constructor-»
-
- «EXPAND xpt::diagram::editpolicies::childContainerCreateCommand::childContainerCreateCommand FOR childNodes->asSequence()-»
-
- «EXPAND additions-»
- «REM»
- Papyrus REM :
- Test if this compartment edit policy should used a referenced constraint for the move command.
- «ENDREM»
- «IF papyrusgmfgenextension::ConstrainedByReferenceCompartmentItemSemanticEditPolicy.allInstances()->select(v:papyrusgmfgenextension::ConstrainedByReferenceCompartmentItemSemanticEditPolicy|v.genView->includes(self))->size()<>0»
-
- «EXPAND getChildNodeReference FOR childNodes->asSequence()-»
-
- «EXPAND isCorrectCompartment-»
-
- «EXPAND constraintedMoveCommand-»
-
- «ENDIF»
-}
-«ENDDEFINE»
-
-«DEFINE _constructor FOR gmfgen::GenCompartment-»
- «EXPAND xpt::Common::generatedMemberComment»
- public «itemSemanticEditPolicyClassName»() {
- «EXPAND xpt::diagram::editpolicies::BaseItemSemanticEditPolicy::defaultConstructorBody FOR node-»
- }
-«ENDDEFINE»
-
-«DEFINE additions FOR gmfgen::GenCompartment-»
-«ENDDEFINE»
-
-«DEFINE getChildNodeReference FOR Sequence(gmfgen::GenNode)-»
-«IF not self->isEmpty()-»
-«EXPAND xpt::Common::generatedMemberComment»
-private static Set<EReference> compartmentReferences;
-
-«EXPAND xpt::Common::generatedMemberComment»
-static {
- compartmentReferences = new HashSet<EReference>(«self.modelFacet->size()»);
-
- «FOREACH self AS n-»
- «EXPAND childRef(n) FOR n.modelFacet-»
- «ENDFOREACH-»
-}
-«EXPAND xpt::Common::generatedMemberComment»
-protected Iterable<EReference> getCompartmentReferences() {
- return compartmentReferences;
-}
-«ENDIF-»
-
-«ENDDEFINE»
-
-«DEFINE childRef(node : gmfgen::GenNode) FOR gmfgen::TypeModelFacet-»
-compartmentReferences.add(«EXPAND MEtaModel::MetaFeature FOR node.modelFacet.containmentMetaFeature»);
-«ENDDEFINE»
-
-
-«DEFINE isCorrectCompartment FOR gmfgen::GenCompartment-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected boolean isMovedIntoCorrectCompartment(MoveRequest req){
- for(Object entry : req.getElementsToMove().entrySet()) {
- if(entry instanceof Map.Entry<?, ?>) {
- Map.Entry<?, ?> mapEntry = (Map.Entry<?, ?>)entry;
- Object key = mapEntry.getKey();
- if(key instanceof EObject) {
- EObject dropppedObject = (EObject)key;
- EObject semanticHost = ((IGraphicalEditPart)getHost()).resolveSemanticElement();
- boolean foundERefrences = false;
- if(semanticHost != null) {
- for(EReference ref : getCompartmentReferences()) {
- if(ref.isContainment()) {
- foundERefrences = PackageUtil.canContain(semanticHost.eClass(), ref, dropppedObject.eClass(), false);
- } else {
- foundERefrences = PackageUtil.canReference(semanticHost.eClass(), ref, dropppedObject.eClass());
- }
- if(foundERefrences) {
- return true;
- }
- }
- }
- }
- }
- }
- return false;
- }
-«ENDDEFINE»
-
-«DEFINE constraintedMoveCommand FOR gmfgen::GenCompartment-»
- «EXPAND xpt::Common::generatedMemberComment»
- @Override
- protected Command getMoveCommand(MoveRequest req) {
- if (isMovedIntoCorrectCompartment(req)){
- return super.getMoveCommand(req);
- } else {
- return UnexecutableCommand.INSTANCE;
- }
- }
-«ENDDEFINE»
-
-
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/DiagramItemSemanticEditPolicy.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/DiagramItemSemanticEditPolicy.xpt
deleted file mode 100644
index 63883132bc2..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/DiagramItemSemanticEditPolicy.xpt
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 2006, 2009 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:
- * Alexander Shatalin (Borland) - initial API and implementation
- */
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension'»
-«EXTENSION MetaModel»
-«EXTENSION xpt::GenModelUtils»
-«EXTENSION xpt::EMFUtils»
-«EXTENSION xpt::mutatingUtils»
-«REM» [Mutating] new getCreatecommand with an element switch «ENDREM»
-«AROUND DiagramItemSemanticEditPolicy FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::copyright FOR getDiagram().editorGen-»
-package «editPoliciesPackageName»;
- «EXPAND xpt::Common::generatedClassComment»
-public class «itemSemanticEditPolicyClassName» extends «getBaseItemSemanticEditPolicyQualifiedClassName()» {
- «EXPAND childMutatingContainerCreateCommand FOR self-»
- «EXPAND xpt::diagram::editpolicies::BaseItemSemanticEditPolicy::defaultConstructor-»
-
-
- «EXPAND getDuplicateCommand-»
-
- «EXPAND DuplicateAnythingCommand-»
-
- «EXPAND additions-»
-}
-«ENDAROUND»
-«REM» Mutating canvas create commands «ENDREM»
-«DEFINE childMutatingContainerCreateCommand FOR gmfgen::GenDiagram»
- «IF not self.topLevelNodes->isEmpty()-»
- «EXPAND createMutatingSwitch FOR self»
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.gef.commands.Command getCreateCommand(org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest req) {
- «REM»fjcano:: we set a parameter in the request to pass the Diagram «ENDREM»
- org.eclipse.gmf.runtime.notation.Diagram diagram = org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil.findDiagramFromEditPart(getHost());
- if (diagram != null) {
- req.getParameters().put(MultiDiagramUtil.BelongToDiagramSource, diagram);
- }
- org.eclipse.emf.ecore.EObject canvasElement = org.eclipse.papyrus.uml.diagram.common.part.DiagramCanvasSwitch.getCanvasElement(this);
- if (canvasElement == null) {
- return null;
- }
- aSwitch.setInfo(req.getElementType());
- req.setContainmentFeature(aSwitch.doSwitch(canvasElement));
- «EXPAND childNodeCreateCommand FOREACH topLevelNodes-»
- return super.getCreateCommand(req);
- }
- «ENDIF-»
-«ENDDEFINE»
-«DEFINE childNodeCreateCommand FOR gmfgen::GenNode-»
- «EXPAND childNodeCreateCommand(self) FOR modelFacet-»
-«ENDDEFINE»
-«DEFINE childNodeCreateCommand(gmfgen::GenNode node) FOR gmfgen::TypeModelFacet-»
- if («node.getDiagram().getElementTypesQualifiedClassName()».«node.getUniqueIdentifier()» == req.getElementType()) {
- return getGEFWrapper(«node.getCreateCommandQualifiedClassName()».create(req, canvasElement, org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils.getDiagramFrom(getHost())));
- }
-«ENDDEFINE»
-«REM» Mutating canvas Switch to create command «ENDREM»
-«DEFINE createMutatingSwitch FOR gmfgen::GenDiagram»
- «EXPAND xpt::Common::generatedMemberComment»
- static class EReferenceDiagramSwitch extends org.eclipse.papyrus.uml.diagram.common.util.BasicEcoreSwitch<org.eclipse.emf.ecore.EReference, org.eclipse.gmf.runtime.emf.type.core.IElementType> {
- @Override
- public org.eclipse.emf.ecore.EReference doSwitch(org.eclipse.emf.ecore.EObject modelElement) {
- «REM»getInfo provides the View«ENDREM»
- final org.eclipse.gmf.runtime.emf.type.core.IElementType type = getInfo();
- if (type == null) {
- return null;
- }
- «getModelSwitchQualifiedName(domainDiagramElement)»<org.eclipse.emf.ecore.EReference> aSwitch = new «getModelSwitchQualifiedName(domainDiagramElement)»<org.eclipse.emf.ecore.EReference>() {
- @Override
- public org.eclipse.emf.ecore.EReference case«domainDiagramElement.ecoreClass.name»(«getQualifiedInterfaceName(domainDiagramElement)» modelElement) {
- org.eclipse.emf.ecore.EReference reference = null;
- «FOREACH topLevelNodes AS node-»
- if (type.equals(«node.getDiagram().getElementTypesQualifiedClassName()».«node.getUniqueIdentifier()»)) {
- reference = «EXPAND MetaModel::MetaFeature FOR node.modelFacet.containmentMetaFeature»;
- }
- «ENDFOREACH-»
- return reference;
- }
- «FOREACH getReferencingObjects().typeSelect(AlternateCanvas) AS referencer»
- @Override
- public org.eclipse.emf.ecore.EReference case«referencer.domainDiagramElement.ecoreClass.name»(«getQualifiedInterfaceName(referencer.domainDiagramElement)» modelElement) {
- org.eclipse.emf.ecore.EReference reference = null;
- «FOREACH referencer.alternateTopLevelNodes AS node-»
- if (type.equals(«node.genTopLevelNode.getDiagram().getElementTypesQualifiedClassName()».«node.genTopLevelNode.getUniqueIdentifier()»)) {
- reference = «EXPAND MetaModel::MetaFeature FOR node.typeModelFacet.containmentMetaFeature-»;
- }
- «ENDFOREACH-»
- return reference;
- }
- «ENDFOREACH-»
- };
-
- return aSwitch.doSwitch(modelElement);
- }
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- private EReferenceDiagramSwitch aSwitch = new EReferenceDiagramSwitch();
-«ENDDEFINE»
-«DEFINE getDuplicateCommand FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
-protected org.eclipse.gef.commands.Command getDuplicateCommand(org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest req) {
- org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain = ((org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) getHost()).getEditingDomain();
- org.eclipse.gmf.runtime.notation.Diagram currentDiagram = null;
- if(getHost()instanceof org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) {
- currentDiagram = ((org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart)getHost()).getNotationView().getDiagram();
- }
- return getGEFWrapper(new DuplicateAnythingCommand(editingDomain, req, currentDiagram));
-}
-«ENDDEFINE»
-«DEFINE DuplicateAnythingCommand FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedClassComment»
-private static class DuplicateAnythingCommand extends org.eclipse.papyrus.uml.diagram.common.commands.DuplicateNamedElementCommand {
-«EXPAND xpt::Common::generatedMemberComment»
-private org.eclipse.gmf.runtime.notation.Diagram diagram;
- «EXPAND DAC_constructor-»
- «EXPAND DAC_additions-»
-}
-«ENDDEFINE»
-«DEFINE DAC_constructor FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
-public DuplicateAnythingCommand(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain, org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest req,org.eclipse.gmf.runtime.notation.Diagram currentDiagram) {
- super(editingDomain, req.getLabel(), req.getElementsToBeDuplicated(), req.getAllDuplicatedElementsMap(),currentDiagram);
-this.diagram = currentDiagram;
-}
-«ENDDEFINE»
-«DEFINE DAC_additions FOR gmfgen::GenDiagram-»
-«ENDDEFINE»
-«DEFINE additions FOR gmfgen::GenDiagram-»
-«ENDDEFINE» \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/LinkItemSemanticEditPolicy.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/LinkItemSemanticEditPolicy.xpt
deleted file mode 100644
index 975c4e92fe3..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/LinkItemSemanticEditPolicy.xpt
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2007, 2009 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:
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Borland) - [243151] explicit source/target for links
- * modified by Vincent Lorenzo (CEA-LIST)
- */
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension'»
-«EXTENSION xpt::diagram::editpolicies::LinkUtils»
-«EXTENSION xpt::diagram::editpolicies::UtilsItemSemanticEditPolicy»
-
-«DEFINE LinkItemSemanticEditPolicy FOR gmfgen::GenLink-»
- «EXPAND xpt::Common::copyright FOR diagram.editorGen-»
-package «getDiagram().editPoliciesPackageName»;
-
-«EXPAND xpt::Common::generatedClassComment»
-public class «itemSemanticEditPolicyClassName» extends «diagram.getBaseItemSemanticEditPolicyQualifiedClassName()» {
-
- «EXPAND xpt::diagram::editpolicies::BaseItemSemanticEditPolicy::defaultConstructor-»
-
- «EXPAND classBody-»
-
- «EXPAND additions-»
-}
-«ENDDEFINE»
-
-«DEFINE classBody FOR gmfgen::GenLink-»
- «EXPAND getDestroySemanticCommand(self) FOR modelFacet -»
- «IF isTypeLink()»«EXPAND xpt::diagram::editpolicies::linkCommands::linkCommands»«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE getDestroySemanticCommand(gmfgen::GenLink genLink) FOR gmfgen::LinkModelFacet-»
- «ERROR 'Unsupported model facet: ' + self.repr()-»
-«ENDDEFINE»
-
-«DEFINE getDestroySemanticCommand(gmfgen::GenLink genLink) FOR gmfgen::FeatureLinkModelFacet-»
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.gef.commands.Command getDestroyReferenceCommand(org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest req) {
- return getGEFWrapper(«EXPAND impl::diagram::commands::DeleteLinkCommand::newDeleteReferenceLinkCommand(genLink, 'req')»);
- }
-«ENDDEFINE»
-
-«DEFINE getDestroySemanticCommand(gmfgen::GenLink genLink) FOR gmfgen::TypeLinkModelFacet-»
-
-«REM»
-Test to know which delete command should be used in the generated code : "Traditional Delete Command" or the Delete Service
-«ENDREM»
-
- «IF papyrusgmfgenextension::EditPartUsingDeleteService.allInstances()->select(v:papyrusgmfgenextension::EditPartUsingDeleteService|v.genView->includes(genLink))->size()<>0»
- «EXPAND xpt::Common::generatedMemberComment»
- «EXPAND xpt::diagram::editpolicies::UtilsItemSemanticEditPolicy::getDestroyElementCommandByService-»
- «ELSE»
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.gef.commands.Command getDestroyElementCommand(org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest req) {
- org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand cmd = new org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
- java.util.List<org.eclipse.emf.ecore.EObject> todestroy=new java.util.ArrayList<org.eclipse.emf.ecore.EObject>();
- todestroy.add(req.getElementToDestroy());
- //cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper(new org.eclipse.emf.edit.command.DeleteCommand(getEditingDomain(),todestroy )));
- return getGEFWrapper(cmd.reduce());
- //return getGEFWrapper(«EXPAND impl::diagram::commands::DeleteLinkCommand::newDeleteLinkWithClassCommand(genLink, 'req')»);
- }
- «ENDIF-»
-«ENDDEFINE»
-
-«DEFINE additions FOR gmfgen::GenLink»«ENDDEFINE» \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/NodeItemSemanticEditPolicy.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/NodeItemSemanticEditPolicy.xpt
deleted file mode 100644
index 167f968a019..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/NodeItemSemanticEditPolicy.xpt
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Copyright (c) 2007, 2010 Borland Software Corporation and others
- *
- * 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:
- * Alexander Shatalin (Borland) - initial API and implementation
- * Artem Tikhomirov (Borland) - [257632] do not rely on EditPart presence for element deletion
- * modified by Vincent Lorenzo (CEA-LIST)
- */
-
-«REM»
- This template should be called only for non-design nodes (modelFacet != null)
- because *ItemSemanticEditPolicy responsible for dealing with semantic model
- elements and meaningless (should not be generated) for pure design nodes.
-«ENDREM»
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension'»
-«EXTENSION xpt::diagram::editpolicies::Utils»
-«EXTENSION xpt::diagram::editpolicies::UtilsItemSemanticEditPolicy»
-
-«DEFINE NodeItemSemanticEditPolicy FOR gmfgen::GenNode-»
- «EXPAND xpt::Common::copyright FOR getDiagram().editorGen-»
-package «getDiagram().editPoliciesPackageName»;
-
-«EXPAND xpt::Common::generatedClassComment»
-public class «itemSemanticEditPolicyClassName» extends «getDiagram().getBaseItemSemanticEditPolicyQualifiedClassName()» {
-
- «EXPAND xpt::diagram::editpolicies::BaseItemSemanticEditPolicy::defaultConstructor-»
-
- «EXPAND xpt::diagram::editpolicies::childContainerCreateCommand::childContainerCreateCommand FOR childNodes->asSequence()-»
-
-«REM»
-Papyrus REM :
-Test to know how the delete of this EditPart is done : we used the DeleteService or the "Traditional method"
-«ENDREM»
- «IF papyrusgmfgenextension::EditPartUsingDeleteService.allInstances()->select(v:papyrusgmfgenextension::EditPartUsingDeleteService|v.genView->includes(self))->size()<>0»
- «EXPAND xpt::Common::generatedMemberComment»
- «EXPAND xpt::diagram::editpolicies::UtilsItemSemanticEditPolicy::getDestroyElementCommandByService-»
- «ELSE»
- «EXPAND getDestroyElementCommand-»
- «IF hasChildrenOrCompartments(self)-»
- «EXPAND addDestroyChildNodesCommand-»
- «ENDIF-»
- «ENDIF-»
-
- «EXPAND xpt::diagram::editpolicies::linkCommands::linkCommands-»
-
- «EXPAND additions-»
-}
-«ENDDEFINE»
-
-«DEFINE getDestroyElementCommand FOR gmfgen::GenNode-»
-«EXPAND xpt::Common::generatedMemberComment»
-protected org.eclipse.gef.commands.Command getDestroyElementCommand(org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest req) {
- org.eclipse.gmf.runtime.notation.View view = (org.eclipse.gmf.runtime.notation.View) getHost().getModel();
- org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand cmd = new org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
- «REM»«EXPAND destroyEdges('view')-»«ENDREM»
- org.eclipse.emf.ecore.EAnnotation annotation = view.getEAnnotation("Shortcut");«EXPAND xpt::Common::nonNLS»
- if (annotation == null) {
- // there are indirectly referenced children, need extra commands: «childNodes->union(compartments.childNodes->asBag())->exists(not isDirectlyOwned(self))»
- «IF hasChildrenOrCompartments(self)-»
- addDestroyChildNodesCommand(cmd);
- «ENDIF-»
- addDestroyShortcutsCommand(cmd, view);
- // delete host element
- java.util.List<org.eclipse.emf.ecore.EObject> todestroy=new java.util.ArrayList<org.eclipse.emf.ecore.EObject>();
- todestroy.add(req.getElementToDestroy());
- //cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper(new org.eclipse.emf.edit.command.DeleteCommand(getEditingDomain(),todestroy )));
- } else {«REM»Here, we may play smart and don't generate else for non-toplevel nodes(which can't be shortcuts). Is it worth doing?«ENDREM»
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), view));
- }
- return getGEFWrapper(cmd.reduce());
-}
-«ENDDEFINE»
-
-«DEFINE addDestroyChildNodesCommand FOR gmfgen::GenNode-»
-
- «EXPAND xpt::Common::generatedMemberComment»
- protected void addDestroyChildNodesCommand(org.eclipse.gmf.runtime.common.core.command.ICompositeCommand cmd) {
- org.eclipse.gmf.runtime.notation.View view = (org.eclipse.gmf.runtime.notation.View) getHost().getModel();
- for («EXPAND CodeStyle::G('java.util.Iterator', '?' /*FIXME Refactor once Notation model is Java5*/)» nit = view.getChildren().iterator(); nit.hasNext();) {
- org.eclipse.gmf.runtime.notation.Node node = (org.eclipse.gmf.runtime.notation.Node) nit.next();
- switch («EXPAND xpt::editor::VisualIDRegistry::getVisualIDMethodCall FOR getDiagram()»(node)) {
- «EXPAND destroyChildNodes('node', self) FOREACH childNodes-»
- «IF compartments->notEmpty()»«FOREACH compartments AS compartment-»
- «EXPAND xpt::Common::caseVisualID FOR compartment»
- for («EXPAND CodeStyle::G('java.util.Iterator', '?' /*FIXME Refactor once Notation model is Java5*/)» cit = node.getChildren().iterator(); cit.hasNext();) {
- org.eclipse.gmf.runtime.notation.Node cnode = (org.eclipse.gmf.runtime.notation.Node) cit.next();
- switch («EXPAND xpt::editor::VisualIDRegistry::getVisualIDMethodCall FOR getDiagram()»(cnode)) {
- «EXPAND destroyChildNodes('cnode', self) FOREACH compartment.childNodes-»
- }
- }
- break;
- «ENDFOREACH»«ENDIF-»
- }
- }
- }
-«ENDDEFINE»
-
-«DEFINE destroyChildNodes(nodeVar : String, gmfgen::GenNode genNode) FOR gmfgen::GenChildNode-»
-«EXPAND xpt::Common::caseVisualID»
- «EXPAND destroyEdges(nodeVar)-»
- cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(new org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest(getEditingDomain(), «nodeVar».getElement(), false))); // directlyOwned: «self.isDirectlyOwned(genNode)»
- // don't need explicit deletion of «nodeVar» as parent's view deletion would clean child views as well
- // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), «nodeVar»));
- break;
-«ENDDEFINE»
-
-// @param view - Notation element for the passed node
-// assumes 'cmd' to point to composite command
-«DEFINE destroyEdges(String view) FOR gmfgen::GenNode-»
-«REM»
- XXX: Though semantic editpolicy is supposed to create commands that operate with semantic elements only,
- old code used to delegate child/link deletion to respective editparts, which in turn led to semantic commands
- being combined with notational commands (BaseItemSemanticEditPolicy#addDeleteViewCommand()).
- ---
- Use DiagramUpdater.get[Incoming|Outgoing]View instead, to clean links that are not present on a diagram
- (but don't forget to clean corresponding Edge, if any)
-«ENDREM-»
-
-«REM»
-
-// This part is commented for Papyrus
-// Some Papyrus diagrams with lots of elements are reaching the 65K Java limit for method size.
-// The following change is not supposed to modify the method behavior, just propose a slight more
-// compact code to avoid size limit.
-
-«IF genIncomingLinks->notEmpty()-»
- for («EXPAND CodeStyle::G('java.util.Iterator', '?' /*FIXME Refactor once Notation model is Java5*/)» it = «view».getTargetEdges().iterator(); it.hasNext();) {
- org.eclipse.gmf.runtime.notation.Edge incomingLink = (org.eclipse.gmf.runtime.notation.Edge) it.next();
-«FOREACH genIncomingLinks AS il-»
- if («EXPAND xpt::editor::VisualIDRegistry::getVisualIDMethodCall FOR getDiagram()»(incomingLink) == «EXPAND xpt::editor::VisualIDRegistry::visualID FOR il») {
- «EXPAND impl::diagram::commands::DeleteLinkCommand::newRequest('r', 'incomingLink') FOR il-»
- cmd.add(«EXPAND impl::diagram::commands::DeleteLinkCommand::newInstance('r') FOR il»);
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));
- continue;
- }
-«ENDFOREACH-»
- }
-«ENDIF-»
-«IF genOutgoingLinks->notEmpty()-»
- for («EXPAND CodeStyle::G('java.util.Iterator', '?' /*FIXME Refactor once Notation model is Java5*/)» it = «view».getSourceEdges().iterator(); it.hasNext();) {
- org.eclipse.gmf.runtime.notation.Edge outgoingLink = (org.eclipse.gmf.runtime.notation.Edge) it.next();
-«FOREACH genOutgoingLinks AS ol-»
- if («EXPAND xpt::editor::VisualIDRegistry::getVisualIDMethodCall FOR getDiagram()»(outgoingLink) == «EXPAND xpt::editor::VisualIDRegistry::visualID FOR ol») {
- «EXPAND impl::diagram::commands::DeleteLinkCommand::newRequest('r', 'outgoingLink') FOR ol-»
- cmd.add(«EXPAND impl::diagram::commands::DeleteLinkCommand::newInstance('r') FOR ol»);
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), outgoingLink));
- continue;
- }
-«ENDFOREACH-»
- }
-«ENDIF-»
-«ENDREM-»
-
-«IF genIncomingLinks->notEmpty()-»
- for («EXPAND CodeStyle::G('java.util.Iterator', '?' /*FIXME Refactor once Notation model is Java5*/)» it = «view».getTargetEdges().iterator(); it.hasNext();) {
- org.eclipse.gmf.runtime.notation.Edge incomingLink = (org.eclipse.gmf.runtime.notation.Edge) it.next();
- switch(«EXPAND xpt::editor::VisualIDRegistry::getVisualIDMethodCall FOR getDiagram()»(incomingLink)) {
-«IF genIncomingLinks->select(l | l.modelFacet.oclIsKindOf(gmfgen::FeatureLinkModelFacet))->notEmpty()-»
-«FOREACH genIncomingLinks->select(l | l.modelFacet.oclIsKindOf(gmfgen::FeatureLinkModelFacet)) AS il-»
- case «EXPAND xpt::editor::VisualIDRegistry::visualID FOR il»:
-«ENDFOREACH-»
- org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest destroyRefReq = new org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest(incomingLink.getSource().getElement(), null, incomingLink.getTarget().getElement(), false);
- cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand(destroyRefReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));
- break;
-«ENDIF-»
-«IF genIncomingLinks->select(l | l.modelFacet.oclIsKindOf(gmfgen::TypeLinkModelFacet))->notEmpty()-»
-«FOREACH genIncomingLinks->select(l | l.modelFacet.oclIsKindOf(gmfgen::TypeLinkModelFacet)) AS il-»
- case «EXPAND xpt::editor::VisualIDRegistry::visualID FOR il»:
-«ENDFOREACH-»
- org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest destroyEltReq = new org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest(incomingLink.getElement(), false);
- cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), incomingLink));
- break;
-«ENDIF-»
- }
- }
-«ENDIF-»
-
-«IF genOutgoingLinks->notEmpty()-»
- for («EXPAND CodeStyle::G('java.util.Iterator', '?' /*FIXME Refactor once Notation model is Java5*/)» it = «view».getSourceEdges().iterator(); it.hasNext();) {
- org.eclipse.gmf.runtime.notation.Edge outgoingLink = (org.eclipse.gmf.runtime.notation.Edge) it.next();
- switch(«EXPAND xpt::editor::VisualIDRegistry::getVisualIDMethodCall FOR getDiagram()»(outgoingLink)) {
-«IF genOutgoingLinks->select(l | l.modelFacet.oclIsKindOf(gmfgen::FeatureLinkModelFacet))->notEmpty()-»
-«FOREACH genOutgoingLinks->select(l | l.modelFacet.oclIsKindOf(gmfgen::FeatureLinkModelFacet)) AS ol-»
- case «EXPAND xpt::editor::VisualIDRegistry::visualID FOR ol»:
-«ENDFOREACH-»
- org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest destroyRefReq = new org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest(outgoingLink.getSource().getElement(), null, outgoingLink.getTarget().getElement(), false);
- cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand(destroyRefReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), outgoingLink));
- break;
-«ENDIF-»
-«IF genOutgoingLinks->select(l | l.modelFacet.oclIsKindOf(gmfgen::TypeLinkModelFacet))->notEmpty()-»
-«FOREACH genOutgoingLinks->select(l | l.modelFacet.oclIsKindOf(gmfgen::TypeLinkModelFacet)) AS ol-»
- case «EXPAND xpt::editor::VisualIDRegistry::visualID FOR ol»:
-«ENDFOREACH-»
- org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest destroyEltReq = new org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest(outgoingLink.getElement(), false);
- cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(destroyEltReq));
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), outgoingLink));
- break;
-«ENDIF-»
- }
- }
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE additions FOR gmfgen::GenNode»«ENDDEFINE»
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/UtilsItemSemanticEditPolicy.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/UtilsItemSemanticEditPolicy.xpt
deleted file mode 100644
index c35de5a52f4..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/UtilsItemSemanticEditPolicy.xpt
+++ /dev/null
@@ -1,50 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * 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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension'»
-
-
-«REM» Command for the EditPart which use the Delete Service «ENDREM»
- «DEFINE getDestroyElementCommandByService FOR gmfgen::GenNode-»
- protected org.eclipse.gef.commands.Command getDestroyElementCommand(org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest req) {
- org.eclipse.emf.ecore.EObject selectedEObject = req.getElementToDestroy();
- org.eclipse.papyrus.infra.services.edit.service.IElementEditService provider =org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- org.eclipse.gmf.runtime.common.core.command.ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy(deleteCommand);
- }
- }
- return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;
- }
- «ENDDEFINE»
-
- «DEFINE getDestroyElementCommandByService FOR gmfgen::TypeLinkModelFacet-»
- protected org.eclipse.gef.commands.Command getDestroyElementCommand(org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest req) {
- org.eclipse.emf.ecore.EObject selectedEObject = req.getElementToDestroy();
- org.eclipse.papyrus.infra.services.edit.service.IElementEditService provider =org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils.getCommandProvider(selectedEObject);
- if(provider != null) {
- // Retrieve delete command from the Element Edit service
- org.eclipse.gmf.runtime.common.core.command.ICommand deleteCommand = provider.getEditCommand(req);
-
- if(deleteCommand != null) {
- return new org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy(deleteCommand);
- }
- }
- return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;
- }
- «ENDDEFINE»
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/childContainerCreateCommand.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/childContainerCreateCommand.xpt
deleted file mode 100644
index cf42cf9558d..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/childContainerCreateCommand.xpt
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2007, 2009 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:
- * Alexander Shatalin (Borland) - initial API and implementation
- */
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension'»
-
-«EXTENSION xpt::diagram::updater::Utils»
-
-«DEFINE childContainerCreateCommand FOR Sequence(gmfgen::GenNode)-»
-«IF not self->isEmpty()-»
-
- «EXPAND xpt::Common::generatedMemberComment»
- protected org.eclipse.gef.commands.Command getCreateCommand(org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest req) {
- org.eclipse.gmf.runtime.emf.type.core.IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
- return super.getCreateCommand(req);
- }
- org.eclipse.gmf.runtime.emf.type.core.IElementType baseElementType = requestElementType;
- boolean isExtendedType = false;
- if(requestElementType instanceof org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType) {
- baseElementType = org.eclipse.papyrus.infra.extendedtypes.util.ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
- isExtendedType = true;
- } else {
- // no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = org.eclipse.papyrus.infra.extendedtypes.util.ElementTypeUtils.findClosestNonExtendedElementType((org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType)requestElementType);
- isExtendedType = true;
- }
- }
- «FOREACH self AS n-»
- «EXPAND childNodeCreateCommand(n) FOR n.modelFacet-»
- «ENDFOREACH-»
- return super.getCreateCommand(req);
- }
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE childNodeCreateCommand(node : gmfgen::GenNode) FOR gmfgen::TypeModelFacet-»
-if («EXPAND xpt::providers::ElementTypes::accessElementType FOR node» == baseElementType) {
- «IF papyrusgmfgenextension::GenerateUsingElementTypeCreationCommand.allInstances()->size()>0-»
- // adjust the containment feature
- org.eclipse.emf.ecore.EReference containmentFeature = «EXPAND MetaModel::MetaFeature FOR self.childMetaFeature»;
- req.setContainmentFeature(containmentFeature);
- «ENDIF»
- if(isExtendedType) {
- return getExtendedTypeCreationCommand(req, (org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType)requestElementType);
- }
- «IF papyrusgmfgenextension::GenerateUsingElementTypeCreationCommand.allInstances()->size()>0»
- return getGEFWrapper(getSemanticCreationCommand(req));
- «ELSE-»
- return getGEFWrapper(new «node.getCreateCommandQualifiedClassName()»(req, org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils.getDiagramFrom(getHost())));
- «ENDIF»
-
-}
-«ENDDEFINE» \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/linkCommands.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/linkCommands.xpt
deleted file mode 100644
index fa0416046b0..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/linkCommands.xpt
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Copyright (c) 2007, 2009 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:
- * Alexander Shatalin (Borland) - initial API and implementation
- * Dmitry Stadnik (Borland) - creation logic was moved in commands
- * Michael Golubev (Borland) - [243151] explicit source/target for links
- */
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension'»
-«EXTENSION xpt::diagram::editpolicies::Utils»
-
-«REM»
- * Start start of link creation.
- * User click to this editpart and start dragging with link tool.
- * Complete end of the command
- * User points to this editpart as a link target and release mouse button.
- *
- * Outgoing the node is link source
- * This element could be a source for this type of link.
- * Incoming the node is link destination
- * This element could be a target for this type of link.
- *
- * Parameters:
- *
- * diagram GenDiagram used to collect all defined links
- *
- * this Instance of GenLinkEnd for the element link could be creates to/from.
- * This could be GenNode or GenLink in case of links to links,
- * in the latter case it is assumed that its a TypeLink (so its model facet is LinkTypeModelFacet),
- * because RefLinks don't have underlying semantic identity
- *
-«ENDREM»
-
-«DEFINE linkCommands FOR gmfgen::GenLinkEnd-»
- «IF getAllPotentialLinks(self)->size() > 0-»
- «EXPAND createLinkCommands -»
- «ENDIF-»
- «IF getReroutableTypeLinks(self)->size() > 0-»
- «EXPAND reorientTypeLinkCommands -»
- «ENDIF-»
- «IF getReroutableRefLinks(self)->size() > 0-»
- «EXPAND reorientRefLinkCommands -»
- «ENDIF-»
-«ENDDEFINE»
-
-«DEFINE createLinkCommands FOR gmfgen::GenLinkEnd-»
-
-«IF papyrusgmfgenextension::GenerateUsingElementTypeCreationCommand.allInstances()->size()<1»
-«EXPAND xpt::Common::generatedMemberComment»
-protected org.eclipse.gef.commands.Command getCreateRelationshipCommand(
- org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest req) {
- org.eclipse.gef.commands.Command command = req.getTarget() == null ?
- getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
- return command != null ? command : super.getCreateRelationshipCommand(req);
-}
-«ENDIF»
-
-«EXPAND xpt::Common::generatedMemberComment»
-protected org.eclipse.gef.commands.Command getStartCreateRelationshipCommand(
- org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest req) {
- org.eclipse.gmf.runtime.emf.type.core.IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
- return null;
- }
- org.eclipse.gmf.runtime.emf.type.core.IElementType baseElementType = requestElementType;
- boolean isExtendedType = false;
- if(requestElementType instanceof org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType) {
- baseElementType = org.eclipse.papyrus.infra.extendedtypes.util.ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
- isExtendedType = true;
- } else {
- // no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = org.eclipse.papyrus.infra.extendedtypes.util.ElementTypeUtils.findClosestNonExtendedElementType((org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType)requestElementType);
- isExtendedType = true;
- }
- }
- «EXPAND startLinkCommands(self) FOREACH getAllPotentialLinks(self)-»
- return null;
-}
-
-«EXPAND xpt::Common::generatedMemberComment»
-protected org.eclipse.gef.commands.Command getCompleteCreateRelationshipCommand(
- org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest req) {
- org.eclipse.gmf.runtime.emf.type.core.IElementType requestElementType = req.getElementType();
- if(requestElementType == null) {
- return null;
- }
- org.eclipse.gmf.runtime.emf.type.core.IElementType baseElementType = requestElementType;
- boolean isExtendedType = false;
- if(requestElementType instanceof org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType) {
- baseElementType = org.eclipse.papyrus.infra.extendedtypes.util.ElementTypeUtils.getClosestDiagramType(requestElementType);
- if(baseElementType != null) {
- isExtendedType = true;
- } else {
- // no reference element type ID. using the closest super element type to give more opportunities, but can lead to bugs.
- baseElementType = org.eclipse.papyrus.infra.extendedtypes.util.ElementTypeUtils.findClosestNonExtendedElementType((org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType)requestElementType);
- isExtendedType = true;
- }
- }
- «EXPAND completeLinkCommands(self) FOREACH getAllPotentialLinks(self)-»
- return null;
-}
-«ENDDEFINE»
-
-«DEFINE startLinkCommands(linkEnd : gmfgen::GenLinkEnd) FOR gmfgen::GenLink-»
-if («EXPAND xpt::providers::ElementTypes::accessElementType» == baseElementType) {
- «IF createStartLinkCommand(self, linkEnd)-»
- if(isExtendedType) {
- return getExtendedStartCreateRelationshipCommand(req, (org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType)requestElementType);
- }
- return getGEFWrapper(new «getCreateCommandQualifiedClassName()»(req,
- «IF createStartIncomingLinkCommand(self, linkEnd)-»
- req.getTarget(), req.getSource()
- «ELSE-»
- req.getSource(), req.getTarget()
- «ENDIF-»
- ));
- «ELSE-»
- return null;
- «ENDIF-»
-}
-«ENDDEFINE»
-
-«DEFINE completeLinkCommands(linkEnd : gmfgen::GenLinkEnd) FOR gmfgen::GenLink-»
-if («EXPAND xpt::providers::ElementTypes::accessElementType» == baseElementType) {
- «IF createCompleteLinkCommand(self, linkEnd)-»
- if(isExtendedType) {
- return getExtendedCompleteCreateRelationshipCommand(req, (org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType)requestElementType);
- }
- return getGEFWrapper(new «getCreateCommandQualifiedClassName()»(req,
- «IF createCompleteOutgoingLinkCommand(self, linkEnd)-»
- req.getTarget(), req.getSource()
- «ELSE-»
- req.getSource(), req.getTarget()
- «ENDIF-»
- ));
- «ELSE-»
- return null;
- «ENDIF-»
-}
-«ENDDEFINE»
-
-«DEFINE reorientTypeLinkCommands FOR gmfgen::GenLinkEnd-»
-
-«EXPAND xpt::Common::generatedMemberComment(
- 'Returns command to reorient EClass based link. New link target or source\n' +
- 'should be the domain model element associated with this node.\n'
-)»
-protected org.eclipse.gef.commands.Command getReorientRelationshipCommand(
- org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest req) {
- switch (getVisualID(req)) {
- «EXPAND reorientLinkCommand FOREACH getReroutableTypeLinks(self)-»
- }
- return super.getReorientRelationshipCommand(req);
-}
-«ENDDEFINE»
-
-«DEFINE reorientRefLinkCommands FOR gmfgen::GenLinkEnd-»
-
-«EXPAND xpt::Common::generatedMemberComment(
- 'Returns command to reorient EReference based link. New link target or source\n' +
- 'should be the domain model element associated with this node.\n'
-)»
-protected org.eclipse.gef.commands.Command getReorientReferenceRelationshipCommand(
- org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest req) {
- switch (getVisualID(req)) {
- «EXPAND reorientLinkCommand FOREACH getReroutableRefLinks(self)-»
- }
- return super.getReorientReferenceRelationshipCommand(req);
-}
-«ENDDEFINE»
-
-«DEFINE reorientLinkCommand FOR gmfgen::GenLink-»
-«EXPAND xpt::Common::caseVisualID»
- return getGEFWrapper(new «getReorientCommandQualifiedClassName()»(req));
-«ENDDEFINE»
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/updater/DiagramUpdater.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/updater/DiagramUpdater.xpt
deleted file mode 100644
index e12a3b7641b..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/updater/DiagramUpdater.xpt
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
- * Copyright (c) 2007, 2009 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:
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Borland) - [243151] explicit source/target for links
- */
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension'»
-«EXTENSION xpt::EMFUtils»
-«EXTENSION xpt::diagram::updater::Utils»
-«EXTENSION xpt::diagram::editpolicies::LinkUtils»
-«EXTENSION xpt::GenModelUtils»
-«EXTENSION gmf::GenModelUtils»
-
-«DEFINE checkChildElementVisualID(inLoop : Boolean) FOR gmfgen::GenNode-»
-if (visualID == «EXPAND xpt::editor::VisualIDRegistry::visualID») {
- result.add(new «getDiagram().editorGen.diagramUpdater.getNodeDescriptorQualifiedClassName()»(«IF null <> modelFacet.childMetaFeature»«EXPAND MetaModel::DowncastToEObject('childElement') FOR getTypeGenClassX(modelFacet.childMetaFeature)»«ENDIF», visualID));
-«IF inLoop-»
- continue;
-«ENDIF-»
-}
-«ENDDEFINE»
-
-«REM»TEST «ENDREM»
-«DEFINE getSemanticChildrenOfView FOR gmfgen::GenContainerBase-»
-
- «EXPAND xpt::Common::generatedMemberComment»
-public static «EXPAND CodeStyle::G('java.util.List', getDiagram().editorGen.diagramUpdater.getNodeDescriptorQualifiedClassName())» «EXPAND getSemanticChildrenMethodName»(org.eclipse.gmf.runtime.notation.View view) {
- «IF getSemanticChildrenChildFeatures(self)->size() > 0 or self.getPhantomNodes()->size() > 0-»
- «EXPAND defineModelElement-»
- «EXPAND CodeStyle::newGenericInstance('result', 'java.util.LinkedList', getDiagram().editorGen.diagramUpdater.getNodeDescriptorQualifiedClassName())»();
-«REM»childMetaFeature can be null here!«ENDREM»«-»
- «FOREACH getSemanticChildrenChildFeatures(self) AS childMetaFeature-»
- «IF null = childMetaFeature-»
- { /*FIXME no containment/child feature found in the genmodel, toolsmith need to specify Class here manually*/ childElement = /*FIXME no containment/child feature found in the genmodel, toolsmith need to specify correct one here manually*/;
- «ELSEIF isListType(childMetaFeature)-»
- for («EXPAND CodeStyle::G('java.util.Iterator', '?')» it = «EXPAND MetaModel::getFeatureValue('modelElement', self.getModelElementType()) FOR childMetaFeature».iterator(); it.hasNext();) {
- «EXPAND MetaModel::DeclareAndAssign('childElement', 'it.next()', true) FOR getTypeGenClassX(childMetaFeature)»
- «ELSE-»
- { «EXPAND MetaModel::DeclareAndAssign('childElement', 'modelElement', self.getModelElementType(), childMetaFeature) FOR getTypeGenClassX(childMetaFeature)»
- «ENDIF-»
- int visualID = «EXPAND xpt::editor::VisualIDRegistry::getNodeVisualIDMethodCall FOR getDiagram()»(view, «EXPAND MetaModel::DowncastToEObject('childElement') FOR getTypeGenClassX(childMetaFeature)»);
- «EXPAND checkChildElementVisualID(null <> childMetaFeature and isListType(childMetaFeature)) FOREACH getSemanticChildren(self, childMetaFeature)-»
- }
- «ENDFOREACH-»
-«IF self.getPhantomNodes()->notEmpty()-»
- org.eclipse.emf.ecore.resource.Resource resource = modelElement.eResource();
- for (java.util.Iterator semanticIterator = getPhantomNodesIterator(resource); semanticIterator.hasNext();) {
- org.eclipse.emf.ecore.EObject childElement = (org.eclipse.emf.ecore.EObject) semanticIterator.next();
-
- if (childElement == modelElement) {
- continue;
- }
- «EXPAND addNextIfPhantom FOREACH self.getPhantomNodes()-»
- }
-«ENDIF-»
- return result;
- «ELSE-»
- return «EXPAND CodeStyle::emptyList»;
- «ENDIF-»
-}
-«ENDDEFINE»
-«REM»FIN TEST «ENDREM»
-
-
-
-«REM»The EcoreSwitch that will navigate the proper features according to the canvas' EObject«ENDREM»
-«DEFINE createUpdaterSwitch FOR gmfgen::GenDiagram»
-«EXPAND xpt::Common::generatedMemberComment»
- static class ThisDiagramUpdaterSwitch extends es.cv.gvcase.mdt.common.util.BasicEcoreSwitch<java.util.List<«editorGen.diagramUpdater.getNodeDescriptorQualifiedClassName()»>, org.eclipse.gmf.runtime.notation.View> {
- @Override
- public java.util.List<«editorGen.diagramUpdater.getNodeDescriptorQualifiedClassName()»> doSwitch(org.eclipse.emf.ecore.EObject modelElement) {
- «REM»getInfo provides the View«ENDREM»
- final org.eclipse.gmf.runtime.notation.View view = getInfo();
- if (view == null) {
- return java.util.Collections.EMPTY_LIST;
- }
-
- «getModelSwitchQualifiedName(domainDiagramElement)»<java.util.List<«editorGen.diagramUpdater.getNodeDescriptorQualifiedClassName()»>> aSwitch = new «getModelSwitchQualifiedName(domainDiagramElement)»<java.util.List<«editorGen.diagramUpdater.getNodeDescriptorQualifiedClassName()»>>() {
- «REM»Start of cases«ENDREM»
- @Override
- public java.util.List<«editorGen.diagramUpdater.getNodeDescriptorQualifiedClassName()»> case«domainDiagramElement.ecoreClass.name»(«EXPAND MetaModel::MetaClass FOR domainDiagramElement» modelElement) {
- java.util.List<«editorGen.diagramUpdater.getNodeDescriptorQualifiedClassName()»> result = new java.util.LinkedList<«editorGen.diagramUpdater.getNodeDescriptorQualifiedClassName()»>();
- «FOREACH getSemanticChildrenChildFeatures(self) AS childMetaFeature-»
- «IF null = childMetaFeature-»
- { /*FIXME no containment/child feature found in the genmodel, toolsmith need to specify Class here manually*/ childElement = /*FIXME no containment/child feature found in the genmodel, toolsmith need to specify correct one here manually*/;
- «ELSEIF isListType(childMetaFeature)-»
- for (java.util.Iterator it = «EXPAND xpt::Common::getFeatureValue('modelElement', getModelElementType()) FOR childMetaFeature».iterator(); it.hasNext();) {
- «EXPAND MetaModel::MetaClass FOR getTypeGenClassX(childMetaFeature)» childElement = («getQualifiedInterfaceName(getTypeGenClassX(childMetaFeature))») it.next();
- «ELSE-»
- { «getQualifiedInterfaceName(getTypeGenClassX(childMetaFeature))» childElement = «EXPAND xpt::Common::getFeatureValue('modelElement', getModelElementType()) FOR childMetaFeature»;
- «ENDIF-»
- int visualID = «EXPAND xpt::editor::VisualIDRegistry::getNodeVisualIDMethodCall FOR getDiagram()»(view, «EXPAND xpt::Common::castToEObject FOR getTypeGenClassX(childMetaFeature)»childElement);
- «EXPAND checkChildElementVisualID(null <> childMetaFeature and isListType(childMetaFeature)) FOREACH getSemanticChildren(self, childMetaFeature)-»
- }
- «ENDFOREACH-»
- «IF not getPhantomNodes(self).isEmpty()-»
- org.eclipse.emf.ecore.resource.Resource resource = modelElement.eResource();
- for (java.util.Iterator semanticIterator = getPhantomNodesIterator(resource); semanticIterator.hasNext();) {
- org.eclipse.emf.ecore.EObject childElement = (org.eclipse.emf.ecore.EObject) semanticIterator.next();
- if (childElement == modelElement) {
- continue;
- }
- «EXPAND addNextIfPhantom FOREACH getPhantomNodes(self)-»
- }
- «ENDIF-»
- return result;
- }
-
- «FOREACH getReferencingObjects().typeSelect(AlternateCanvas) AS referencer»
- @Override
- public java.util.List<«editorGen.diagramUpdater.getNodeDescriptorQualifiedClassName()»> case«referencer.domainDiagramElement.ecoreClass.name»(«getQualifiedInterfaceName(referencer.domainDiagramElement)» modelElement) {
- java.util.List<«editorGen.diagramUpdater.getNodeDescriptorQualifiedClassName()»> result = new java.util.LinkedList<«editorGen.diagramUpdater.getNodeDescriptorQualifiedClassName()»>();
- «REM»«FOREACH getSemanticChildrenChildFeatures(this) AS childMetaFeature-»«ENDREM»
- «FOREACH getMutatingChildrenFeatures(referencer) AS childMetaFeature-»
- «IF null = childMetaFeature-»
- { /*FIXME no containment/child feature found in the genmodel, toolsmith need to specify Class here manually*/ childElement = /*FIXME no containment/child feature found in the genmodel, toolsmith need to specify correct one here manually*/;
- «ELSEIF isListType(childMetaFeature)-»
- for (java.util.Iterator it = «EXPAND xpt::Common::getFeatureValue('modelElement', referencer.domainDiagramElement) FOR childMetaFeature».iterator(); it.hasNext();) {
- «getQualifiedInterfaceName(getTypeGenClassX(childMetaFeature))» childElement = («getQualifiedInterfaceName(getTypeGenClassX(childMetaFeature))») it.next();
- «ELSE-»
- { «getQualifiedInterfaceName(getTypeGenClassX(childMetaFeature))» childElement = «EXPAND xpt::Common::getFeatureValue('modelElement', referencer.domainDiagramElement) FOR childMetaFeature»;
- «ENDIF-»
- int visualID = «EXPAND xpt::editor::VisualIDRegistry::getNodeVisualIDMethodCall FOR getDiagram()»(view, «EXPAND xpt::Common::castToEObject FOR getTypeGenClassX(childMetaFeature)»childElement);
- «REM»«EXPAND checkChildElementVisualID(null != childMetaFeature && isListType(childMetaFeature)) FOREACH getSemanticChildren(this, childMetaFeature)-»«ENDREM»
- «EXPAND checkMutatingChildElementVisualID(null <> childMetaFeature and isListType(childMetaFeature)) FOREACH getMutatingSemanticChildren(referencer, childMetaFeature)-»
- }
- «ENDFOREACH-»
- «REM»«IF !getPhantomNodes(this).isEmpty()-»
- org.eclipse.emf.ecore.resource.Resource resource = modelElement.eResource();
- for (java.util.Iterator semanticIterator = getPhantomNodesIterator(resource); semanticIterator.hasNext();) {
- org.eclipse.emf.ecore.EObject childElement = (org.eclipse.emf.ecore.EObject) semanticIterator.next();
- if (childElement == modelElement) {
- continue;
- }
- «EXPAND addNextIfPhantom FOREACH getPhantomNodes(this)-»
- }
- «ENDIF-»
- «ENDREM»
- return result;
- }
- «ENDFOREACH»
-
- «REM»End of cases«ENDREM»
- };
- return aSwitch.doSwitch(modelElement);
- }
- };
- «REM»The global variable for a Switch«ENDREM»
- «EXPAND xpt::Common::generatedMemberComment»
- private static ThisDiagramUpdaterSwitch aSwitch = new ThisDiagramUpdaterSwitch();
-«ENDDEFINE»
-«REM» Mutating check Visual ID «ENDREM»
-«DEFINE checkMutatingChildElementVisualID(boolean inLoop) FOR papyrusgmfgenextension::AlternateGenTopLevelNode-»
- if (visualID == «EXPAND visualID») {
- result.add(new «genTopLevelNode.getDiagram().editorGen.diagramUpdater.getNodeDescriptorQualifiedClassName()»(«IF null <> typeModelFacet.childMetaFeature»«EXPAND xpt::Common::castToEObject FOR getTypeGenClassX(typeModelFacet.childMetaFeature)»«ENDIF»childElement, visualID));
- «IF inLoop-»
- continue;
- «ENDIF-»
- }
-«ENDDEFINE»
-«REM» Mutating VisualID espansion «ENDREM»
-«DEFINE visualID FOR papyrusgmfgenextension::AlternateGenTopLevelNode»
- «EXPAND xpt::editor::VisualIDRegistry::visualID FOR genTopLevelNode»
-«ENDDEFINE»
-«DEFINE defineModelElement FOR gmfgen::GenContainerBase-»
-if (!view.isSetElement()) {
- return java.util.Collections.EMPTY_LIST;
-}
-«EXPAND MetaModel::DeclareAndAssign('modelElement', 'view.getElement()') FOR getModelElementType()»
-«ENDDEFINE»
-«DEFINE getContainedLinksByTypeMethodBody(genLink : gmfgen::GenLink, sourceVarDefined : Boolean) FOR gmfgen::TypeLinkModelFacet-»
-java.util.Collection result = new java.util.LinkedList();
- «LET isListType(childMetaFeature) AS inLoop-»
-«IF inLoop-»
-for (java.util.Iterator links = «EXPAND MetaModel::getFeatureValue('container', childMetaFeature.genClass) FOR childMetaFeature».iterator(); links.hasNext();) {
- org.eclipse.emf.ecore.EObject linkObject = (org.eclipse.emf.ecore.EObject ) links.next();
- if («EXPAND MetaModel::NotInstance('linkObject') FOR metaClass») {
- continue;
- }
- «EXPAND MetaModel::DeclareAndAssign('link', 'linkObject') FOR metaClass»
-«ELSE-»
- «IF getTypeGenClassX(childMetaFeature) = metaClass-»
- «EXPAND MetaModel::DeclareAndAssign('link', 'container', getSourceType(), childMetaFeature) FOR metaClass»
- «ELSE-»
- «EXPAND MetaModel::DeclareAndAssign('linkObject', 'container', getSourceType(), childMetaFeature) FOR getTypeGenClassX(childMetaFeature)»
- if («EXPAND MetaModel::NotInstance('linkObject') FOR metaClass») {
- return result;
- }
- «EXPAND MetaModel::DeclareAndAssign('link', 'linkObject') FOR metaClass»
- «ENDIF-»
-«ENDIF-»
- «EXPAND checkLinkVisualID(genLink, inLoop)-»
-
- «REM»BEGIN: PapyrusGenCode«ENDREM»
- «REM»Test if the source and target reference the same feature, in this case generation with collection«ENDREM»
-
- «IF self.sourceMetaFeature=self.targetMetaFeature»
- //Papyrus GenCode
- «EXPAND defineLinkDestinationForSet(inLoop) FOR self-»
- «IF null <> sourceMetaFeature-»
- «EXPAND defineLinkSource(inLoop)-»
- «IF sourceVarDefined-»
- «EXPAND checkLinkSource(inLoop)-»
- «ENDIF-»
- «EXPAND addLinkDescriptor(genLink, 'src', 'dst')-»
- «ELSE-»
- «EXPAND addLinkDescriptor(genLink, 'container', 'dst')-»
- «ENDIF-»
- «ELSE»
- «REM»END: PapyrusGenCode«ENDREM»
- «EXPAND defineLinkDestination(inLoop)-»
- «IF null <> sourceMetaFeature-»
- «EXPAND defineLinkSource(inLoop)-»
- «IF sourceVarDefined-»
- «EXPAND checkLinkSource(inLoop)-»
- «ENDIF-»
- «EXPAND addLinkDescriptor(genLink, 'src', 'dst')-»
- «ELSE-»
- «EXPAND addLinkDescriptor(genLink, 'container', 'dst')-»
- «ENDIF-»
-«REM»BEGIN: PapyrusGenCode«ENDREM»
- «ENDIF-»
- «REM»END: PapyrusGenCode«ENDREM»
-«IF inLoop-»
-}
-«ENDIF-»
- «ENDLET-»
-return result;
-«ENDDEFINE»
-«DEFINE defineLinkSource(inLoop : Boolean) FOR gmfgen::TypeLinkModelFacet-»
- «IF isListType(sourceMetaFeature)-»
-java.util.List sources = «EXPAND MetaModel::getFeatureValue('link', metaClass) FOR sourceMetaFeature»;
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»In the case of set greater that 1! not equal«ENDREM»
-Object theSource = sources.size() >= 1 ? sources.get(0) : null;
-«REM»END: PapyrusGenCode«ENDREM»
-if («EXPAND MetaModel::NotInstance('theSource') FOR getSourceType()») {
- «EXPAND stopLinkProcessing(inLoop)-»
-}
-«EXPAND MetaModel::DeclareAndAssign('src', 'theSource', true) FOR getSourceType()»
- «ELSE-»
-«EXPAND MetaModel::DeclareAndAssign('src', 'link', metaClass, sourceMetaFeature) FOR getSourceType()»
- «ENDIF-»
-«ENDDEFINE»
-«DEFINE checkLinkSource(inLoop : Boolean) FOR gmfgen::TypeLinkModelFacet-»
-if (src != source) {
- «EXPAND stopLinkProcessing(inLoop)-»
-}
-«ENDDEFINE»
-
-
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»Define target and source that can manage set«ENDREM»
-«DEFINE defineLinkDestinationForSet(inLoop:Boolean) FOR gmfgen::TypeLinkModelFacet-»
- «IF isListType(targetMetaFeature)-»
-java.util.List targets = «EXPAND MetaModel::getFeatureValue('link', metaClass) FOR targetMetaFeature»;
-Object theTarget = targets.size() >=2 ? targets.get(1) : null;
-if («EXPAND MetaModel::NotInstance('theTarget') FOR getTargetType()») {
- «EXPAND stopLinkProcessing(inLoop)-»
-}
-«EXPAND MetaModel::DeclareAndAssign('dst', 'theTarget', true) FOR getTargetType()»
- «ELSE-»
-«EXPAND MetaModel::DeclareAndAssign('dst', 'link', metaClass, targetMetaFeature) FOR getTargetType()»
- «ENDIF-»
-«ENDDEFINE»
-«REM»END: PapyrusGenCode«ENDREM»
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/DeleteElementAction.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/DeleteElementAction.xpt
deleted file mode 100644
index c03d1e35059..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/DeleteElementAction.xpt
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2008, 2009 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
- * modified by Vincent Lorenzo (CEA LIST) - Vincent Lorenzo
- */
-«REM» This class is not used, now we use org.eclipse.papyrus.common.actions.DeleteFromModelAction «ENDREM»
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-
-«DEFINE DeleteElementAction FOR gmfgen::GenDiagram-»
-//This file is not used.
-//The DeleteElementAction is removed from the plugin and replaced by DeleteFromModelAction in the plugin org.eclipse.diagram.common.
-«ENDDEFINE»
-
-
-
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/DiagramEditorContextMenuProvider.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/DiagramEditorContextMenuProvider.xpt
deleted file mode 100644
index 3d7f0f04528..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/DiagramEditorContextMenuProvider.xpt
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2008, 2009 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
- * modified by Vincent Lorenzo (CEA LIST) - Vincent Lorenzo
- */
-«REM»We remove the dependance with DeleteElementAction. Now this action is added to the popup menu with the extension point org.eclipse.ui.popup
-in org.eclipse.papyrus.uml.diagram.common «ENDREM»
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-
-«DEFINE className FOR gmfgen::GenDiagram»DiagramEditorContextMenuProvider«ENDDEFINE»
-
-«DEFINE qualifiedClassName FOR gmfgen::GenDiagram»«editorGen.editor.packageName».«EXPAND className»«ENDDEFINE»
-
-«DEFINE DiagramEditorContextMenuProvider FOR gmfgen::GenDiagram-»
-«EXPAND xpt::Common::copyright FOR editorGen-»
-package «editorGen.editor.packageName»;
-
-«EXPAND xpt::Common::generatedClassComment»
-public class «EXPAND className» extends org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider {
-
- «EXPAND xpt::Common::generatedMemberComment»
- private org.eclipse.ui.IWorkbenchPart part;
- «REM»
- «EXPAND xpt::Common::generatedMemberComment»
- private «EXPAND xpt::editor::DeleteElementAction::qualifiedClassName» deleteAction;
- «ENDREM»
- «EXPAND xpt::Common::generatedMemberComment»
- public DiagramEditorContextMenuProvider(org.eclipse.ui.IWorkbenchPart part, org.eclipse.gef.EditPartViewer viewer) {
- super(part, viewer);
- this.part = part;
- «REM»
- deleteAction = new «EXPAND xpt::editor::DeleteElementAction::qualifiedClassName»(part);
- deleteAction.init();
- «ENDREM»
- }
- «REM»
- «EXPAND xpt::Common::generatedMemberComment»
- public void dispose() {
- if (deleteAction != null) {
- deleteAction.dispose();
- deleteAction = null;
- }
- super.dispose();
- }
- «ENDREM»
- «EXPAND xpt::Common::generatedMemberComment»
- public void buildContextMenu(final org.eclipse.jface.action.IMenuManager menu) {
- getViewer().flush();
- try {
- org.eclipse.emf.transaction.util.TransactionUtil.getEditingDomain(
- (org.eclipse.emf.ecore.EObject) getViewer().getContents().getModel()).runExclusive(new Runnable() {
-
- public void run() {
- org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.ContributionItemService.getInstance().contributeToPopupMenu(
- DiagramEditorContextMenuProvider.this, part);
- menu.remove(org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds.ACTION_DELETE_FROM_MODEL);
- «REM»
- menu.appendToGroup("editGroup", deleteAction);
- «ENDREM»
- }
- });
- } catch (Exception e) {
- «editorGen.plugin.getActivatorQualifiedClassName()».getInstance().logError("Error building context menu", e);
- }
- }
- «EXPAND additions-»
-}
-«ENDDEFINE»
-
-«DEFINE additions FOR gmfgen::GenDiagram-»
-«ENDDEFINE»
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/ViewInfoUtils.qvto b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/ViewInfoUtils.qvto
deleted file mode 100644
index 5663d5d1a43..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/ViewInfoUtils.qvto
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2007 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:
- * Alexander Shatalin (Borland) - initial API and implementation
- * Emilien Perico (Atos Origin) - update template from ext to qvto for GMF 2.2 compliance
- */
-modeltype gmfgen uses "http://www.eclipse.org/gmf/2009/GenModel";
-
-library ViewInfoUtils;
-
-
-helper diagramViewInfoGetterName(diagram : gmfgen::GenDiagram) : String {
- return cleanString("get"+diagram.domainDiagramElement.ecoreClass.name+"_"+diagram.visualID.toString()+"ViewInfo")
-}
-
-helper nodeViewInfoGetterName(node : gmfgen::GenNode) : String {
- return cleanString("get"+node.modelFacet.metaClass.ecoreClass.name+"_"+node.visualID.toString()+"ViewInfo")
-}
-
-helper nodeViewInfoGetterName(compartment : gmfgen::GenCompartment) : String {
- return cleanString("get"+compartment.title+"_"+compartment.visualID.toString()+"ViewInfo")
-}
-
-helper linkViewInfoGetterName(link : gmfgen::GenLink) : String {
- return cleanString("get"+linkEClass(link.modelFacet)+"_"+link.visualID.toString()+"ViewInfo")
-}
-
-helper linkEClass(facet : gmfgen::TypeModelFacet) : String {
- return cleanString(facet.metaClass.ecoreClass.name)
-}
-
-helper linkEClass(facet : gmfgen::ModelFacet) : String {
- return ""
-}
-
-helper featureForLinkGetter(facet : gmfgen::ModelFacet) : String {
- return ""
-}
-
-helper featureForLinkGetter(facet : gmfgen::FeatureLinkModelFacet) : String {
- return cleanString(facet.metaFeature.ecoreFeature.name)
-}
-
-helper cleanString(string : String) : String {
- return string.replace(" ", "_")
-}
-
-helper getContainerVidualID(node : gmfgen::GenNode) : String {
- return node.visualID.toString()
-}
-
-helper getContainerVidualID(compartment : gmfgen::GenCompartment) : String {
- return compartment.node.visualID.toString()
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/VisualIDRegistry.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/VisualIDRegistry.xpt
deleted file mode 100644
index 331acf4b3a4..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/VisualIDRegistry.xpt
+++ /dev/null
@@ -1,491 +0,0 @@
-/*
- * Copyright (c) 2007, 2010 Borland Software Corporation and others
- *
- * 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:
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #372479
- */
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/emf/2002/GenModel'»
-
-«EXTENSION xpt::editor::Utils»
-«EXTENSION xpt::diagram::editpolicies::LinkUtils»
-«EXTENSION xpt::diagram::updater::Utils»
-
-
-«DEFINE VisualIDRegistry FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::copyright FOR getDiagram().editorGen-»
-package «editorGen.editor.packageName»;
-
- «EXPAND xpt::Common::generatedClassComment(
- 'This registry is used to determine which type of visual object should be\n' +
- 'created for the corresponding Diagram, Node, ChildNode or Link represented\n' +
- 'by a domain model object.\n'
- )»
-public class «visualIDRegistryClassName» {
-
- «EXPAND attributes-»
-
- «EXPAND getViewVisualID-»
-
- «EXPAND getModelID-»
-
- «EXPAND getVisualID-»
-
- «EXPAND getType-»
-
- «EXPAND getDiagramVisualID-»
-
- «EXPAND getNodeVisualID-»
-
- «EXPAND canCreateNode-»
-
- «EXPAND getLinkWithClassVisualID-»
-
- «EXPAND isDiagram-»
-
- «EXPAND _constraintMethods-»
-
- «EXPAND checkNodeVisualID-»
-
- «EXPAND isCompartmentVisualID-»
-
- «EXPAND isSemanticLeafVisualID-»
-
- «EXPAND runtimeTypedInstance-»
-
- «EXPAND additions-»
-}
-«ENDDEFINE»
-
-«REM»
- <Definitions of templates for outside usage>
-«ENDREM»
-
-«DEFINE visualID FOR gmfgen::GenCommonBase»«getEditPartQualifiedClassName()».VISUAL_ID«ENDDEFINE»
-
-«DEFINE modelID FOR gmfgen::GenDiagram»«getEditPartQualifiedClassName()».MODEL_ID«ENDDEFINE»
-
-«DEFINE getVisualIDMethodCall FOR gmfgen::GenDiagram»«getVisualIDRegistryQualifiedClassName()».«EXPAND getVisualIdMethodName»«ENDDEFINE»
-
-«DEFINE getModelIDMethodCall FOR gmfgen::GenDiagram»«getVisualIDRegistryQualifiedClassName()».«EXPAND getModelIDMethodName»«ENDDEFINE»
-
-«REM»
- XXX looks like these methods would produce incorrect result for visualID of GenDiagram itself - ask Vano if
- getType() method shouldn't be fixed similar to getVisualID, i.e. map diagram's visual id to MODEL_ID instead plain String.valueOf()
-«ENDREM»
-«DEFINE typeMethodCall(visualIdVar : String) FOR gmfgen::GenCommonBase»«getDiagram().getVisualIDRegistryQualifiedClassName()».«EXPAND getTypeMethodName FOR getDiagram()»(«visualIdVar»)«ENDDEFINE»
-«DEFINE typeMethodCall FOR gmfgen::GenCommonBase»«getDiagram().getVisualIDRegistryQualifiedClassName()».«EXPAND getTypeMethodName FOR getDiagram()»(«EXPAND visualID»)«ENDDEFINE»
-
-«DEFINE getDiagramVisualIDMethodCall FOR gmfgen::GenDiagram»«getVisualIDRegistryQualifiedClassName()».«EXPAND getDiagramVisualIDMethodName»«ENDDEFINE»
-
-«DEFINE getNodeVisualIDMethodCall FOR gmfgen::GenDiagram»«getVisualIDRegistryQualifiedClassName()».«EXPAND getNodeVisualIDMethodName»«ENDDEFINE»
-
-«DEFINE canCreateNodeMethodCall FOR gmfgen::GenDiagram»«getVisualIDRegistryQualifiedClassName()».«EXPAND canCreateNodeMethodName»«ENDDEFINE»
-
-«DEFINE getLinkWithClassVisualIDMethodCall FOR gmfgen::GenDiagram»«getVisualIDRegistryQualifiedClassName()».«EXPAND getLinkWithClassVisualIDMethodName»«ENDDEFINE»
-
-«REM»
- </Definitions of templates for outside usage>
-«ENDREM»
-
-«DEFINE attributes FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
- private static final String DEBUG_KEY = "«editorGen.plugin.iD»/debug/visualID"; «EXPAND xpt::Common::nonNLS»
-«ENDDEFINE»
-
-«DEFINE getViewVisualID FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
-public static int «EXPAND getVisualIdMethodName»(org.eclipse.gmf.runtime.notation.View view) {
- if (view instanceof org.eclipse.gmf.runtime.notation.Diagram) {
- if («EXPAND modelID».equals(view.getType())) {
- return «EXPAND visualID»;
- } else {
- «EXPAND unrecognizedVID-»
- }
- }
- return «EXPAND getVisualIDMethodCall»(view.getType());
-}
-«ENDDEFINE»
-
-«DEFINE getVisualIdMethodName FOR gmfgen::GenDiagram»getVisualID«ENDDEFINE»
-
-«DEFINE getModelID FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
-public static String «EXPAND getModelIDMethodName»(org.eclipse.gmf.runtime.notation.View view) {
- org.eclipse.gmf.runtime.notation.View diagram = view.getDiagram();
- while (view != diagram) {
- org.eclipse.emf.ecore.EAnnotation annotation = view.getEAnnotation("Shortcut"); «EXPAND xpt::Common::nonNLS»
- if (annotation != null) {
- return (String) annotation.getDetails().get("modelID"); «EXPAND xpt::Common::nonNLS»
- }
- view = (org.eclipse.gmf.runtime.notation.View) view.eContainer();
- }
- return diagram != null ? diagram.getType() : null;
-}
-«ENDDEFINE»
-
-«DEFINE getModelIDMethodName FOR gmfgen::GenDiagram»getModelID«ENDDEFINE»
-
-«DEFINE getVisualID FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
-public static int «EXPAND getVisualIdMethodName»(String type) {
- try {
- return Integer.parseInt(type);
- } catch (NumberFormatException e) {
- if (Boolean.TRUE.toString().equalsIgnoreCase(org.eclipse.core.runtime.Platform.getDebugOption(DEBUG_KEY))) {
- «editorGen.plugin.getActivatorQualifiedClassName()».getInstance().logError("Unable to parse view type as a visualID number: " + type);
- }
- }
- «EXPAND unrecognizedVID-»
-}
-«ENDDEFINE»
-
-«REM»
- XXX getType may be optimized not to return new string each time, instead, cache known visual ids, e.g. with LinkedHashMap with removeEldestEntry?
- However, even intern() seems too much, as in most usecases returned value is not kept, and unlikely to survive Eden (or whatever name it has) heap space
-«ENDREM»
-«DEFINE getType FOR gmfgen::GenDiagram-»
-«EXPAND xpt::Common::generatedMemberComment»
-public static String «EXPAND getTypeMethodName»(int visualID) {
- return Integer.toString(visualID);
-}
-«ENDDEFINE»
-
-«DEFINE getTypeMethodName FOR gmfgen::GenDiagram»getType«ENDDEFINE»
-
-«DEFINE getDiagramVisualID FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
-public static int «EXPAND getDiagramVisualIDMethodName»(org.eclipse.emf.ecore.EObject domainElement) {
- if (domainElement == null) {
- «EXPAND unrecognizedVID-»
- }
- return «EXPAND visualID»;
-}
-«ENDDEFINE»
-
-«DEFINE getDiagramVisualIDMethodName FOR gmfgen::GenDiagram»getDiagramVisualID«ENDDEFINE»
-
-«DEFINE returnVisualID FOR gmfgen::GenCommonBase-»
-if («EXPAND checkSemanticElement») {
- return «EXPAND visualID»;
-}
-«ENDDEFINE»
-
-«DEFINE checkSemanticElement FOR gmfgen::GenCommonBase-»
- «ERROR 'checkSemanticElement not supported for: ' + self.repr()-»
-«ENDDEFINE»
-
-«DEFINE checkSemanticElement FOR gmfgen::GenDiagram»«EXPAND checkDomainElementMetaclass FOR domainDiagramElement» && isDiagram(«EXPAND MetaModel::CastEObject('domainElement') FOR domainDiagramElement»)«ENDDEFINE»
-«DEFINE checkSemanticElement FOR gmfgen::GenNode»«EXPAND checkDomainElementMetaclass FOR modelFacet.metaClass»«EXPAND checkDomainElementConstraints(self) FOR modelFacet»«ENDDEFINE»
-«DEFINE checkSemanticElement FOR gmfgen::GenLink»«EXPAND checkSemanticElement(self) FOR modelFacet»«ENDDEFINE»
-
-«DEFINE checkDomainElementMetaclass FOR genmodel::GenClass»«EXPAND MetaModel::MetaClass».isSuperTypeOf(domainElement.eClass())«ENDDEFINE»
-
-«REM» [ExtendedConstraint] Model selector constraint «ENDREM»
-«DEFINE checkDomainElementConstraints(commonBase : gmfgen::GenCommonBase) FOR gmfgen::TypeModelFacet-»
-«REM» [ExtendedConstraint] START Testing the kind of ModelFacet (GenLink or Default case) «ENDREM»
-«IF commonBase.oclIsTypeOf(gmfgen::GenLink)-»
-«REM» [ExtendedConstraint] END Testing the kind of ModelFacet (GenLink or Default case) «ENDREM»
-«IF null <> modelElementSelector» && «EXPAND _domainElementConstraintMethodName FOR commonBase»(«EXPAND MetaModel::CastEObject('domainElement') FOR metaClass»)«ENDIF-»
-«REM» [ExtendedConstraint] START Testing the kind of ModelFacet (GenLink or Default case) «ENDREM»
-«ELSE-»
-«IF null <> modelElementSelector» && «EXPAND _domainElementConstraintMethodName FOR commonBase»(containerView, «EXPAND MetaModel::CastEObject('domainElement') FOR metaClass»)«ENDIF-»
-«ENDIF-»
-«REM» [ExtendedConstraint] END Testing the kind of ModelFacet (GenLink or Default case) «ENDREM»
-«ENDDEFINE»
-
-«DEFINE checkSemanticElement(genLink : gmfgen::GenLink) FOR gmfgen::LinkModelFacet»«ERROR 'checkSemanticElement is supported only for TypeLinkModelFacet: ' + self.repr()»«ENDDEFINE»
-«DEFINE checkSemanticElement(genLink : gmfgen::GenLink) FOR gmfgen::TypeLinkModelFacet»«EXPAND checkDomainElementMetaclass FOR metaClass»«EXPAND checkDomainElementConstraints(genLink)»«ENDDEFINE»
-
-
-«DEFINE getNodeVisualID FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
-public static int «EXPAND getNodeVisualIDMethodName»(org.eclipse.gmf.runtime.notation.View containerView, org.eclipse.emf.ecore.EObject domainElement) {
- if (domainElement == null) {
- «EXPAND unrecognizedVID-»
- }
- String containerModelID = «EXPAND getModelIDMethodCall»(containerView);
- if (!«EXPAND modelID».equals(containerModelID)«EXPAND checkContainerModelID FOREACH shortcutsProvidedFor») { «EXPAND xpt::Common::nonNLS FOR shortcutsProvidedFor->asSequence()»
- «EXPAND unrecognizedVID-»
- }
- int containerVisualID;
- if («EXPAND modelID».equals(containerModelID)) {
- containerVisualID = «EXPAND getVisualIDMethodCall»(containerView);
- } else {
- if (containerView instanceof org.eclipse.gmf.runtime.notation.Diagram) {
- containerVisualID = «EXPAND visualID»;
- } else {
- «EXPAND unrecognizedVID-»
- }
- }
- switch (containerVisualID) {
- «EXPAND caseDomainContainerVisualID FOREACH getAllContainers()-»
- }
- «EXPAND unrecognizedVID-»
-}
-«ENDDEFINE»
-
-«DEFINE getNodeVisualIDMethodName FOR gmfgen::GenDiagram»getNodeVisualID«ENDDEFINE»
-
-«DEFINE caseDomainContainerVisualID FOR gmfgen::GenContainerBase-»
- «IF getContainedSemanticNodes(self)->size() > 0-»
-«EXPAND xpt::Common::caseVisualID»
- «EXPAND returnVisualID FOREACH getContainedSemanticNodes(self)-»
- break;
- «ENDIF-»
-«ENDDEFINE»
-
-
-«DEFINE canCreateNode FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
-public static boolean «EXPAND canCreateNodeMethodName»(org.eclipse.gmf.runtime.notation.View containerView, int nodeVisualID) {
- String containerModelID = «EXPAND getModelIDMethodCall»(containerView);
- if (!«EXPAND modelID».equals(containerModelID)«EXPAND checkContainerModelID FOREACH shortcutsProvidedFor») { «EXPAND xpt::Common::nonNLS FOR shortcutsProvidedFor->asSequence()»
- return false;
- }
- int containerVisualID;
- if («EXPAND modelID».equals(containerModelID)) {
- containerVisualID = «EXPAND getVisualIDMethodCall»(containerView);
- } else {
- if (containerView instanceof org.eclipse.gmf.runtime.notation.Diagram) {
- containerVisualID = «EXPAND visualID»;
- } else {
- return false;
- }
- }
- switch (containerVisualID) {
- «EXPAND caseVisualID FOREACH getAllContainers()->select(e | not e.getEssentialVisualChildren()->isEmpty())-»
- «EXPAND caseVisualID FOREACH links->select(e | not e.getEssentialVisualChildren()->isEmpty())-»
- }
- return false;
-}
-«ENDDEFINE»
-
-«DEFINE canCreateNodeMethodName FOR gmfgen::GenDiagram»canCreateNode«ENDDEFINE»
-
-«DEFINE checkContainerModelID FOR String» && !"«self»".equals(containerModelID)«ENDDEFINE»
-
-«DEFINE caseVisualID FOR gmfgen::GenCommonBase-»
-«EXPAND xpt::Common::caseVisualID»
- «EXPAND checkEssentialChild FOREACH self.getEssentialVisualChildren()-»
- break;
-«ENDDEFINE»
-
-«DEFINE checkEssentialChild FOR gmfgen::GenCommonBase-»
-if («EXPAND visualID» == nodeVisualID) {
- return true;
-}
-«ENDDEFINE»
-
-«DEFINE getLinkWithClassVisualID FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
-public static int «EXPAND getLinkWithClassVisualIDMethodName»(org.eclipse.emf.ecore.EObject domainElement) {
- if (domainElement == null) {
- «EXPAND unrecognizedVID-»
- }
- «EXPAND returnVisualID FOREACH links->select(isTypeLink())-»
- «EXPAND unrecognizedVID-»
-}
-«ENDDEFINE»
-
-«DEFINE getLinkWithClassVisualIDMethodName FOR gmfgen::GenDiagram»getLinkWithClassVisualID«ENDDEFINE»
-
-
-«DEFINE isDiagram FOR gmfgen::GenDiagram-»
- «IF null <> domainDiagramElement-»
- «EXPAND xpt::Common::generatedMemberComment(
- 'User can change implementation of this method to handle some specific\n' +
- 'situations not covered by default logic.\n'
- )»
-private static boolean isDiagram(«EXPAND MetaModel::QualifiedClassName FOR domainDiagramElement» element) {
- return true;
-}
- «ENDIF-»
-«ENDDEFINE»
-
-
-«REM»
-
- Support for extra contstraints to check about model element.
- Includes expression fields for interpreted constrains (like ocl or regexp).
- For each model element that has an associated constraint, there's a method is<DomainElement>_<UID>()
- that performs extra specification as defined by value expression
-
- FIXME don't use static fields, replace with instance/separate cache (e.g. accessible from Activator)
-«ENDREM»
-
-«DEFINE _constraintMethods FOR gmfgen::GenDiagram-»
-«IF null <> editorGen.expressionProviders-»
- «EXPAND _constraintMethod FOREACH topLevelNodes->select(n | n.modelFacet.modelElementSelector <> null and n.sansDomain = false)-»
- «EXPAND _constraintMethod FOREACH childNodes->select(n | n.modelFacet.modelElementSelector <> null and n.sansDomain = false)-»
- «FOREACH links AS l»«EXPAND _constraintMethod(l) FOR l.modelFacet»«ENDFOREACH»
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE _constraintMethod FOR gmfgen::GenNode-»
-«EXPAND _domainElementConstraintMethod(self, modelFacet.modelElementSelector, modelFacet.metaClass) FOR modelFacet.modelElementSelector.provider»
-«ENDDEFINE»
-
-«DEFINE _constraintMethod(l : gmfgen::GenLink) FOR gmfgen::LinkModelFacet»«ENDDEFINE» // no-op
-«DEFINE _constraintMethod(l : gmfgen::GenLink) FOR gmfgen::TypeLinkModelFacet-»
-«IF modelElementSelector <> null»«EXPAND _domainElementConstraintMethod(l, modelElementSelector, metaClass) FOR modelElementSelector.provider»«ENDIF-»
-«ENDDEFINE»
-
-
-«DEFINE _domainElementConstraintMethodName FOR gmfgen::GenCommonBase»is«getUniqueIdentifier()»«ENDDEFINE»
-
-«DEFINE _domainElementConstraintMethod(diagramElement : gmfgen::GenCommonBase, expression : gmfgen::ValueExpression, context : genmodel::GenClass) FOR gmfgen::GenExpressionProviderBase»«ERROR 'Constraint method is not supported for ' + self.repr()»«ENDDEFINE»
-
-«REM» [ExtendedConstraint] Model selector constraint «ENDREM»
-«DEFINE _domainElementConstraintMethod(diagramElement : gmfgen::GenCommonBase, expression : gmfgen::ValueExpression, context : genmodel::GenClass) FOR gmfgen::GenJavaExpressionProvider-»
- «EXPAND xpt::Common::generatedMemberComment»
- «REM» [ExtendedConstraint] START Testing the kind of ModelFacet (GenLink or Default case) «ENDREM»
- «IF diagramElement.oclIsTypeOf(gmfgen::GenLink)-»
- «REM» [ExtendedConstraint] END Testing the kind of ModelFacet (GenLink or Default case) «ENDREM»
- private static boolean «EXPAND _domainElementConstraintMethodName FOR diagramElement»(«EXPAND MetaModel::QualifiedClassName FOR context» domainElement) {
- «REM» [ExtendedConstraint] START Testing the kind of ModelFacet (GenLink or Default case) «ENDREM»
- «ELSE-»
- private static boolean «EXPAND _domainElementConstraintMethodName FOR diagramElement»(org.eclipse.gmf.runtime.notation.View containerView, «EXPAND MetaModel::QualifiedClassName FOR context» domainElement) {
- «ENDIF-»
- «REM» [ExtendedConstraint] END Testing the kind of ModelFacet (GenLink or Default case) «ENDREM»
-«IF injectExpressionBody and (expression.body <> null and expression.body.length() <> 0)-»
- «expression.body»
-«ELSEIF throwException or (injectExpressionBody and (expression.body = null or expression.body.length() = 0))-»
- // FIXME: implement this method
- // Ensure that you remove @generated or mark it @generated NOT
- throw new java.lang.UnsupportedOperationException("No java implementation provided in '«EXPAND _domainElementConstraintMethodName FOR diagramElement»' operation");«EXPAND xpt::Common::nonNLS»
-«ELSE-»
- return false;
-«ENDIF-»
- }
-«ENDDEFINE»
-
-// FIXME move these methods to ElementInitializers or any other more suitable place
-«DEFINE _domainElementConstraintMethod(diagramElement : gmfgen::GenCommonBase, expression : gmfgen::ValueExpression, context : genmodel::GenClass) FOR gmfgen::GenExpressionInterpreter-»
- «EXPAND xpt::Common::generatedMemberComment»
- private static boolean «EXPAND _domainElementConstraintMethodName FOR diagramElement»(«EXPAND MetaModel::QualifiedClassName FOR context» domainElement) {
- Object result = «EXPAND xpt::expressions::getExpression::getExpression(expression, context)».evaluate(domainElement);
- return result instanceof Boolean && ((Boolean)result).booleanValue();
- }
-«ENDDEFINE»
-
-«REM»
- Constraints support end.
-«ENDREM»
-
-
-«DEFINE unrecognizedVID FOR gmfgen::GenDiagram-»
-return -1;
-«ENDDEFINE»
-
-«DEFINE checkNodeVisualIDMethodName FOR gmfgen::GenDiagram»checkNodeVisualID«ENDDEFINE»
-«DEFINE checkNodeVisualIDMethodCall FOR gmfgen::GenDiagram»«getVisualIDRegistryQualifiedClassName()».«EXPAND checkNodeVisualIDMethodName»«ENDDEFINE»
-
-«DEFINE checkNodeVisualID FOR gmfgen::GenDiagram»
- «EXPAND xpt::Common::generatedMemberComment»
- public static boolean «EXPAND checkNodeVisualIDMethodName»(org.eclipse.gmf.runtime.notation.View containerView, org.eclipse.emf.ecore.EObject domainElement, int candidate) {
- if (candidate == -1){
- //unrecognized id is always bad
- return false;
- }
- «REM»For now there are only one possibility, but this may be changed in moderately near future«ENDREM»«-»
- int basic = «EXPAND xpt::editor::VisualIDRegistry::getNodeVisualIDMethodName»(containerView, domainElement);
- return basic == candidate;
- }
-«ENDDEFINE»
-
-«DEFINE isCompartmentVisualIDMethodName FOR gmfgen::GenDiagram»isCompartmentVisualID«ENDDEFINE»
-«DEFINE isCompartmentVisualIDMethodCall FOR gmfgen::GenDiagram»«getVisualIDRegistryQualifiedClassName()».«EXPAND isCompartmentVisualIDMethodName»«ENDDEFINE»
-
-«DEFINE isCompartmentVisualID FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
- public static boolean «EXPAND isCompartmentVisualIDMethodName»(int visualID) {
- «IF not compartments->isEmpty()-»
- switch (visualID) {
- «EXPAND xpt::Common::caseVisualID FOREACH compartments»
- return true;
- default:
- break;
- }
- «ENDIF-»
- return false;
- }
-«ENDDEFINE»
-
-«DEFINE isSemanticLeafVisualIDMethodName FOR gmfgen::GenDiagram»isSemanticLeafVisualID«ENDDEFINE»
-«DEFINE isSemanticLeafVisualIDMethodCall FOR gmfgen::GenDiagram»«getVisualIDRegistryQualifiedClassName()».«EXPAND isSemanticLeafVisualIDMethodName»«ENDDEFINE»
-
-«DEFINE isSemanticLeafVisualID FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
- public static boolean «EXPAND isSemanticLeafVisualIDMethodName»(int visualID) {
- switch (visualID) {
- «REM»We need to ensure at last one case, this is legitimate way«ENDREM»«-»
- «EXPAND xpt::Common::caseVisualID FOR self»
- return false;
- «FOREACH self.getAllNodes()->asSequence()->sortedBy(n | n.visualID) AS nextNode-»
- «IF getSemanticChildren(nextNode)->isEmpty()-»
- «IF not nextNode.oclIsKindOf(gmfgen::GenNode) or nextNode.oclAsType(gmfgen::GenNode).compartments->select(c | not getSemanticChildren(c)->isEmpty())->isEmpty()-»
- «EXPAND xpt::Common::caseVisualID FOR nextNode»
- «ENDIF-»
- «ENDIF-»
- «ENDFOREACH-»
- return true;
- default:
- break;
- }
- return false;
- }
-«ENDDEFINE»
-
-«DEFINE runtimeTypedInstanceName FOR gmfgen::GenDiagram»TYPED_INSTANCE«ENDDEFINE»
-«DEFINE runtimeTypedInstanceCall FOR gmfgen::GenDiagram»«getVisualIDRegistryQualifiedClassName()».«EXPAND runtimeTypedInstanceName»«ENDDEFINE»
-
-«DEFINE runtimeTypedInstance FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedClassComment»
- public static final org.eclipse.gmf.tooling.runtime.structure.DiagramStructure «EXPAND runtimeTypedInstanceName» = new org.eclipse.gmf.tooling.runtime.structure.DiagramStructure() {
- «EXPAND xpt::Common::generatedMemberComment»
- «EXPAND CodeStyle::override»
- public int «EXPAND xpt::editor::VisualIDRegistry::getVisualIdMethodName»(org.eclipse.gmf.runtime.notation.View view) {
- return «EXPAND xpt::editor::VisualIDRegistry::getVisualIDMethodCall»(view);
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- «EXPAND CodeStyle::override»
- public String «EXPAND xpt::editor::VisualIDRegistry::getModelIDMethodName»(org.eclipse.gmf.runtime.notation.View view) {
- return «EXPAND xpt::editor::VisualIDRegistry::getModelIDMethodCall»(view);
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- «EXPAND CodeStyle::override»
- public int «EXPAND xpt::editor::VisualIDRegistry::getNodeVisualIDMethodName»(org.eclipse.gmf.runtime.notation.View containerView, org.eclipse.emf.ecore.EObject domainElement) {
- return «EXPAND xpt::editor::VisualIDRegistry::getNodeVisualIDMethodCall»(containerView, domainElement);
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- «EXPAND CodeStyle::override»
- public boolean «EXPAND checkNodeVisualIDMethodName»(org.eclipse.gmf.runtime.notation.View containerView, org.eclipse.emf.ecore.EObject domainElement, int candidate) {
- return «EXPAND checkNodeVisualIDMethodCall»(containerView, domainElement, candidate);
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- «EXPAND CodeStyle::override»
- public boolean «EXPAND isCompartmentVisualIDMethodName»(int visualID) {
- return «EXPAND isCompartmentVisualIDMethodCall»(visualID);
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- «EXPAND CodeStyle::override»
- public boolean «EXPAND isSemanticLeafVisualIDMethodName»(int visualID) {
- return «EXPAND isSemanticLeafVisualIDMethodCall»(visualID);
- }
- };
-«ENDDEFINE»
-
-«DEFINE additions FOR gmfgen::GenDiagram»«ENDDEFINE»
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/extensions.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/extensions.xpt
deleted file mode 100644
index 5ce327cd843..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/extensions.xpt
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2007, 2009 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/2009/GenModel'»
-
-«DEFINE extensions FOR gmfgen::GenEditorGenerator»
-«REM»YT (not used):
- <extension point="org.eclipse.ui.editors" id="gmf-editor">
- «EXPAND xpt::Common::xmlGeneratedTag»
- <editor
- id="«editor.iD»"
- name="%editorName"
- icon="«editor.iconPathX»"
- extensions="«diagramFileExtension»"
- default="true"
- class="«editor.getQualifiedClassName()»"
- matchingStrategy="«diagram.getMatchingStrategyQualifiedClassName()»"
- contributorClass="«editor.getActionBarContributorQualifiedClassName()»">
- </editor>
- </extension>
-«ENDREM»
- <extension point="org.eclipse.ui.contexts" id="ui-context">
- «EXPAND xpt::Common::xmlGeneratedTag»
- <context
- description="%context.description"
- id="«editor.contextID»"
- name="%context.name"
- parentId="org.eclipse.gmf.runtime.diagram.ui.diagramContext">
- </context>
- </extension>
-«REM»YT (not used):
- <extension point="org.eclipse.ui.newWizards" id="creation-wizard">
- «EXPAND xpt::Common::xmlGeneratedTag»
- <wizard
- name="%newWizardName"
- icon="«diagram.creationWizardIconPathX»"
- category="«diagram.creationWizardCategoryID»"
- class="«diagram.getCreationWizardQualifiedClassName()»"
- id="«diagram.getCreationWizardQualifiedClassName()»ID">
- <description>%newWizardDesc</description>
- </wizard>
- </extension>
-
-«IF diagram.generateInitDiagramAction()-»
- «IF null = application»<extension point="org.eclipse.ui.popupMenus" id="init-diagram-action">
- «EXPAND xpt::Common::xmlGeneratedTag»
- <objectContribution
- id="«plugin.iD».InitDiagram"
- nameFilter="*.«domainFileExtension»"
- objectClass="org.eclipse.core.resources.IFile">
- <action
- label="%initDiagramActionLabel"
- class="«diagram.getInitDiagramFileActionQualifiedClassName()»"
- menubarPath="additions"
- enablesFor="1"
- id="«plugin.iD».InitDiagramAction">
- </action>
- </objectContribution>
- </extension>
- «ELSE-»
- <extension point="org.eclipse.ui.actionSets" id="init-diagram-action">
- «EXPAND xpt::Common::xmlGeneratedTag»
- <actionSet
- label="%initDiagramActionLabel"
- visible="true"
- id="«plugin.iD».InitDiagram">
- <action
- label="%initDiagramActionLabel"
- class="«diagram.getInitDiagramFileActionQualifiedClassName()»"
- menubarPath="file/additions"
- id="«plugin.iD».InitDiagramAction">
- </action>
- </actionSet>
- </extension>
- «ENDIF-»
-«ENDIF-»
-«ENDREM»
-«ENDDEFINE»
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/palette/PaletteFactory.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/palette/PaletteFactory.xpt
deleted file mode 100644
index aaecdf9e48a..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/palette/PaletteFactory.xpt
+++ /dev/null
@@ -1,362 +0,0 @@
-/*
- * Copyright (c) 2006, 2009 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:
- * Artem Tikhomirov (Borland) - initial API and implementation
- */
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/emf/2002/Ecore'»
-«EXTENSION xpt::editor::palette::Utils»
-
-«DEFINE Factory FOR gmfgen::Palette»
-«EXPAND xpt::Common::copyright FOR diagram.editorGen-»
-package «packageName»;
-
-«EXPAND xpt::Common::generatedClassComment»
-public class «factoryClassName» extends org.eclipse.gmf.runtime.diagram.ui.services.palette.PaletteFactory.Adapter {
-
-«REM»RS: New Palette generation«ENDREM»
-
-«REM» Generates the ID for the tool elements«ENDREM»
-«REM» Generate the tool factory (if(ID) createtool...)«ENDREM»
-«EXPAND generateIDAttribute FOREACH collectTools(self)»
-
-«REM» Generates the default constructor«ENDREM»
-«EXPAND xpt::Common::generatedMemberComment»
- public «factoryClassName»() {
-
- }
-
-«REM» Generates the main method to create tool«ENDREM»
-«EXPAND generateCreateTool»
-
-«REM» Generates the main method to create template«ENDREM»
-«EXPAND generateGetTemplate»
-
-«REM» Generates each method for tool creation«ENDREM»
-«EXPAND createTool FOREACH collectTools(self)»
-
-}
-«ENDDEFINE»
-
-«DEFINE generateCreateTool FOR gmfgen::Palette»
- «EXPAND xpt::Common::generatedMemberComment»
- public org.eclipse.gef.Tool createTool(String toolId) {
- «EXPAND checkToolID FOREACH collectTools(self)»
- // default return: null
- return null;
- }
-«ENDDEFINE»
-
-«DEFINE checkToolID FOR gmfgen::AbstractToolEntry-»
- if (toolId.equals(«id.getConstantIDName()»)) {
- return «createMethodName»();
- }
-«ENDDEFINE»
-
-
-«DEFINE generateGetTemplate FOR gmfgen::Palette»
- «EXPAND xpt::Common::generatedMemberComment»
- public Object getTemplate(String templateId) {
-
- // default return: null
- return null;
- }
-«ENDDEFINE»
-
-«DEFINE generateIDAttribute FOR gmfgen::AbstractToolEntry-»
- «EXPAND xpt::Common::generatedMemberComment»
- private final static String «id.getConstantIDName()» = «id»;«IF id.isQuoted('\"')»«EXPAND xpt::Common::nonNLS»«ENDIF»
-«ENDDEFINE»
-
-
-«DEFINE createTool FOR gmfgen::AbstractToolEntry-»
- «EXPAND xpt::Common::generatedMemberComment»
- private org.eclipse.gef.Tool «createMethodName»() {
- «EXPAND newTool('entry')-»
- }
-«ENDDEFINE»
-
-«DEFINE newTool(toolVarName : String) FOR gmfgen::ToolEntry-»
- «IF elements->isEmpty()-»
- «ERROR 'no elements for tool generation (Palette)'»
- «ELSE-»
- java.util.List<org.eclipse.gmf.runtime.emf.type.core.IElementType> types = new java.util.ArrayList<org.eclipse.gmf.runtime.emf.type.core.IElementType>(«elements->size()»);
- «FOREACH elements->asSequence() AS e-»
- types.add(«EXPAND xpt::providers::ElementTypes::accessElementType FOR e»);
- «ENDFOREACH-»
- «REM»RS: modified tool creation to have stereotypes-aware tools«ENDREM»
- org.eclipse.gef.Tool tool = new org.eclipse.papyrus.uml.diagram.common.service.«IF self.genNodes->isEmpty()»AspectUnspecifiedTypeConnectionTool«ELSE»AspectUnspecifiedTypeCreationTool«ENDIF»(types);
- return tool;
- «ENDIF-»
-«ENDDEFINE»
-
-
-
-
-
-«REM»RS: Old Palette generation
-«EXPAND createGroup FOREACH collectGroups(self)»
-«EXPAND createEntry FOREACH collectTools(self)»
-
-«IF needsNodeToolEntryClass(self)»«EXPAND nodeToolEntry»«ENDIF-»
-«IF needsLinkToolEntryClass(self)»«EXPAND linkToolEntry»«ENDIF-»
-}
-«ENDDEFINE»
-
-«DEFINE generateIDAttribute FOR gmfgen::AbstractToolEntry-»
- «EXPAND xpt::Common::generatedMemberComment»
- private final static String «id.getConstantIDName()» = «id»;«IF id.isQuoted('\"')»«EXPAND xpt::Common::nonNLS»«ENDIF»
-«ENDDEFINE»
-
-«DEFINE createGroup FOR gmfgen::ToolGroup-»
- «EXPAND xpt::Common::generatedMemberComment('Creates \"' + title + '\" palette tool group')»
- private org.eclipse.gef.palette.PaletteContainer «createMethodName»() {
- «EXPAND newContainer('paletteContainer')-»
- «EXPAND setIdentity('paletteContainer')-»
- «EXPAND setDescription('paletteContainer', self) FOR description-»
- «EXPAND setSmallImage('paletteContainer', palette)-»
- «EXPAND setLargeImage('paletteContainer', palette)-»
- «EXPAND addEntry('paletteContainer') FOREACH entries-»
- return paletteContainer;
- }
-«ENDDEFINE»
-
-«DEFINE newContainer(varName : String) FOR gmfgen::ToolGroup-»
-«IF collapse and toolsOnly-»
- org.eclipse.gef.palette.PaletteDrawer «varName» = new org.eclipse.gef.palette.PaletteDrawer(«EXPAND i18nTitle»);
-«ELSEIF stack-»
- org.eclipse.gef.palette.PaletteStack «varName» = new org.eclipse.gef.palette.PaletteStack(«EXPAND i18nTitle», null, null);
-«ELSE-»
- org.eclipse.gef.palette.PaletteGroup «varName» = new org.eclipse.gef.palette.PaletteGroup(«EXPAND i18nTitle»);
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE setDescription(varName : String, gr : gmfgen::ToolGroup) FOR String-»
-«varName».setDescription(«EXPAND i18nDesc FOR gr»);
-«ENDDEFINE»
-
-«DEFINE addEntry(varName : String) FOR gmfgen::ToolGroupItem»
-«ERROR 'abstract addEntry(ToolGroupItem,String) template'»
-«ENDDEFINE»
-
-«DEFINE addEntry(varName : String) FOR gmfgen::AbstractToolEntry-»
-«varName».add(«createMethodName»());
-«IF _default and group.stack-»
-«varName».setActiveEntry((org.eclipse.gef.palette.ToolEntry) paletteContainer.getChildren().get(paletteContainer.getChildren().size() - 1));
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE addEntry(varName : String) FOR gmfgen::Separator-»
-«varName».add(new org.eclipse.gef.palette.PaletteSeparator());
-«ENDDEFINE»
-
-«DEFINE addEntry(varName : String) FOR gmfgen::ToolGroup-»
-«varName».add(«createMethodName»());
-«ENDDEFINE»
-
-«DEFINE createEntry FOR gmfgen::AbstractToolEntry-»
- «EXPAND xpt::Common::generatedMemberComment»
- private org.eclipse.gef.palette.ToolEntry «createMethodName»() {
- «EXPAND newEntry('entry')-»
- «EXPAND setIdentity('entry')-»
- «EXPAND setSmallImage('entry', group.palette)-»
- «EXPAND setLargeImage('entry', group.palette)-»
- «EXPAND setToolClass('entry')-»
- «EXPAND setToolProperty('entry') FOREACH properties-»
- return entry;
- }
-«ENDDEFINE»
-
-«DEFINE newEntry(toolVarName : String) FOR gmfgen::AbstractToolEntry-»
-«ERROR 'abstract newEntry(AbstractToolEntry,String) template'»
-«ENDDEFINE»
-
-«DEFINE newEntry(toolVarName : String) FOR gmfgen::ToolEntry-»
-«IF elements->isEmpty()-»
-org.eclipse.gef.palette.ToolEntry «toolVarName» = new org.eclipse.gef.palette.ToolEntry(«EXPAND i18nTitle», «EXPAND i18nDesc», null, null) {};
-«ELSE-»
-«LET (if genNodes->isEmpty() then 'LinkToolEntry' else 'NodeToolEntry' endif) AS toolEntryClass-»
-java.util.List/*<IElementType>*/ types = new java.util.ArrayList/*<IElementType>*/(«elements->size()»);
-«FOREACH elements->asSequence() AS e-»
-types.add(«EXPAND xpt::providers::ElementTypes::accessElementType FOR e»);
-«ENDFOREACH-»
-«toolEntryClass» «toolVarName» = new «toolEntryClass»(«EXPAND i18nTitle», «EXPAND i18nDesc», types);
-«ENDLET-»
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE newEntry(toolVarName : String) FOR gmfgen::StandardEntry-»
-«IF gmfgen::StandardEntryKind::SELECT = kind -»
-«EXPAND newStdSelectEntry(toolVarName)-»
-«ELSEIF kind = gmfgen::StandardEntryKind::MARQUEE-»
-«EXPAND newStdMarqueeEntry(toolVarName)-»
-«ELSEIF kind = gmfgen::StandardEntryKind::ZOOM-»
-«EXPAND newStdZoomEntry(toolVarName)-»
-«ELSE-»
-«EXPAND newStdOtherEntry(toolVarName)-»
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE newStdSelectEntry(toolVarName : String) FOR gmfgen::StandardEntry-»
-org.eclipse.gef.palette.PanningSelectionToolEntry «toolVarName» = new org.eclipse.gef.palette.PanningSelectionToolEntry();
-«ENDDEFINE»
-
-«DEFINE newStdMarqueeEntry(toolVarName : String) FOR gmfgen::StandardEntry-»
-org.eclipse.gef.palette.MarqueeToolEntry «toolVarName» = new org.eclipse.gef.palette.MarqueeToolEntry();
-«ENDDEFINE»
-
-«DEFINE newStdZoomEntry(toolVarName : String) FOR gmfgen::StandardEntry-»
-FIXME
-«ENDDEFINE»
-
-«DEFINE newStdOtherEntry(toolVarName : String) FOR gmfgen::StandardEntry-»
-«ERROR 'override newStdOtherEntry(StandardEntry, String) for kind ' + kind.repr()»
-«ENDDEFINE»
-
-// FIXME: odd code - FOR EntryBase, while most of the template is valid for ToolEntry only!!!
-«DEFINE setSmallImage(toolVarName : String, palette : gmfgen::Palette) FOR gmfgen::EntryBase-»
-«IF null <> smallIconPath-»
-«toolVarName».setSmallIcon(«palette.activatorFQN()».findImageDescriptor("«smallIconPath»"));«EXPAND xpt::Common::nonNLS»
-«ELSEIF not (Sequence { self })[gmfgen::ToolEntry].elements->isEmpty()-»
-«LET self.oclAsType(gmfgen::ToolEntry) AS toolEntry-»
-«toolVarName».setSmallIcon(«palette.diagram.getElementTypesQualifiedClassName()».getImageDescriptor(«EXPAND xpt::providers::ElementTypes::accessElementType FOR toolEntry.elements->first().oclAsType(gmfgen::GenCommonBase)»));
-«ENDLET-»
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE setLargeImage(toolVarName : String, palette : gmfgen::Palette) FOR gmfgen::EntryBase-»
-«IF null <> largeIconPath-»
-«toolVarName».setLargeIcon(«palette.activatorFQN()».findImageDescriptor("«largeIconPath»")); «EXPAND xpt::Common::nonNLS»
-«ELSEIF not (Sequence { self })[gmfgen::ToolEntry].elements->isEmpty()-»
-«toolVarName».setLargeIcon(«toolVarName».getSmallIcon());
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE setToolClass(toolVarName : String) FOR gmfgen::AbstractToolEntry-»
-«IF null <> qualifiedToolName-»
-«toolVarName».setToolClass(«qualifiedToolName».class);
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE setToolProperty(toolVarName : String) FOR ecore::EStringToStringMapEntry-»
-«toolVarName».setToolProperty(«key», «value»);
-«ENDDEFINE»
-
-«DEFINE i18nTitle FOR gmfgen::ToolEntry-»
-«IF title = null»null«ELSE»«EXPAND xpt::Externalizer::accessorCall(i18nTitleKey(self)) FOR group.palette.diagram.editorGen»«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE i18nTitle FOR gmfgen::ToolGroup-»
-«IF title = null»null«ELSE»«EXPAND xpt::Externalizer::accessorCall(i18nTitleKey(self)) FOR palette.diagram.editorGen»«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE i18nDesc FOR gmfgen::ToolEntry-»
-«IF null = description»null«ELSE»«EXPAND xpt::Externalizer::accessorCall(i18nDescKey(self)) FOR group.palette.diagram.editorGen»«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE i18nDesc FOR gmfgen::ToolGroup-»
-«IF null = description»null«ELSE»«EXPAND xpt::Externalizer::accessorCall(i18nDescKey(self)) FOR palette.diagram.editorGen»«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE i18nAccessors FOR gmfgen::Palette-»
-«EXPAND internal_i18n_accessors FOREACH collectGroups(self)-»
-«EXPAND internal_i18n_accessors FOREACH collectTools(self)-»
-«ENDDEFINE»
-
-«DEFINE i18nValues FOR gmfgen::Palette-»
-«EXPAND internal_i18n_values FOREACH collectGroups(self)-»
-«EXPAND internal_i18n_values FOREACH collectTools(self)-»
-«ENDDEFINE»
-
-«DEFINE internal_i18n_accessors FOR gmfgen::EntryBase-»
-«IF null <> title»«EXPAND xpt::Externalizer::accessorField(i18nTitleKey(self))»«ENDIF-»
-«IF null <> description»«EXPAND xpt::Externalizer::accessorField(i18nDescKey(self))»«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE internal_i18n_values FOR gmfgen::EntryBase-»
-«IF null <> title»«EXPAND xpt::Externalizer::messageEntry(i18nTitleKey(self), title)»«ENDIF-»
-«IF null <> description»«EXPAND xpt::Externalizer::messageEntry(i18nDescKey(self), description)»«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE cleanStandardToolsHack FOR gmfgen::Palette»
- «EXPAND xpt::Common::generatedMemberComment('Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=159289')»
- private void cleanStandardTools(org.eclipse.gef.palette.PaletteRoot paletteRoot) {
- for (java.util.Iterator it = paletteRoot.getChildren().iterator(); it.hasNext();) {
- org.eclipse.gef.palette.PaletteEntry entry = (org.eclipse.gef.palette.PaletteEntry) it.next();
- if (!"standardGroup".equals(entry.getId())) { «EXPAND xpt::Common::nonNLS»
- continue;
- }
- for (java.util.Iterator it2 = ((org.eclipse.gef.palette.PaletteContainer) entry).getChildren().iterator(); it2.hasNext();) {
- org.eclipse.gef.palette.PaletteEntry entry2 = (org.eclipse.gef.palette.PaletteEntry) it2.next();
- if ("zoomTool".equals(entry2.getId())) { «EXPAND xpt::Common::nonNLS»
- it2.remove();
- } else if ("noteStack".equals(entry2.getId())) { «EXPAND xpt::Common::nonNLS»
- it2.remove();
- } else if ("selectionTool".equals(entry2.getId())) { «EXPAND xpt::Common::nonNLS»
- it2.remove();
- }
- if (paletteRoot.getDefaultEntry() == entry2) {
- paletteRoot.setDefaultEntry(null);
- }
- }
- }
- }
-«ENDDEFINE»
-
-«DEFINE nodeToolEntry FOR OclAny»
- «EXPAND xpt::Common::generatedClassComment»
- private static class NodeToolEntry extends org.eclipse.gef.palette.ToolEntry {
-
- «EXPAND xpt::Common::generatedMemberComment»
- private final java.util.List elementTypes;
-
- «EXPAND xpt::Common::generatedMemberComment»
- private NodeToolEntry(String title, String description, java.util.List elementTypes) {
- super(title, description, null, null);
- this.elementTypes = elementTypes;
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- public org.eclipse.gef.Tool createTool() {
- org.eclipse.gef.Tool tool = new org.eclipse.gmf.runtime.diagram.ui.tools.UnspecifiedTypeCreationTool(elementTypes);
- tool.setProperties(getToolProperties());
- return tool;
- }
- }
-«ENDDEFINE»
-
-«DEFINE linkToolEntry FOR OclAny»
- «EXPAND xpt::Common::generatedClassComment»
- private static class LinkToolEntry extends org.eclipse.gef.palette.ToolEntry {
-
- «EXPAND xpt::Common::generatedMemberComment»
- private final java.util.List relationshipTypes;
-
- «EXPAND xpt::Common::generatedMemberComment»
- private LinkToolEntry(String title, String description, java.util.List relationshipTypes) {
- super(title, description, null, null);
- this.relationshipTypes = relationshipTypes;
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- public org.eclipse.gef.Tool createTool() {
- org.eclipse.gef.Tool tool = new org.eclipse.gmf.runtime.diagram.ui.tools.UnspecifiedTypeConnectionTool(relationshipTypes);
- tool.setProperties(getToolProperties());
- return tool;
- }
- }
-«ENDDEFINE»
-
-«DEFINE setIdentity(toolVarName : String) FOR gmfgen::EntryBase-»
-«IF id <> null and id.size() != 0-»
- «toolVarName».setId(«id»);«IF id.isQuoted('\"')»«EXPAND xpt::Common::nonNLS»«ENDIF»
-«ENDIF-»
-«ENDDEFINE»
-«ENDREM» \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/palette/Utils.qvto b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/palette/Utils.qvto
deleted file mode 100644
index b699f8e7697..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/palette/Utils.qvto
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2006, 2009 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:
- * Artem Tikhomirov (Borland) - initial API and implementation
- */
-
-import xpt.StringOperations;
-
-modeltype gmfgen uses "http://www.eclipse.org/gmf/2009/GenModel";
-
-library Utils;
-
-helper gmfgen::Palette::activatorFQN() : String {
- return self.diagram.editorGen.plugin.getActivatorQualifiedClassName()
-}
-
-helper gmfgen::AbstractToolEntry::activatorFQN() : String {
- return self.group.palette.activatorFQN()
-}
-
-helper gmfgen::ToolGroup::activatorFQN() : String {
- return self.palette.activatorFQN()
-}
-
-helper i18nKey(group : gmfgen::EntryBase) : String {
- return let rv = group.createMethodName in (if rv.startsWith('get') then rv.xpandSubstring(3) else (if rv.startsWith('create') then rv.xpandSubstring(6) else rv endif) endif)
-}
-
-helper i18nTitleKey(group : gmfgen::EntryBase) : String {
- return i18nKey(group) + '_title'
-}
-
-helper i18nDescKey(group : gmfgen::EntryBase) : String {
- return i18nKey(group) + '_desc'
-}
-
-helper collectGroups(palette : gmfgen::Palette) : Sequence(gmfgen::ToolGroup) {
- return palette.groups->asSequence()->union(palette.groups->collect(it | collectSubGroups(it)))->asOrderedSet()->asSequence()
-}
-
-helper collectSubGroups(group : gmfgen::ToolGroup) : Sequence(gmfgen::ToolGroup) {
- return let rv = (group.entries)[gmfgen::ToolGroup] in rv->union(rv->collect(g | collectSubGroups(g))->flatten()->asSet())->asSequence()
-}
-
-/**
- * collect all tools availables and valid to generate the palette. A tool is not valid when it does not create either a link or a node
- */
-helper collectTools(palette : gmfgen::Palette) : Sequence(gmfgen::AbstractToolEntry) {
- return collectGroups(palette).entries[gmfgen::AbstractToolEntry]->select(tool | tool.isValidTool())
-}
-
-helper gmfgen::AbstractToolEntry::isValidTool() : Boolean {
- return if(self.oclIsKindOf(ToolEntry)) then ( self[gmfgen::ToolEntry].genNodes->size()+self[gmfgen::ToolEntry].genLinks->size() ) <> 0 else true endif
-}
-
-helper needsNodeToolEntryClass(palette : gmfgen::Palette) : Boolean {
- return collectTools(palette)[gmfgen::ToolEntry]->exists(genNodes->notEmpty())
-}
-
-helper needsLinkToolEntryClass(palette : gmfgen::Palette) : Boolean {
- return collectTools(palette)[gmfgen::ToolEntry]->exists(genLinks->notEmpty())
-}
-
-helper String::getToolPath() : String {
- /** returns the '/' separator and then the id of the parent group path */
- return "/".concat(if(self.isQuoted('\"')) then self.substring(2, self.size()-1) else self endif)
-}
-
-helper String::getConstantIDName() : String {
- return if(self.isQuoted('\"')) then getUpperAndUnderscoreString(self.substring(2, self.size()-1)) else getUpperAndUnderscoreString(self) endif
-}
-
-helper getUpperAndUnderscoreString(value:String) : String {
- return getUpper(value).replace(".", "_")
-}
-
-helper getUpper(value:String) : String {
- return value.toUpper();
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/navigator/NavigatorContentProvider.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/navigator/NavigatorContentProvider.xpt
deleted file mode 100644
index 371255362c3..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/navigator/NavigatorContentProvider.xpt
+++ /dev/null
@@ -1,472 +0,0 @@
-/*
- * Copyright (c) 2006, 2009 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:
- * Alexander Shatalin (Borland) - initial API and implementation
- * Modified by Patrick Tessier (CEA LIST)
- * Emilien Perico (Atos Origin) - update template for GMF 2.2 compliance
- */
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/emf/2002/Ecore'»
-«EXTENSION xpt::navigator::Utils»
-«EXTENSION gmf::CodeGenerationUtils»
-«DEFINE NavigatorContentProvider FOR gmfgen::GenNavigator-»
- «EXPAND xpt::Common::copyright FOR editorGen-»
-package «packageName»;
-«EXPAND xpt::Common::generatedClassComment»
-public class «contentProviderClassName» implements org.eclipse.ui.navigator.ICommonContentProvider {
- «EXPAND attributes-»
-
- «EXPAND _constructor-»
- «EXPAND genAllMethodNodeCase-»
- «EXPAND iContentProvider-»
-
- «EXPAND iStructuredContentProvider-»
-
- «EXPAND iMementoAware-»
-
- «EXPAND iCommonContentProvider-»
-
- «EXPAND iTreeContentProvider-»
-
- «EXPAND additions-»
-}
-«ENDDEFINE»
-«DEFINE attributes FOR gmfgen::GenNavigator-»
- «EXPAND xpt::Common::generatedMemberComment»
-private static final Object[] EMPTY_ARRAY = new Object[0];
- «EXPAND xpt::Common::generatedMemberComment»
-private org.eclipse.jface.viewers.Viewer myViewer;
- «EXPAND xpt::Common::generatedMemberComment»
-private org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain myEditingDomain;
- «EXPAND xpt::Common::generatedMemberComment»
-private org.eclipse.emf.workspace.util.WorkspaceSynchronizer myWorkspaceSynchronizer;
- «EXPAND xpt::Common::generatedMemberComment»
-private Runnable myViewerRefreshRunnable;
-«ENDDEFINE»
-«DEFINE _constructor FOR gmfgen::GenNavigator-»
- «EXPAND xpt::Common::generatedMemberComment»
-«EXPAND CodeStyle::SuppressWarnings('{ "unchecked", "serial", "rawtypes" }') FOR editorGen.diagram-»
-public «contentProviderClassName»() {
- «EXPAND initCommonAttributes-»
-}
-«ENDDEFINE»
-«DEFINE initCommonAttributes FOR gmfgen::GenNavigator-»
-org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain = «EXPAND createEditingDomain»;
-myEditingDomain = (org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain) editingDomain;
-myEditingDomain.setResourceToReadOnlyMap(new java.util.HashMap() {
- public Object get(Object key) {
- if (!containsKey(key)) {
- put(key, Boolean.TRUE);
- }
- return super.get(key);
- }
-});
-myViewerRefreshRunnable = new Runnable() {
- public void run() {
- if (myViewer != null) {
- myViewer.refresh();
- }
- }
-};
-myWorkspaceSynchronizer = new org.eclipse.emf.workspace.util.WorkspaceSynchronizer(editingDomain, new org.eclipse.emf.workspace.util.WorkspaceSynchronizer.Delegate() {
- public void dispose() {
- }
- public boolean handleResourceChanged(final org.eclipse.emf.ecore.resource.Resource resource) {
- «EXPAND processChanges-»
- }
-
- public boolean handleResourceDeleted(org.eclipse.emf.ecore.resource.Resource resource) {
- «EXPAND processChanges-»
- }
-
- public boolean handleResourceMoved(org.eclipse.emf.ecore.resource.Resource resource, final org.eclipse.emf.common.util.URI newURI) {
- «EXPAND processChanges-»
- }
-});
-«ENDDEFINE»
-«DEFINE processChanges FOR gmfgen::GenNavigator-»
-for (java.util.Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
- org.eclipse.emf.ecore.resource.Resource nextResource = (org.eclipse.emf.ecore.resource.Resource) it.next();
- nextResource.unload();
-}
-if (myViewer != null) {
- myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
-}
-return true;
-«ENDDEFINE»
-«DEFINE iContentProvider FOR gmfgen::GenNavigator-»
- «EXPAND dispose-»
-
- «EXPAND inputChanged-»
-«ENDDEFINE»
-«DEFINE dispose FOR gmfgen::GenNavigator-»
- «EXPAND xpt::Common::generatedMemberComment»
-public void dispose() {
- myWorkspaceSynchronizer.dispose();
- myWorkspaceSynchronizer = null;
- myViewerRefreshRunnable = null;
- for (java.util.Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
- org.eclipse.emf.ecore.resource.Resource resource = (org.eclipse.emf.ecore.resource.Resource) it.next();
- resource.unload();
- }
- ((org.eclipse.emf.transaction.TransactionalEditingDomain) myEditingDomain).dispose();
- myEditingDomain = null;
-}
-«ENDDEFINE»
-«DEFINE inputChanged FOR gmfgen::GenNavigator-»
- «EXPAND xpt::Common::generatedMemberComment»
-public void inputChanged(org.eclipse.jface.viewers.Viewer viewer, Object oldInput, Object newInput) {
- myViewer = viewer;
-}
-«ENDDEFINE»
-«DEFINE iStructuredContentProvider FOR gmfgen::GenNavigator-»
-«EXPAND xpt::Common::generatedMemberComment»
-public Object[] getElements(Object inputElement) {
- return getChildren(inputElement);
-}
-«ENDDEFINE»
-«DEFINE iMementoAware FOR gmfgen::GenNavigator-»
-«EXPAND xpt::Common::generatedMemberComment»
-public void restoreState(org.eclipse.ui.IMemento aMemento) {
-}
-«EXPAND xpt::Common::generatedMemberComment»
-public void saveState(org.eclipse.ui.IMemento aMemento) {
-}
-«ENDDEFINE»
-«DEFINE iCommonContentProvider FOR gmfgen::GenNavigator-»
-«EXPAND xpt::Common::generatedMemberComment»
-public void init(org.eclipse.ui.navigator.ICommonContentExtensionSite aConfig) {
-}
-«ENDDEFINE»
-«DEFINE iTreeContentProvider FOR gmfgen::GenNavigator-»
- «EXPAND getChildren-»
-
- «EXPAND getParent-»
-
- «EXPAND hasChildren-»
-«ENDDEFINE»
-«DEFINE getChildren FOR gmfgen::GenNavigator-»
-«EXPAND xpt::Common::generatedMemberComment»
-public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof org.eclipse.core.resources.IFile) {
- «EXPAND getFileChildren-»
- }
-
- if (parentElement instanceof «getNavigatorGroupQualifiedClassName()») {
- «EXPAND getGroupChildren-»
- }
-
- if (parentElement instanceof «getNavigatorItemQualifiedClassName()») {
- «EXPAND getItemChildren-»
- }
-
- «IF editorGen.diagram.generateShortcutIcon()-»
- «EXPAND getAdaptableChildren»
- «ENDIF-»
- «EXPAND getOtherChildren-»
-}
-
- «EXPAND getViewChildren-»
-
- «EXPAND utilityMethods-»
-«ENDDEFINE»
-«DEFINE getParent FOR gmfgen::GenNavigator-»
-«EXPAND xpt::Common::generatedMemberComment»
-public Object getParent(Object element) {
- if (element instanceof «getAbstractNavigatorItemQualifiedClassName()») {
- «getAbstractNavigatorItemQualifiedClassName()» abstractNavigatorItem = («getAbstractNavigatorItemQualifiedClassName()») element;
- return abstractNavigatorItem.getParent();
- }
- return null;
-}
-«ENDDEFINE»
-«DEFINE hasChildren FOR gmfgen::GenNavigator-»
-«EXPAND xpt::Common::generatedMemberComment»
-public boolean hasChildren(Object element) {
- return element instanceof org.eclipse.core.resources.IFile || getChildren(element).length > 0;
-}
-«ENDDEFINE»
-«DEFINE getFileChildren FOR gmfgen::GenNavigator-»
- «EXPAND getFileResoruce-»
-java.util.Collection result = new java.util.ArrayList();
- «LET getChildReferencesFrom(self, null) AS _references-»
- «EXPAND initGroupVariables(self, _references, 'file', null) FOREACH getGroupNames(_references)-»
- «FOREACH _references AS ref-»
- «EXPAND addNavigatorItemsPrefix FOR ref»selectViewsByType(resource.getContents(), «EXPAND getChildViewType FOR ref.child»)«EXPAND addNavigatorItemsSuffix('file', false) FOR ref-»
- «ENDFOREACH-»
- «EXPAND addGroups(_references) FOREACH getGroupNames(_references)-»
- «ENDLET-»
-return result.toArray();
-«ENDDEFINE»
-«DEFINE getFileResoruce FOR gmfgen::GenNavigator-»
-org.eclipse.core.resources.IFile file = (org.eclipse.core.resources.IFile) parentElement;
-org.eclipse.emf.common.util.URI fileURI = org.eclipse.emf.common.util.URI.createPlatformResourceURI(file.getFullPath().toString(), true);
-org.eclipse.emf.ecore.resource.Resource resource = myEditingDomain.getResourceSet().getResource(fileURI, true);
-«ENDDEFINE»
-«DEFINE getGroupChildren FOR gmfgen::GenNavigator-»
-«getNavigatorGroupQualifiedClassName()» group = («getNavigatorGroupQualifiedClassName()») parentElement;
-return group.getChildren();
-«ENDDEFINE»
-«DEFINE getItemChildren FOR gmfgen::GenNavigator-»
-«getNavigatorItemQualifiedClassName()» navigatorItem = («getNavigatorItemQualifiedClassName()») parentElement;
-if (navigatorItem.isLeaf() || !isOwnView(navigatorItem.getView())) {
- return EMPTY_ARRAY;
-}
-return getViewChildren(navigatorItem.getView(), parentElement);
-«ENDDEFINE»
-«DEFINE getAdaptableChildren FOR gmfgen::GenNavigator-»
-/*
- * Due to plugin.xml restrictions this code will be called only for views representing
- * shortcuts to this diagram elements created on other diagrams.
-*/
-if (parentElement instanceof org.eclipse.core.runtime.IAdaptable) {
- org.eclipse.gmf.runtime.notation.View view = (org.eclipse.gmf.runtime.notation.View) ((org.eclipse.core.runtime.IAdaptable) parentElement).getAdapter(org.eclipse.gmf.runtime.notation.View.class);
- if (view != null) {
- return getViewChildren(view, parentElement);
- }
-}
-«ENDDEFINE»
-«DEFINE getOtherChildren FOR gmfgen::GenNavigator-»
-return EMPTY_ARRAY;
-«ENDDEFINE»
-«DEFINE getViewChildren FOR gmfgen::GenNavigator-»
-«EXPAND xpt::Common::generatedMemberComment»
-private Object[] getViewChildren(org.eclipse.gmf.runtime.notation.View view, Object parentElement) {
- switch («EXPAND xpt::editor::VisualIDRegistry::getVisualIDMethodCall FOR editorGen.diagram»(view)) {
- «REM»BEGIN: PapyrusGenCode«ENDREM»
- «REM» Restructuration of the case «ENDREM»
- «EXPAND caseNavigatorNode(self) FOREACH getNavigatorContainerNodes(self)-»
- «REM»BEGIN: PapyrusGenCode«ENDREM»
- }
- return EMPTY_ARRAY;
-}
-«ENDDEFINE»
-«DEFINE utilityMethods FOR gmfgen::GenNavigator-»
-«EXPAND xpt::Common::generatedMemberComment»
-private java.util.Collection getLinksSourceByType(java.util.Collection edges, String type) {
- java.util.Collection result = new java.util.ArrayList();
- for (java.util.Iterator it = edges.iterator(); it.hasNext();) {
- org.eclipse.gmf.runtime.notation.Edge nextEdge = (org.eclipse.gmf.runtime.notation.Edge) it.next();
- org.eclipse.gmf.runtime.notation.View nextEdgeSource = nextEdge.getSource();
- if (type.equals(nextEdgeSource.getType()) && isOwnView(nextEdgeSource)) {
- result.add(nextEdgeSource);
- }
- }
- return result;
-}
-
-«EXPAND xpt::Common::generatedMemberComment»
- private java.util.Collection getLinksTargetByType(java.util.Collection edges, String type) {
- java.util.Collection result = new java.util.ArrayList();
- for (java.util.Iterator it = edges.iterator(); it.hasNext();) {
- org.eclipse.gmf.runtime.notation.Edge nextEdge = (org.eclipse.gmf.runtime.notation.Edge) it.next();
- org.eclipse.gmf.runtime.notation.View nextEdgeTarget = nextEdge.getTarget();
- if (type.equals(nextEdgeTarget.getType()) && isOwnView(nextEdgeTarget)) {
- result.add(nextEdgeTarget);
- }
- }
- return result;
-}
-«EXPAND xpt::Common::generatedMemberComment»
- private java.util.Collection getOutgoingLinksByType(java.util.Collection nodes, String type) {
- java.util.Collection result = new java.util.ArrayList();
- for (java.util.Iterator it = nodes.iterator(); it.hasNext();) {
- org.eclipse.gmf.runtime.notation.View nextNode = (org.eclipse.gmf.runtime.notation.View) it.next();
- result.addAll(selectViewsByType(nextNode.getSourceEdges(), type));
- }
- return result;
-}
-
-«EXPAND xpt::Common::generatedMemberComment»
-private java.util.Collection getIncomingLinksByType(java.util.Collection nodes, String type) {
- java.util.Collection result = new java.util.ArrayList();
- for (java.util.Iterator it = nodes.iterator(); it.hasNext();) {
- org.eclipse.gmf.runtime.notation.View nextNode = (org.eclipse.gmf.runtime.notation.View) it.next();
- result.addAll(selectViewsByType(nextNode.getTargetEdges(), type));
- }
- return result;
-}
-
-«EXPAND xpt::Common::generatedMemberComment»
-private java.util.Collection getChildrenByType(java.util.Collection nodes, String type) {
- java.util.Collection result = new java.util.ArrayList();
- for (java.util.Iterator it = nodes.iterator(); it.hasNext();) {
- org.eclipse.gmf.runtime.notation.View nextNode = (org.eclipse.gmf.runtime.notation.View) it.next();
- result.addAll(selectViewsByType(nextNode.getChildren(), type));
- }
- return result;
-}
-
-«EXPAND xpt::Common::generatedMemberComment»
-private java.util.Collection getDiagramLinksByType(java.util.Collection diagrams, String type) {
- java.util.Collection result = new java.util.ArrayList();
- for (java.util.Iterator it = diagrams.iterator(); it.hasNext();) {
- org.eclipse.gmf.runtime.notation.Diagram nextDiagram = (org.eclipse.gmf.runtime.notation.Diagram) it.next();
- result.addAll(selectViewsByType(nextDiagram.getEdges(), type));
- }
- return result;
-}
-«EXPAND xpt::Common::generatedMemberComment»
-private java.util.Collection selectViewsByType(java.util.Collection views, String type) {
- java.util.Collection result = new java.util.ArrayList();
- for (java.util.Iterator it = views.iterator(); it.hasNext();) {
- org.eclipse.gmf.runtime.notation.View nextView = (org.eclipse.gmf.runtime.notation.View) it.next();
- if (type.equals(nextView.getType()) && isOwnView(nextView)) {
- result.add(nextView);
- }
- }
- return result;
-}
-
-«EXPAND xpt::Common::generatedMemberComment»
-private boolean isOwnView(org.eclipse.gmf.runtime.notation.View view) {
- return «EXPAND xpt::editor::VisualIDRegistry::modelID FOR editorGen.diagram».equals(«EXPAND xpt::editor::VisualIDRegistry::getModelIDMethodCall FOR editorGen.diagram»(view));
-}
-
-«EXPAND xpt::Common::generatedMemberComment»
-private java.util.Collection createNavigatorItems(java.util.Collection views, Object parent, boolean isLeafs) {
- java.util.Collection result = new java.util.ArrayList();
- for (java.util.Iterator it = views.iterator(); it.hasNext();) {
- result.add(new «getNavigatorItemQualifiedClassName()»((org.eclipse.gmf.runtime.notation.View) it.next(), parent, isLeafs));
- }
- return result;
-}
-«EXPAND getForeignShortcuts-»
-«ENDDEFINE»
-«DEFINE getForeignShortcuts FOR gmfgen::GenNavigator-»
- «IF editorGen.diagram.generateCreateShortcutAction() and getChildReferencesFrom(self, editorGen.diagram)->size() > 0-»
-
-«EXPAND xpt::Common::generatedMemberComment»
-private java.util.Collection getForeignShortcuts(org.eclipse.gmf.runtime.notation.Diagram diagram, Object parent) {
- java.util.Collection result = new java.util.ArrayList();
- for (java.util.Iterator it = diagram.getChildren().iterator(); it.hasNext();) {
- org.eclipse.gmf.runtime.notation.View nextView = (org.eclipse.gmf.runtime.notation.View) it.next();
- if (!isOwnView(nextView) && nextView.getEAnnotation("Shortcut") != null) { «EXPAND xpt::Common::nonNLS»
- result.add(nextView);
- }
- }
- return createNavigatorItems(result, parent, false);
-}
- «ENDIF-»
-«ENDDEFINE»
-«DEFINE createEditingDomain FOR gmfgen::GenNavigator»org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory.INSTANCE.createEditingDomain()«ENDDEFINE»
-«DEFINE initGroupVariables(navigator : gmfgen::GenNavigator, _references : Sequence(gmfgen::GenNavigatorChildReference), parentVarName : String, contextElement : gmfgen::GenCommonBase) FOR String-»
- «navigator.getNavigatorGroupQualifiedClassName()» «validJavaIdentifier(self)» = new «navigator.getNavigatorGroupQualifiedClassName()»(
- «EXPAND xpt::Externalizer::accessorCall(i18nKeyForGroup(self, contextElement)) FOR navigator.editorGen»,
- "«getNavigatorReference(self, _references).groupIcon»", «parentVarName»); «EXPAND xpt::Common::nonNLS»
-«ENDDEFINE»
-«DEFINE addNavigatorItemsPrefix FOR gmfgen::GenNavigatorChildReference»«IF isInsideGroup()»«validJavaIdentifier(groupName)».addChildren(«ELSE»result.addAll(«ENDIF»createNavigatorItems(«ENDDEFINE»
-«DEFINE addNavigatorItemsSuffix(parentVarName : String, isLeaf : Boolean) FOR gmfgen::GenNavigatorChildReference-»
-, «IF isInsideGroup()»«validJavaIdentifier(groupName)»«ELSE»«parentVarName»«ENDIF», «isLeaf»));
-«ENDDEFINE»
-«DEFINE addGroups(_references : Sequence(gmfgen::GenNavigatorChildReference)) FOR String-»
- «LET getNavigatorReference(self, _references) AS ref-»
- «IF ref.hideIfEmpty-»
- if (!«validJavaIdentifier(self)».isEmpty()) {«ENDIF-»
- result.add(«validJavaIdentifier(self)»);
- «IF ref.hideIfEmpty-»
- }«ENDIF-»
- «ENDLET-»
-«ENDDEFINE»
-«DEFINE getChildViewType FOR gmfgen::GenDiagram»«EXPAND xpt::editor::VisualIDRegistry::modelID»«ENDDEFINE»
-«DEFINE getChildViewType FOR gmfgen::GenCommonBase»«EXPAND xpt::editor::VisualIDRegistry::typeMethodCall»«ENDDEFINE»
-«DEFINE caseNavigatorNode(navigator : gmfgen::GenNavigator) FOR gmfgen::GenCommonBase»
-«EXPAND xpt::Common::caseVisualID» {
- «REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM» this code has been modified to call directly submethods«ENDREM»
-//modification of the template to avoid mistake of 65kb.
-return getViewChildrenFor«self.editPartClassName»(view, parentElement);
-«REM»END: PapyrusGenCode«ENDREM»
-}
-«ENDDEFINE»
-«DEFINE addForeignShortcuts FOR gmfgen::GenDiagram-»
- «IF generateCreateShortcutAction()-»
-result.addAll(getForeignShortcuts((org.eclipse.gmf.runtime.notation.Diagram) view, parentElement));
- «ENDIF-»
-«ENDDEFINE»
-«DEFINE addForeignShortcuts FOR gmfgen::GenCommonBase»«ENDDEFINE»
-«DEFINE childrenMethodName(referenceType : gmfgen::GenNavigatorReferenceType, segment : gmfgen::GenNavigatorPathSegment) FOR gmfgen::GenLink-»
- «IF referenceType = gmfgen::GenNavigatorReferenceType::out_target»getLinksTargetByType«ELSE»getLinksSourceByType«ENDIF-»
-«ENDDEFINE»
-«DEFINE childrenMethodName(referenceType : gmfgen::GenNavigatorReferenceType, segment : gmfgen::GenNavigatorPathSegment) FOR gmfgen::GenCommonBase-»
- «IF referenceType = gmfgen::GenNavigatorReferenceType::out_target-»
- getOutgoingLinksByType«ELSEIF referenceType = gmfgen::GenNavigatorReferenceType::in_source-»
- getIncomingLinksByType«ELSE-»
- «IF (Sequence { segment._from })[gmfgen::GenDiagram]->size() > 0 and (Sequence { segment.to })[gmfgen::GenLink]->size() > 0-»
- getDiagramLinksByType«ELSE-»
- getChildrenByType«ENDIF-»
- «ENDIF-»
-«ENDDEFINE»
-«DEFINE additions FOR gmfgen::GenNavigator-»
-«ENDDEFINE»
-«DEFINE i18nAccessors FOR gmfgen::GenNavigator-»
- «LET getChildReferencesFrom(self, null) AS _references-»
- «EXPAND internal_i18nAccessors(null) FOREACH getGroupNames(_references)-»
- «ENDLET-»
- «FOREACH getNavigatorContainerNodes(self) AS contextElement-»
- «LET getChildReferencesFrom(self, contextElement) AS _references-»
- «EXPAND internal_i18nAccessors(contextElement) FOREACH getGroupNames(_references)-»
- «ENDLET-»
- «ENDFOREACH-»
-«ENDDEFINE»
-«DEFINE internal_i18nAccessors(contextElement : gmfgen::GenCommonBase) FOR String-»
-«IF null <> self»«EXPAND xpt::Externalizer::accessorField(i18nKeyForGroup(self, contextElement))»«ENDIF-»
-«ENDDEFINE»
-«DEFINE i18nValues FOR gmfgen::GenNavigator-»
-«LET getChildReferencesFrom(self, null) AS _references-»
-«EXPAND internal_i18nValues(null) FOREACH getGroupNames(_references)-»
-«ENDLET-»
-«FOREACH getNavigatorContainerNodes(self) AS contextElement-»
-«LET getChildReferencesFrom(self, contextElement) AS _references-»
-«EXPAND internal_i18nValues(contextElement) FOREACH getGroupNames(_references)-»
-«ENDLET-»
-«ENDFOREACH-»
-«ENDDEFINE»
-«DEFINE internal_i18nValues(contextElement : gmfgen::GenCommonBase) FOR String-»
-«IF null <> self»«EXPAND xpt::Externalizer::messageEntry(i18nKeyForGroup(self, contextElement), self)»«ENDIF-»
-«ENDDEFINE»
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»Loop to call generator of each method«ENDREM»
-«DEFINE genAllMethodNodeCase FOR gmfgen::GenNavigator-»
-«EXPAND caseMethodNodeNode(self) FOREACH getNavigatorContainerNodes(self)-»
-«ENDDEFINE»
-«REM»END: PapyrusGenCode«ENDREM»
-«REM»BEGIN: PapyrusGenCode«ENDREM»
-«REM»this template has been modified to fixe bug generation by GMF framework.«ENDREM»
-«REM»Is avoid generated method that are greater than 64Kb«ENDREM»
-«DEFINE caseMethodNodeNode(gmfgen::GenNavigator navigator) FOR gmfgen::GenCommonBase»
-/**
- *
- *Papyrus Template
- *this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
- *@generated
-**/
-private Object[] getViewChildrenFor«self.editPartClassName»(org.eclipse.gmf.runtime.notation.View view, Object parentElement){
- java.util.Collection result = new java.util.ArrayList();
- «EXPAND addForeignShortcuts FOR self-»
- «LET getChildReferencesFrom(navigator, self) AS _references-»
- «EXPAND initGroupVariables(navigator, _references, 'parentElement', self) FOREACH getGroupNames(_references)-»
- «FOREACH _references AS reference ITERATOR referencesIterator-»
- «FOREACH reference.findConnectionPaths() AS path ITERATOR pathsIterator-»
- «FOREACH path.segments AS segment ITERATOR segmentsIterator-»
- «IF referencesIterator.isFirstIteration() and pathsIterator.isFirstIteration() and segmentsIterator.isFirstIteration()»java.util.Collection «ENDIF-»
- connectedViews = «EXPAND childrenMethodName(reference.referenceType, segment) FOR segment._from-»
- («IF segmentsIterator.isFirstIteration()»java.util.Collections.singleton(view)«ELSE»connectedViews«ENDIF-»
- , «EXPAND xpt::editor::VisualIDRegistry::typeMethodCall FOR segment.to»);
- «ENDFOREACH-»
- «EXPAND addNavigatorItemsPrefix FOR reference»connectedViews«EXPAND addNavigatorItemsSuffix('parentElement', reference.referenceType <> gmfgen::GenNavigatorReferenceType::children) FOR reference-»
- «ENDFOREACH-»
- «ENDFOREACH-»
- «EXPAND addGroups(_references) FOREACH getGroupNames(_references)-»
- «ENDLET-»
- return result.toArray();
-}
-«ENDDEFINE»
-«REM»END: PapyrusGenCode«ENDREM»
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/preferences/LinkPreferencePage.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/preferences/LinkPreferencePage.xpt
deleted file mode 100644
index 0568f5f9e21..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/preferences/LinkPreferencePage.xpt
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2008 Atos Origin
- *
- * 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:
- * Thibault Landre (Atos Origin) - initial API and implementation
- * Vincent Lorenzo (CEA-LIST) - 335987: [General][Enhancement] Show/Hide Connectors Labels https://bugs.eclipse.org/bugs/show_bug.cgi?id=335987
- */
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension'»
-
-«EXTENSION xpt::preferences::PrefsConstant»
-
-«DEFINE className FOR gmfgen::GenLink»«elementType.displayName»«getPreferencePageSuffix()»«ENDDEFINE»
-
-«DEFINE LinkPreferencePage FOR gmfgen::GenLink-»
-package «getDiagram().preferencesPackageName»;
-
-«EXPAND xpt::Common::generatedClassComment»
-public class «EXPAND className» extends org.eclipse.papyrus.infra.gmfdiag.preferences.pages.AbstractPapyrusLinkPreferencePage {
-
-«EXPAND xpt::Common::generatedClassComment»
- public «EXPAND className»() {
- super();
- setPreferenceKey( «getDiagram().editPartsPackageName».«getDiagram().editPartClassName».MODEL_ID+"_«elementType.displayName»");
- }
- «EXPAND xpt::Common::generatedClassComment»
- @Override
- protected String getBundleId() {
- return «getDiagram().editorGen.plugin.getActivatorQualifiedClassName()».ID;
- }
-
- «EXPAND xpt::Common::generatedClassComment»
- public static void initDefaults(org.eclipse.jface.preference.IPreferenceStore store) {
- «REM» executed, only if the element has labels with defined role (using papyrusgmfgenextension::LabelVisibilityPreference) «ENDREM»
- «IF self.labels->exists(lbl0 : gmfgen::GenLinkLabel | (papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label0 : papyrusgmfgenextension::LabelVisibilityPreference | label0.linkLabels->includes(lbl0))->size()<>0))-»
- String key = «getDiagram().editPartsPackageName».«getDiagram().editPartClassName».MODEL_ID+"_«elementType.displayName»";
- java.util.Map<String, Boolean> map = getStaticLabelVisibilityPreferences();
- for(String role : map.keySet()){
- String preferenceName = org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getLabelElementConstant(key, role, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.LABEL_VISIBILITY);
- store.setDefault(preferenceName, map.get(role));
- }
- «ENDIF-»
- «REM» end of the add for papyrusgmfgenextension::LabelVisibilityPreference«ENDREM»
- }
-
- «REM» executed, only if the element has labels with defined role (using papyrusgmfgenextension::LabelVisibilityPreference) «ENDREM»
- «IF self.labels->exists(lbl0 : gmfgen::GenLinkLabel | (papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label0 : papyrusgmfgenextension::LabelVisibilityPreference | label0.linkLabels->includes(lbl0))->size()<>0))-»
- «EXPAND xpt::Common::generatedClassComment»
- private static java.util.TreeMap<String,String> getStaticLabelRole(){
- java.util.TreeMap<String,String> map = new java.util.TreeMap<String, String>(new org.eclipse.papyrus.uml.diagram.common.util.StringComparator());
- «FOREACH labels AS lbl-»
- «IF papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label : papyrusgmfgenextension::LabelVisibilityPreference | label.linkLabels->includes(lbl))->size()<>0-»
- map.put(
- "«papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label : papyrusgmfgenextension::LabelVisibilityPreference | label.linkLabels->includes(lbl))->asSequence()->first().role»"
- ,"«papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label : papyrusgmfgenextension::LabelVisibilityPreference | label.linkLabels->includes(lbl))->asSequence()->first().iconPathRole»"
- );//$NON-NLS-1$ //$NON-NLS-2$
- «ENDIF-»
- «ENDFOREACH-»
- return map;
- }
-
- «EXPAND xpt::Common::generatedClassComment»
- private static java.util.TreeMap<String,Boolean> getStaticLabelVisibilityPreferences(){
- java.util.TreeMap<String,Boolean> map = new java.util.TreeMap<String,Boolean>();
- «FOREACH labels AS lbl-»
- «IF papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label : papyrusgmfgenextension::LabelVisibilityPreference | label.linkLabels->includes(lbl))->size()<>0-»
- «IF papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label : papyrusgmfgenextension::LabelVisibilityPreference | label.linkLabels->includes(lbl))->asSequence()->first().visibleByDefault=true-»
- map.put("«papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label : papyrusgmfgenextension::LabelVisibilityPreference | label.linkLabels->includes(lbl))->asSequence()->first().role»"
- ,Boolean.TRUE);
- «ELSE»
- map.put("«papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label : papyrusgmfgenextension::LabelVisibilityPreference | label.linkLabels->includes(lbl))->asSequence()->first().role»"
- ,Boolean.FALSE);//$NON-NLS-1$
- «ENDIF»
- «ENDIF-»
- «ENDFOREACH-»
- return map;
- }
-
- «EXPAND xpt::Common::generatedClassComment»
- protected java.util.TreeMap<String,String> getLabelRole(){
- return getStaticLabelRole();
- }
- «ENDIF»
- «REM» end of the code used to managed papyrusgmfgenextension::LabelVisibilityPreference«ENDREM»
-}
-«ENDDEFINE»
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/preferences/NodePreferencePage.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/preferences/NodePreferencePage.xpt
deleted file mode 100644
index ef9fbc38b3f..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/preferences/NodePreferencePage.xpt
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * Copyright (c) 2008 Atos Origin
- *
- * 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:
- * Thibault Landre (Atos Origin) - initial API and implementation
- * Vincent Lorenzo (CEA-LIST) - Add templates to manage the display of the compartments in the preferences pages
- * Vincent Lorenzo (CEA-LIST) - bug 335987: [General][Enhancement] Show/Hide Connectors Labels https://bugs.eclipse.org/bugs/show_bug.cgi?id=335987
- * Vincent Lorenzo (CEA-LIST) - bug 342954: [Preferences] Add the possibility to define the visibility of the compartments using the GmfGen
- */
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension'»
-«EXTENSION xpt::diagram::ViewmapAttributesUtils»
-
-«EXTENSION xpt::preferences::PrefsConstant»
-
-«DEFINE className FOR gmfgen::GenNode-»«IF "UNDEFINED" <> elementType.displayName.toUpper()-»«elementType.displayName-»«getPreferencePageSuffix()-»«ENDIF»
-«ENDDEFINE»
-
-«DEFINE compartmentsList FOR gmfgen::GenNode-»
- «FOREACH compartments AS cpt SEPARATOR ','-»
- "«cpt.title»"
- «ENDFOREACH-»
-«ENDDEFINE»
-
-«DEFINE NodePreferencePage FOR gmfgen::GenNode-»
-package «getDiagram().preferencesPackageName»;
-
-«EXPAND xpt::Common::generatedClassComment»
-public class «EXPAND className» extends org.eclipse.papyrus.infra.gmfdiag.preferences.pages.AbstractPapyrusNodePreferencePage {
-
- «IF compartments->size() <> 0-»
- «EXPAND xpt::Common::generatedClassComment»
- public static final String compartments[] ={«EXPAND compartmentsList»};
- «ENDIF»
-
- «EXPAND xpt::Common::generatedClassComment»
- public «EXPAND className»() {
- super();
- setPreferenceKey( «getDiagram().editPartsPackageName».«getDiagram().editPartClassName».MODEL_ID+"_«elementType.displayName»");
- }
- «EXPAND xpt::Common::generatedClassComment»
- @Override
- protected String getBundleId() {
- return «getDiagram().editorGen.plugin.getActivatorQualifiedClassName()».ID;
- }
-
- «EXPAND xpt::Common::generatedClassComment»
- public static void initDefaults(org.eclipse.jface.preference.IPreferenceStore store) {
-
- String key = «getDiagram().editPartsPackageName».«getDiagram().editPartClassName».MODEL_ID+"_«elementType.displayName»";
- store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(key, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.WIDTH),«defaultSizeWidth(self.viewmap, 40)»);
- store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(key, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.HEIGHT),«defaultSizeHeight(self.viewmap, 40)»);
-
- «IF compartments->size() <> 0-»
- java.util.Map<String, Boolean> map = getStaticCompartmentVisibilityPreferences();
- for(String name : map.keySet()){
- String preferenceName = org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getLabelElementConstant(key, name, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COMPARTMENT_VISIBILITY);
- store.setDefault(preferenceName, map.get(name));
- }
-
- map = getStaticCompartmentTitleVisibilityPreferences();
- for(String name : map.keySet()){
- String preferenceName = org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getLabelElementConstant(key, name, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COMPARTMENT_NAME_VISIBILITY);
- store.setDefault(preferenceName, map.get(name));
- }
- «ENDIF-»
-
- «REM» executed, only if the element has labels with defined role (using papyrusgmfgenextension::LabelVisibilityPreference) «ENDREM»
- «IF self.labels->exists(lbl : gmfgen::GenExternalNodeLabel | (papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label : papyrusgmfgenextension::LabelVisibilityPreference | label.externalNodeLabels->includes(lbl))->size()<>0))-»
- «IF compartments->size() <> 0-»
- map = getStaticLabelVisibilityPreferences();
- «ELSE»
- java.util.Map<String, Boolean> map = getStaticLabelVisibilityPreferences();
- «ENDIF»
- for(String role : map.keySet()){
- String preferenceName = org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getLabelElementConstant(key, role, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.LABEL_VISIBILITY);
- store.setDefault(preferenceName, map.get(role));
- }
- «ENDIF-»
- «REM» end of the add for papyrusgmfgenextension::LabelVisibilityPreference «ENDREM»
-
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
-
- // Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
-
- }
-
- «IF compartments->size() <> 0-»
- «EXPAND xpt::Common::generatedClassComment»
- @Override
- protected void initializeCompartmentsList() {
- for(String name : compartments) {
- this.compartmentsList.add(name);
- }
- }
-
-
- «EXPAND xpt::Common::generatedClassComment»
- private static java.util.TreeMap<String,Boolean> getStaticCompartmentVisibilityPreferences(){
- java.util.TreeMap<String,Boolean> map = new java.util.TreeMap<String,Boolean>();
- «FOREACH compartments AS cpt-»
- «IF papyrusgmfgenextension::CompartmentVisibilityPreference.allInstances()->select(cptPref : papyrusgmfgenextension::CompartmentVisibilityPreference | cptPref.compartments->includes(cpt))->size()<>0-»
- «IF papyrusgmfgenextension::CompartmentVisibilityPreference.allInstances()->select(cptPref : papyrusgmfgenextension::CompartmentVisibilityPreference | cptPref.compartments->includes(cpt))->asSequence()->first().visibleByDefault=true-»
- map.put("«cpt.title»", Boolean.TRUE);
- «ELSE-»
- map.put("«cpt.title»", Boolean.FALSE);
- «ENDIF-»
- «ELSE-»
- map.put("«cpt.title»",Boolean.TRUE);
- «ENDIF-»
- «ENDFOREACH-»
- return map;
- }
-
- «EXPAND xpt::Common::generatedClassComment»
- private static java.util.TreeMap<String, Boolean> getStaticCompartmentTitleVisibilityPreferences(){
- java.util.TreeMap<String,Boolean> map = new java.util.TreeMap<String,Boolean>();
- «FOREACH compartments AS cpt-»
- «IF cpt.needsTitle-» «REM» we set in the map only the compartment which needs a title «ENDREM»
- «IF papyrusgmfgenextension::CompartmentTitleVisibilityPreference.allInstances()->select(cptPref : papyrusgmfgenextension::CompartmentTitleVisibilityPreference | cptPref.compartments->includes(cpt))->size()<>0-»
- «IF papyrusgmfgenextension::CompartmentTitleVisibilityPreference.allInstances()->select(cptPref : papyrusgmfgenextension::CompartmentTitleVisibilityPreference | cptPref.compartments->includes(cpt))->asSequence()->first().visibleByDefault=true-»
- map.put("«cpt.title»", Boolean.TRUE);
- «ELSE-»
- map.put("«cpt.title»", Boolean.FALSE);
- «ENDIF-»
- «ELSE-»
- map.put("«cpt.title»",Boolean.TRUE);
- «ENDIF-»
- «ENDIF-»
- «ENDFOREACH-»
- return map;
- }
-
- «EXPAND xpt::Common::generatedClassComment»
- protected java.util.TreeMap<String, Boolean> getCompartmentTitleVisibilityPreferences() {
- return getStaticCompartmentTitleVisibilityPreferences();
- }
-
- «ENDIF-»
- «REM» executed, only if the element has labels with defined role (using papyrusgmfgenextension::LabelVisibilityPreference) «ENDREM»
- «IF self.labels->exists(lbl0 : gmfgen::GenExternalNodeLabel | (papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label0 : papyrusgmfgenextension::LabelVisibilityPreference | label0.externalNodeLabels->includes(lbl0))->size()<>0))-»
- «EXPAND xpt::Common::generatedClassComment»
- private static java.util.TreeMap<String,String> getStaticLabelRole(){
- java.util.TreeMap<String,String> map = new java.util.TreeMap<String, String>(new org.eclipse.papyrus.uml.diagram.common.util.StringComparator());
- «FOREACH labels AS lbl-»
- «IF lbl.oclIsKindOf(gmfgen::GenExternalNodeLabel)-»
- «IF papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label : papyrusgmfgenextension::LabelVisibilityPreference | label.externalNodeLabels->includes(lbl.oclAsType(gmfgen::GenExternalNodeLabel)))->size()<>0-»
- map.put(
- "«papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label : papyrusgmfgenextension::LabelVisibilityPreference | label.externalNodeLabels->includes(lbl.oclAsType(gmfgen::GenExternalNodeLabel)))->asSequence()->first().role»"
- ,"«papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label : papyrusgmfgenextension::LabelVisibilityPreference | label.externalNodeLabels->includes(lbl.oclAsType(gmfgen::GenExternalNodeLabel)))->asSequence()->first().iconPathRole»"
- );//$NON-NLS-1$
- «ENDIF-»
- «ENDIF-»
- «ENDFOREACH-»
- return map;
- }
-
- «EXPAND xpt::Common::generatedClassComment»
- private static java.util.TreeMap<String,Boolean> getStaticLabelVisibilityPreferences(){
- java.util.TreeMap<String,Boolean> map = new java.util.TreeMap<String,Boolean>();
- «FOREACH labels AS lbl-»
- «IF lbl.oclIsKindOf(gmfgen::GenExternalNodeLabel)-»
- «IF papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label : papyrusgmfgenextension::LabelVisibilityPreference | label.externalNodeLabels->includes(lbl.oclAsType(gmfgen::GenExternalNodeLabel)))->size()<>0-»
- «IF papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label : papyrusgmfgenextension::LabelVisibilityPreference | label.externalNodeLabels->includes(lbl.oclAsType(gmfgen::GenExternalNodeLabel)))->asSequence()->first().visibleByDefault=true-»
- map.put("«papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label : papyrusgmfgenextension::LabelVisibilityPreference | label.externalNodeLabels->includes(lbl.oclAsType(gmfgen::GenExternalNodeLabel)))->asSequence()->first().role»"
- , Boolean.TRUE);
- «ELSE-»
- map.put("«papyrusgmfgenextension::LabelVisibilityPreference.allInstances()->select(label : papyrusgmfgenextension::LabelVisibilityPreference | label.externalNodeLabels->includes(lbl.oclAsType(gmfgen::GenExternalNodeLabel)))->asSequence()->first().role»"
- , Boolean.FALSE);
- «ENDIF-»
- «ENDIF-»
- «ENDIF-»
- «ENDFOREACH-»
- return map;
- }
-
- «EXPAND xpt::Common::generatedClassComment»
- protected java.util.TreeMap<String,String> getLabelRole(){
- return getStaticLabelRole();
- }
- «ENDIF-»
- «REM» end of the code used to managed papyrusgmfgenextension::LabelVisibilityPreference«ENDREM»
-}
-«ENDDEFINE» \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/preferences/PrefsConstant.qvto b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/preferences/PrefsConstant.qvto
deleted file mode 100644
index 65c575be58e..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/preferences/PrefsConstant.qvto
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 2008 Atos Origin
- *
- * 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:
- * Thibault Landre (Atos Origin) - initial API and implementation
- * modified by Patrick Tessier(CEA LIST)
- */
-
-import org.eclipse.papyrus.codegen.utils.PapyrusGenConstants;
-
-modeltype genModel uses "http://www.eclipse.org/gmf/2009/GenModel";
-modeltype ecore uses "http://www.eclipse.org/emf/2002/Ecore";
-
-library PrefsConstant;
-
-helper getPreferenceConstantFileName() : String {
-return getIDiagramPreferenceConstantJavaClassName()
-}
-
-helper getDiagramPreferencePageFileName( diagramName: String) : String{
- return getDiagramPreferencePageJavaClassName(diagramName)
-}
-
-helper getDiagramPreferencePageCategory() : String{
- return "org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams"
-}
-
-helper getPreferenceConstant() : String{
-return "_PREF_"
-}
-
-helper getPreferenceGradientPolicyConstant(_element: String) : String{
-return _element + getPreferenceConstant() + "GRADIENT_POLICY"
-}
-
-helper getPreferenceGradientColorConstant(_element: String) : String{
-return _element + getPreferenceConstant() + "GRADIENT_COLOR"
-}
-
-helper getPreferenceFillColorConstant(_element: String ) : String{
-return _element + getPreferenceConstant() + "FILL_COLOR"
-}
-
-helper getPreferenceFontColorConstant(_element: String ) : String{
-return _element + getPreferenceConstant() + "FONT_COLOR"
-}
-
-helper getPreferenceFontConstant(_element: String ) : String{
-return _element + getPreferenceConstant() + "FONT"
-}
-
-helper getPreferenceLineColorConstant(_element: String ): String{
-return _element + getPreferenceConstant() + "LINE_COLOR"
-}
-
-helper getPreferenceJumpLinkConstant(): String{
-return getPreferenceConstant() + "JUMPLINK_"
-}
-
-helper getPreferenceJumpLinkReverseConstant(_element: String ): String{
-return _element + getPreferenceJumpLinkConstant() + "REVERSE"
-}
-
-helper getPreferenceJumpLinkStatusConstant(_element: String ): String{
-return _element + getPreferenceJumpLinkConstant() + "STATUS"
-}
-
-helper getPreferenceJumpLinkTypeConstant(_element: String ): String{
-return _element + getPreferenceJumpLinkConstant() + "TYPE"
-}
-
-helper getPreferenceRoutingConstant(): String{
-return getPreferenceConstant() + "ROUTING_"
-}
-
-helper getPreferenceRoutingDistancePolicyConstant(_element: String ): String{
-return _element + getPreferenceRoutingConstant() + "DISTANCE_POLICY"
-}
-
-helper getPreferenceRoutingObstructionPolicyConstant(_element: String ): String{
-return _element + getPreferenceRoutingConstant() + "OBSTRUCTION_POLICY"
-}
-
-helper getPreferenceRoutingStyleConstant(_element: String ): String{
-return _element + getPreferenceRoutingConstant() + "STYLE"
-}
-
-helper getPreferenceSmoothnessConstant(_element: String ): String{
-return _element + getPreferenceConstant() + "SMOOTHNESS"
-}
-
-helper getPreferencePageSuffix(): String{
-return "PreferencePage"
-} \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/providers/ValidationDecoratorProvider.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/providers/ValidationDecoratorProvider.xpt
deleted file mode 100644
index 4cfc8ddcaf9..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/providers/ValidationDecoratorProvider.xpt
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2007, 2009 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
- * Ansgar Radermacher (CEA LIST) - added support for EMF validation
- */
-
-«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-
-«DEFINE ValidationDecoratorProvider FOR gmfgen::GenDiagram-»
-«EXPAND xpt::Common::copyright FOR editorGen-»
-package «providersPackageName»;
-
-«EXPAND xpt::Common::generatedClassComment»
-public class «validationDecoratorProviderClassName»
- extends org.eclipse.papyrus.uml.diagram.common.providers.ValidationDecoratorProvider
- implements org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorProvider {
-
- «EXPAND xpt::Common::generatedMemberComment»
- public void createDecorators(org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget decoratorTarget) {
- org.eclipse.gef.EditPart editPart = (org.eclipse.gef.EditPart) decoratorTarget.getAdapter(org.eclipse.gef.EditPart.class);
- if (editPart instanceof org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart ||
- editPart instanceof org.eclipse.gef.editparts.AbstractConnectionEditPart) {
- Object model = editPart.getModel();
- if ((model instanceof org.eclipse.gmf.runtime.notation.View)) {
- org.eclipse.gmf.runtime.notation.View view = (org.eclipse.gmf.runtime.notation.View) model;
- if (!(view instanceof org.eclipse.gmf.runtime.notation.Edge) && !view.isSetElement()) {
- return;
- }
- }
- org.eclipse.gef.EditDomain ed = editPart.getViewer().getEditDomain();
- if (!(ed instanceof org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditDomain)) {
- return;
- }
- if (((org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditDomain) ed).getEditorPart() instanceof
- «editorGen.editor.getQualifiedClassName()») {
- decoratorTarget.installDecorator(KEY, new StatusDecorator(decoratorTarget));
- }
- }
- }
-
- «EXPAND xpt::Common::generatedMemberComment»
- public boolean provides(org.eclipse.gmf.runtime.common.core.service.IOperation operation) {
- if (!(operation instanceof org.eclipse.gmf.runtime.diagram.ui.services.decorator.CreateDecoratorsOperation)) {
- return false;
- }
- org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget decoratorTarget =
- ((org.eclipse.gmf.runtime.diagram.ui.services.decorator.CreateDecoratorsOperation) operation).getDecoratorTarget();
- org.eclipse.gmf.runtime.notation.View view = (org.eclipse.gmf.runtime.notation.View) decoratorTarget.getAdapter(
- org.eclipse.gmf.runtime.notation.View.class);
- return view != null && «EXPAND xpt::editor::VisualIDRegistry::modelID».equals(«EXPAND xpt::editor::VisualIDRegistry::getModelIDMethodCall»(view));
- }
-
- «EXPAND additions-»
-}
-«ENDDEFINE»
-
-«DEFINE additions FOR gmfgen::GenDiagram»«ENDDEFINE»
diff --git a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/providers/extensions.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/providers/extensions.xpt
deleted file mode 100644
index af3243fbe9e..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/providers/extensions.xpt
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright (c) 2007, 2010 Borland Software Corporation and others
- *
- * 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/2009/GenModel'»
-«IMPORT 'http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension'»
-«EXTENSION xpt::diagram::Utils»
-
-«DEFINE extensions FOR gmfgen::GenDiagram-»
-
- <extension point="org.eclipse.gmf.runtime.diagram.core.viewProviders" id="view-provider">
- «EXPAND xpt::Common::xmlGeneratedTag»
- <viewProvider class="«getNotationViewProviderQualifiedClassName()»">
- <Priority name="«notationViewProviderPriority»"/>
-«IF shortcutsProvidedFor->notEmpty() /*allow provider activation when another diagram tries to create a node, perhaps ours*/-»
- <object id="referencing-diagrams" class="org.eclipse.gmf.runtime.notation.Diagram">
- <method name="getType()" value="«FOREACH shortcutsProvidedFor AS s SEPARATOR ','»«s»«ENDFOREACH»"/>
- </object>
- <context viewClass="org.eclipse.gmf.runtime.notation.Node" containerViews="referencing-diagrams"/>
-«ENDIF-»
- <context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="«editorGen.modelID»"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="«FOREACH getAllNodes() /*XXX can further improve selection using containerViews attribute, however, when top-node is created, provider is activated and this xml is not consulted any longer*/ AS n SEPARATOR ','»«n.visualID»«ENDFOREACH»"/>
-«IF links->notEmpty() /*it is unlikely there would be a diagram without a node, but a diagram without links deemed possible */-»
- <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="«FOREACH links AS l SEPARATOR ','»«l.visualID»«ENDFOREACH»"/>
-«ENDIF-»
- </viewProvider>
- </extension>
-
- <extension point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders" id="ep-provider">
- «EXPAND xpt::Common::xmlGeneratedTag»
- <editpartProvider class="«getEditPartProviderQualifiedClassName()»">
- <Priority name="«editPartProviderPriority»"/>
- <object class="org.eclipse.gmf.runtime.notation.Diagram" id="generated-diagram">
- <method name="getType()" value="«editorGen.modelID»"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-nodes">
- <method name="getType()" value="«FOREACH getAllNodes() AS n SEPARATOR ','»«n.visualID»«ENDFOREACH»"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Edge" id="generated-links">
- <method name="getType()" value="«FOREACH links AS l SEPARATOR ','»«l.visualID»«ENDFOREACH»"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-labels">
- <method name="getType()" value="«FOREACH getAllNodes().labels AS lb SEPARATOR ','»«lb.visualID»«ENDFOREACH»"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-compartments">
- <method name="getType()" value="«FOREACH compartments AS c SEPARATOR ','»«c.visualID»«ENDFOREACH»"/>
- </object>
- <context views="generated-diagram,generated-nodes,generated-links,generated-labels,generated-compartments"/>
- </editpartProvider>
- </extension>
-
- <extension point="org.eclipse.gmf.runtime.emf.ui.modelingAssistantProviders" id="modelassist-provider">
- «EXPAND xpt::Common::xmlGeneratedTag»
- <modelingAssistantProvider class="«getModelingAssistantProviderQualifiedClassName()»">
- <Priority name="«modelingAssistantProviderPriority»"/>
- <object class="«getEditPartQualifiedClassName()»" id="«getUniqueIdentifier()»"/>
-«FOREACH topLevelNodes AS n-»
- <object class="«n.getEditPartQualifiedClassName()»" id="«n.getUniqueIdentifier()»"/>
-«ENDFOREACH-»
-«FOREACH childNodes AS n-»
- <object class="«n.getEditPartQualifiedClassName()»" id="«n.getUniqueIdentifier()»"/>
-«ENDFOREACH-»
- <context elements="«getUniqueIdentifier()»,«FOREACH topLevelNodes AS n SEPARATOR ','»«n.getUniqueIdentifier()»«ENDFOREACH»,«FOREACH childNodes AS n SEPARATOR ','»«n.getUniqueIdentifier()»«ENDFOREACH»"/>
- </modelingAssistantProvider>
- </extension>
-
- <extension point="org.eclipse.gmf.runtime.common.ui.services.iconProviders" id="icon-provider">
- «EXPAND xpt::Common::xmlGeneratedTag»
- <IconProvider class="«getIconProviderQualifiedClassName()»">
- <Priority name="«iconProviderPriority»"/>
- </IconProvider>
- </extension>
-«IF editorGen.labelParsers <> null and editorGen.labelParsers.extensibleViaService»
- <extension point="org.eclipse.gmf.runtime.common.ui.services.parserProviders" id="parser-provider">
- «EXPAND xpt::Common::xmlGeneratedTag»
- <ParserProvider class="«editorGen.labelParsers.getQualifiedClassName()»">
- <Priority name="«editorGen.labelParsers.providerPriority»"/>
- </ParserProvider>
- </extension>
-«ENDIF-»
-«IF generateShortcutIcon()»
- <extension point="org.eclipse.gmf.runtime.diagram.ui.decoratorProviders" id="decorator-provider">
- «EXPAND xpt::Common::xmlGeneratedTag»
- <decoratorProvider class="«getShortcutsDecoratorProviderQualifiedClassName()»">
- <Priority name="«shortcutsDecoratorProviderPriority»"/>
- <object class="org.eclipse.gmf.runtime.notation.Node(org.eclipse.gmf.runtime.notation)" id="generated-top-nodes">
- <method name="getType()" value="«FOREACH topLevelNodes->asSequence() /*generated code supports shortcuts only to top-level nodes*/ AS n SEPARATOR ','»«n.visualID»«ENDFOREACH»"/>
- </object>
- <context decoratorTargets="generated-top-nodes"/>
- </decoratorProvider>
- </extension>
-«ENDIF-»
-
- <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes" id="element-types">
- «EXPAND xpt::Common::xmlGeneratedTag»
-«FOREACH getAllTypedElements() AS e-»
-«EXPAND elementTypeSafe FOR e.elementType-»
-«ENDFOREACH-»
- </extension>
-
- <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings" id="element-types-bindings">
- «EXPAND xpt::Common::xmlGeneratedTag»
- «IF papyrusgmfgenextension::GenerateUsingElementTypeCreationCommand.allInstances()->size()<1»
- <clientContext id="«editorGen.plugin.iD».TypeContext">
- <enablement>
- <test
- property="org.eclipse.gmf.runtime.emf.core.editingDomain"
- value="«editingDomainID»"/>
- </enablement>
- </clientContext>
- <binding context="«editorGen.plugin.iD».TypeContext">
- «ENDIF»
- «IF papyrusgmfgenextension::GenerateUsingElementTypeCreationCommand.allInstances()->size()>0»
- <binding context="org.eclipse.papyrus.infra.services.edit.TypeContext">
- «ENDIF»
-«FOREACH getAllTypedElements() AS e-»
- <elementType ref="«e.elementType.uniqueIdentifier»"/>
-«ENDFOREACH-»
- <advice ref="org.eclipse.gmf.runtime.diagram.core.advice.notationDepdendents"/>
- </binding>
- </extension>
-«ENDDEFINE»
-
-«DEFINE elementTypeSafe FOR gmfgen::ElementType-»
-«IF not definedExternally-»
-«EXPAND elementType-»
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE elementType FOR gmfgen::ElementType»
-«ERROR 'Unknown element type: ' + self.repr()»
-«ENDDEFINE»
-
-«DEFINE elementType FOR gmfgen::MetamodelType-»
- <metamodel nsURI="«getMetaClass().genPackage.ecorePackage.nsURI»">
- <metamodelType
- id="«uniqueIdentifier»"
-«IF null <> displayName-»
- name="%metatype.name.«diagramElement.getUniqueIdentifier()»"
-«ENDIF-»
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="«getMetaClass().ecoreClass.name»"
- edithelper="«getEditHelperQualifiedClassName()»">
- <param name="semanticHint" value="«diagramElement.visualID»"/>
- </metamodelType>
- </metamodel>
-«ENDDEFINE»
-
-«DEFINE elementType FOR gmfgen::SpecializationType-»
-«IF null = getMetamodelClass()-»
-«EXPAND specializationType-»
-«ELSE-»
- <metamodel nsURI="«getMetamodelClass().genPackage.ecorePackage.nsURI»">
-«EXPAND specializationType-»
- </metamodel>
-«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE specializationType FOR gmfgen::SpecializationType-»
- <specializationType
- id="«uniqueIdentifier»"
-«IF null <> displayName-»
- name="%metatype.name.«diagramElement.getUniqueIdentifier()»"
-«ENDIF-»
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"«IF editHelperAdviceClassName <> null»
- edithelperadvice="«getEditHelperAdviceQualifiedClassName()»"«ENDIF»>
- <specializes id="«(if null = metamodelType then 'org.eclipse.gmf.runtime.emf.type.core.null' else metamodelType.uniqueIdentifier endif)»"/>
- <param name="semanticHint" value="«diagramElement.visualID»"/>
- </specializationType>
-«ENDDEFINE»
-
-«DEFINE elementType FOR gmfgen::NotationType-»
- <specializationType
- id="«uniqueIdentifier»"
-«IF null <> displayName-»
- name="%metatype.name.«diagramElement.getUniqueIdentifier()»"
-«ENDIF-»
- kind="org.eclipse.gmf.runtime.diagram.ui.util.INotationType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="«diagramElement.visualID»"/>
- </specializationType>
-«ENDDEFINE»
-
-«DEFINE i18n FOR gmfgen::GenDiagram-»
-
-# Providers
-«EXPAND internal_i18n FOREACH getAllTypedElements().elementType»
-«ENDDEFINE»
-
-«DEFINE internal_i18n FOR gmfgen::ElementType-»
-«IF null <> displayName and not definedExternally»metatype.name.«diagramElement.getUniqueIdentifier()»=«displayName»«ENDIF»
-«ENDDEFINE»

Back to the top