Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrschnekenbu2010-12-09 13:11:36 +0000
committerrschnekenbu2010-12-09 13:11:36 +0000
commit6b727cdfa9297e7d0f52c1e22a09c1322b3b710c (patch)
treed49f9fc643beb45bfa506f097742ead8919430e4 /plugins/developer/org.eclipse.papyrus.def
parent204499c88d7e70cec7308749019efdd93c2b3028 (diff)
downloadorg.eclipse.papyrus-6b727cdfa9297e7d0f52c1e22a09c1322b3b710c.tar.gz
org.eclipse.papyrus-6b727cdfa9297e7d0f52c1e22a09c1322b3b710c.tar.xz
org.eclipse.papyrus-6b727cdfa9297e7d0f52c1e22a09c1322b3b710c.zip
Merged branch 0.7.X changes r2480:3444 into the trunk
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.def')
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/META-INF/MANIFEST.MF5
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/build.properties6
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/diagram/editparts/ChildNodeLabelEditPart.xpt17
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/impl/diagram/editparts/TextAware.xpt9
-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/plugin/manifest.xpt5
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/plugin/plugin.xpt3
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/providers/ViewProvider.xpt6
-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/editpolicies/BaseItemSemanticEditPolicy.xpt11
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/LinkItemSemanticEditPolicy.xpt35
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/NodeItemSemanticEditPolicy.xpt28
-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/editor/VisualIDRegistry.xpt4
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/preferences/LinkPreferencePage.xpt2
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/preferences/NodePreferencePage.xpt31
-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/plugin.properties12
18 files changed, 478 insertions, 34 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.def/META-INF/MANIFEST.MF b/plugins/developer/org.eclipse.papyrus.def/META-INF/MANIFEST.MF
index 4999908e5b4..ff51e05fe77 100644
--- a/plugins/developer/org.eclipse.papyrus.def/META-INF/MANIFEST.MF
+++ b/plugins/developer/org.eclipse.papyrus.def/META-INF/MANIFEST.MF
@@ -1,6 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
-Bundle-Name: org.eclipse.papyrus.def
+Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.papyrus.def; singleton:=true
-Bundle-Version: 0.7.0.qualifier
+Bundle-Version: 0.7.1.qualifier
Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: %providerName
diff --git a/plugins/developer/org.eclipse.papyrus.def/build.properties b/plugins/developer/org.eclipse.papyrus.def/build.properties
index 2c7d029f9dd..a6f4dd38c26 100644
--- a/plugins/developer/org.eclipse.papyrus.def/build.properties
+++ b/plugins/developer/org.eclipse.papyrus.def/build.properties
@@ -2,9 +2,7 @@ bin.includes = META-INF/,\
.,\
about.html,\
dynamic-templates3.5/,\
- bin/,\
- build.properties
-src.includes = dynamic-templates3.5/,\
- META-INF/,\
build.properties,\
+ plugin.properties
+src.includes = dynamic-templates3.5/,\
bin/
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
index abedd0d3e68..063ddf4759f 100644
--- 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
@@ -13,6 +13,7 @@
«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»
@@ -59,7 +60,21 @@ public class «editPartClassName» «EXPAND extendsList» «EXPAND implementsLis
}
«ENDDEFINE»
-«DEFINE extendsList FOR gmfgen::GenChildLabelNode»extends org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart«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«ENDDEFINE»
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
index d1205eea356..fff5f41591f 100644
--- 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
@@ -111,7 +111,7 @@
«REM»BEGIN: PapyrusGenCode«ENDREM»
«REM»Add extended editors management for direct edit«ENDREM»
- «EXPAND getDirectEditionType-»
+ «EXPAND getDirectEditionType(readOnly)-»
«EXPAND checkExtendedEditor-»
@@ -638,7 +638,7 @@
«REM»BEGIN: PapyrusGenCode«ENDREM»
«REM»Methods for advanced direct edition«ENDREM»
-«DEFINE getDirectEditionType FOR gmfgen::GenCommonBase-»
+«DEFINE getDirectEditionType(readOnly : Boolean) FOR gmfgen::GenCommonBase-»
/**
* Returns the kind of associated editor for direct edition.
*
@@ -646,6 +646,10 @@
* @generated
*/
public int getDirectEditionType() {
+ «IF readOnly-»
+ // The label is read-only (defined in GMFGen model)
+ return org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition.NO_DIRECT_EDITION;
+ «ELSE-»
if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition.EXTENDED_DIRECT_EDITOR;
@@ -656,6 +660,7 @@
// not a named element. no specific editor => do nothing
return org.eclipse.papyrus.diagram.common.editpolicies.IDirectEdition.NO_DIRECT_EDITION;
+ «ENDIF-»
}
«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
new file mode 100644
index 00000000000..4087b0141a6
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/diagram/editpolicies/linkCommands.xpt
@@ -0,0 +1,83 @@
+/*****************************************************************************
+ * 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.service.edit.service.IElementEditService provider = org.eclipse.papyrus.service.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/plugin/manifest.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/aspects/xpt/plugin/manifest.xpt
index 8713ea7b6d3..29f1417f149 100644
--- 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
@@ -10,10 +10,12 @@
* 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 dependency org.eclipse.papyrus.service.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-»
@@ -74,5 +76,8 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.gef,
org.eclipse.papyrus.preferences,
org.eclipse.papyrus.extensionpoints.editors
+«IF papyrusgmfgenextension::EditPartUsingDeleteService.allInstances()->size()<>0 or papyrusgmfgenextension::EditPartUsingReorientService.allInstances()->size()<>0-»
+ ,org.eclipse.papyrus.service.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
index fd44a97d79c..ac6a4ebff79 100644
--- 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
@@ -292,6 +292,9 @@
large_icon="«largeIconPath»"
path="/"
small_icon="«smallIconPath»">
+ <expand
+ force="true">
+ </expand>
</entry>
«REM» TODO: call sub entries...«ENDREM»
«EXPAND toolUsage(self) FOREACH self.entries»
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
index 4999ea09efe..30d2af18282 100644
--- 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
@@ -8,6 +8,7 @@
*
* 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
*/
«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
@@ -273,6 +274,11 @@ public class «notationViewProviderClassName»«EXPAND xpt::providers::ViewProvi
«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.diagram.common.helper.PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(«'node'», «'prefStore'», "«elementType.displayName»");
+«ENDIF-»
+ «REM» END Papyrus Modification «ENDREM»
return node;
}
«ENDDEFINE»
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
new file mode 100644
index 00000000000..f8788ab488d
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/commands/CreateLinkUtils.xpt
@@ -0,0 +1,141 @@
+/*
+ * 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/editpolicies/BaseItemSemanticEditPolicy.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/BaseItemSemanticEditPolicy.xpt
index f1357be9b5f..e5ea4b9b279 100644
--- 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
@@ -34,14 +34,19 @@ public class «baseItemSemanticEditPolicyClassName» extends org.eclipse.gmf.run
'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'
+ '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);
@@ -69,6 +74,8 @@ public class «baseItemSemanticEditPolicyClassName» extends org.eclipse.gmf.run
«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»
@@ -139,7 +146,7 @@ public class «baseItemSemanticEditPolicyClassName» extends org.eclipse.gmf.run
«ENDDEFINE»
«DEFINE getContextElementType FOR gmfgen::GenDiagram-»
«EXPAND xpt::Common::generatedMemberComment»
- private org.eclipse.gmf.runtime.emf.type.core.IElementType getContextElementType(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest request) {
+ 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;
}
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
index 32c89257391..8b371136aa6 100644
--- 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
@@ -9,10 +9,13 @@
* 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-»
@@ -46,17 +49,27 @@ public class «itemSemanticEditPolicyClassName» extends «diagram.getBaseItemSe
«ENDDEFINE»
«DEFINE getDestroySemanticCommand(gmfgen::GenLink genLink) FOR gmfgen::TypeLinkModelFacet-»
- «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.diagram.common.command.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')»);
- }
+
+«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.diagram.common.command.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
index 524eba5809f..ac9d22ae375 100644
--- 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
@@ -9,6 +9,7 @@
* 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»
@@ -18,8 +19,9 @@
«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-»
@@ -32,10 +34,20 @@ public class «itemSemanticEditPolicyClassName» extends «getDiagram().getBaseI
«EXPAND xpt::diagram::editpolicies::childContainerCreateCommand::childContainerCreateCommand FOR childNodes->asSequence()-»
- «EXPAND getDestroyElementCommand-»
- «IF hasChildrenOrCompartments(self)-»
- «EXPAND addDestroyChildNodesCommand-»
- «ENDIF-»
+«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-»
@@ -52,9 +64,9 @@ protected org.eclipse.gef.commands.Command getDestroyElementCommand(org.eclipse.
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-»
+ «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>();
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
new file mode 100644
index 00000000000..407844444c0
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/diagram/editpolicies/UtilsItemSemanticEditPolicy.xpt
@@ -0,0 +1,50 @@
+/*****************************************************************************
+ * 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.service.edit.service.IElementEditService provider = org.eclipse.papyrus.service.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.service.edit.service.IElementEditService provider = org.eclipse.papyrus.service.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/editor/VisualIDRegistry.xpt b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/editor/VisualIDRegistry.xpt
index d9ad879cbaa..ddc709d44b7 100644
--- 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
@@ -341,8 +341,8 @@ private static boolean «EXPAND xpt::editor::VisualIDRegistry::isDiagramMethodNa
«DEFINE _constraintMethods FOR gmfgen::GenDiagram-»
«IF null <> editorGen.expressionProviders-»
- «EXPAND _constraintMethod FOREACH topLevelNodes->select(n | n.modelFacet.modelElementSelector <> null)-»
- «EXPAND _constraintMethod FOREACH childNodes->select(n | n.modelFacet.modelElementSelector <> null)-»
+ «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»
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
index 27d57f2e3af..68b9652d03a 100644
--- 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
@@ -30,7 +30,7 @@ public class «EXPAND className» extends org.eclipse.papyrus.preferences.pages.
«EXPAND xpt::Common::generatedClassComment»
@Override
protected String getBundleId() {
- return «getDiagram().editorGen.plugin.getActivatorQualifiedClassName()».getInstance().ID;
+ return «getDiagram().editorGen.plugin.getActivatorQualifiedClassName()».ID;
}
«EXPAND xpt::Common::generatedClassComment»
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
index cf2d664159b..3e63fe220c6 100644
--- 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
@@ -8,6 +8,7 @@
*
* 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
*/
«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
@@ -18,12 +19,23 @@
«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.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();
@@ -32,7 +44,7 @@ public class «EXPAND className» extends org.eclipse.papyrus.preferences.pages.
«EXPAND xpt::Common::generatedClassComment»
@Override
protected String getBundleId() {
- return «getDiagram().editorGen.plugin.getActivatorQualifiedClassName()».getInstance().ID;
+ return «getDiagram().editorGen.plugin.getActivatorQualifiedClassName()».ID;
}
«EXPAND xpt::Common::generatedClassComment»
@@ -42,6 +54,13 @@ public class «EXPAND className» extends org.eclipse.papyrus.preferences.pages.
store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(key, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.WIDTH),«defaultSizeWidth(self.viewmap, 40)»);
store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(key, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.HEIGHT),«defaultSizeHeight(self.viewmap, 40)»);
+ «IF compartments->size() <> 0-»
+ for(String name : compartments) {
+ String preferenceName = org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getCompartmentElementConstant(key, name, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COMPARTMENT_VISIBILITY);
+ store.setDefault(preferenceName, true);
+ }
+ «ENDIF-»
+
//org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
//org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
@@ -53,6 +72,16 @@ public class «EXPAND className» extends org.eclipse.papyrus.preferences.pages.
//store.setDefault(org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
}
+
+ «IF compartments->size() <> 0-»
+ «EXPAND xpt::Common::generatedClassComment»
+ @Override
+ protected void initializeCompartmentsList() {
+ for(String name : compartments) {
+ this.compartmentsList.add(name);
+ }
+ }
+ «ENDIF-»
}
«ENDDEFINE» \ 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
new file mode 100644
index 00000000000..986009f5e35
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.def/dynamic-templates3.5/codegen/xpt/providers/ValidationDecoratorProvider.xpt
@@ -0,0 +1,64 @@
+/*
+ * 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.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/plugin.properties b/plugins/developer/org.eclipse.papyrus.def/plugin.properties
new file mode 100644
index 00000000000..aadf590a3dd
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.def/plugin.properties
@@ -0,0 +1,12 @@
+#################################################################################
+# Copyright (c) 2008 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:
+# Patrick Tessier patrick.tessier@cea.fr - Initial API and implementation
+##################################################################################
+pluginName=Papyrus Templates Extension for GMF tooling (Incubation)
+providerName=Eclipse Modeling Project

Back to the top