Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.def/xtend')
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/ChildNodeLabelEditPart.xtend86
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/CompartmentEditPart.xtend174
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/DiagramEditPart.xtend56
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/LinkEditPart.xtend60
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/NodeEditPart.xtend222
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/NodeLabelEditPart.xtend14
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/ChoiceUtils_qvto.xtend44
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/ExternalNodeLabelEditPart.xtend58
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/LinkEditPart.xtend18
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/NodeLabelEditPart.xtend16
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/update/CanonicalUpdate.xtend94
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/preferences/StandardPage.xtend18
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/metamodel/Facility.xtend18
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/metamodel/MetaModel.xtend30
-rwxr-xr-xplugins/developer/org.eclipse.papyrus.def/xtend/aspects/parsers/PredefinedParser.xtend124
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/CodeStyle.xtend22
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/commands/CreateLinkUtils.xtend164
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/commands/ReorientLinkUtils.xtend128
-rwxr-xr-xplugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/edithelpers/BaseEditHelper.xtend50
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/edithelpers/EditHelper.xtend74
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editparts/Common.xtend114
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editparts/EditPartFactory.xtend150
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/CompartmentItemSemanticEditPolicy.xtend28
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/DiagramItemSemanticEditPolicy.xtend38
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/LinkItemSemanticEditPolicy.xtend108
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/NodeItemSemanticEditPolicy.xtend506
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/TextNonResizableEditPolicy.xtend36
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/TextSelectionEditPolicy.xtend110
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/Utils_qvto.xtend10
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/linkCommands.xtend92
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/preferences/PreferenceInitializer.xtend14
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/preferences/extensions.xtend140
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/updater/Extensions.xtend46
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/ActionBarContributor.xtend14
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/CreationWizard.xtend346
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/DeleteElementAction.xtend8
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/DiagramContentInitializer.xtend58
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/DiagramEditorContextMenuProvider.xtend12
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/DiagramEditorUtil.xtend210
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/InitDiagramFileAction.xtend160
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/ResourceSetInfo.xtend118
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/extensions.xtend14
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/palette/PaletteConfiguration.xtend2
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/palette/PaletteFactory.xtend238
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/expressions/AbstractExpression.xtend126
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/AbstractNavigatorItem.xtend26
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/DomainNavigatorContentProvider.xtend40
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/DomainNavigatorItem.xtend116
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/NavigatorContentProvider.xtend106
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/NavigatorGroup.xtend80
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/NavigatorItem.xtend10
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/plugin/ActivatorImpl.xtend40
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/plugin/plugin.xtend356
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/MarkerNavigationProvider.xtend14
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/extensions.xtend438
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/utils/EditHelperUtils_qvto.xtend36
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/utils/EditPartsUtils_qvto.xtend90
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/utils/NodeConstraintUtils_qvto.xtend84
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/utils/PrefsConstant_qvto.xtend160
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/utils/UtilsItemSemanticEditPolicy.xtend108
60 files changed, 2936 insertions, 2936 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/ChildNodeLabelEditPart.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/ChildNodeLabelEditPart.xtend
index 1bedd0232ec..cd724aac1d1 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/ChildNodeLabelEditPart.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/ChildNodeLabelEditPart.xtend
@@ -1,43 +1,43 @@
-/**
- * Copyright (c) 2006, 2009, 2013 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
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.diagram.editparts
-
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenChildLabelNode
-import org.eclipse.papyrus.papyrusgmfgenextension.ExtendedGenView
-
-@Singleton class ChildNodeLabelEditPart extends diagram.editparts.ChildNodeLabelEditPart {
-
-
-
- override extendsList(GenChildLabelNode it) '''
-«««BEGIN: PapyrusGenCode
-«««Add own extension
-«IF it.eResource.allContents.filter(typeof (ExtendedGenView)).filter[v |v.genView.contains(it) && v.superOwnedEditPart!=null].size != 0»
-extends «FOR extendedObject : it.eResource.allContents.filter(typeof (ExtendedGenView)).filter[v |v.genView.contains(it) && v.superOwnedEditPart!=null].toIterable»
-«specifyInheritance(extendedObject as ExtendedGenView)»
-«ENDFOR»
-«««END: PapyrusGenCode
-«ELSE»
- extends org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart
-«ENDIF»
-'''
-
-//BEGIN: PapyrusGenCode
-//definition of the inheritance
-def specifyInheritance (ExtendedGenView it)'''«superOwnedEditPart»'''
-//END: PapyrusGenCode
-
-override implementsList(GenChildLabelNode it) '''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'''
-}
+/**
+ * Copyright (c) 2006, 2009, 2013 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
+ * Michael Golubev (Montages) - #386838 - migrate to Xtend2
+ */
+package aspects.diagram.editparts
+
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenChildLabelNode
+import org.eclipse.papyrus.papyrusgmfgenextension.ExtendedGenView
+
+@Singleton class ChildNodeLabelEditPart extends diagram.editparts.ChildNodeLabelEditPart {
+
+
+
+ override extendsList(GenChildLabelNode it) '''
+«««BEGIN: PapyrusGenCode
+«««Add own extension
+«IF it.eResource.allContents.filter(typeof (ExtendedGenView)).filter[v |v.genView.contains(it) && v.superOwnedEditPart!=null].size != 0»
+extends «FOR extendedObject : it.eResource.allContents.filter(typeof (ExtendedGenView)).filter[v |v.genView.contains(it) && v.superOwnedEditPart!=null].toIterable»
+«specifyInheritance(extendedObject as ExtendedGenView)»
+«ENDFOR»
+«««END: PapyrusGenCode
+«ELSE»
+ extends org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart
+«ENDIF»
+'''
+
+//BEGIN: PapyrusGenCode
+//definition of the inheritance
+def specifyInheritance (ExtendedGenView it)'''«superOwnedEditPart»'''
+//END: PapyrusGenCode
+
+override implementsList(GenChildLabelNode it) '''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'''
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/CompartmentEditPart.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/CompartmentEditPart.xtend
index 7795020066c..1afae6e2876 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/CompartmentEditPart.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/CompartmentEditPart.xtend
@@ -1,87 +1,87 @@
-/**
- * Copyright (c) 2006, 2009, 2013 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
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.diagram.editparts
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenCompartment
-import org.eclipse.papyrus.papyrusgmfgenextension.ExtendedGenView
-import xpt.Common
-
-@Singleton class CompartmentEditPart extends diagram.editparts.CompartmentEditPart {
- @Inject extension Common;
-
- override extendsList(GenCompartment it) '''
-
-«««BEGIN: PapyrusGenCode
-«««Add own extension
-«IF it.eResource.allContents.filter(typeof(ExtendedGenView)).filter[v|v.genView.contains(it) && v.superOwnedEditPart != null].size != 0»
- extends «FOR extendedObject : it.eResource.allContents.filter(typeof (ExtendedGenView)).filter[v|v.genView.contains(it) && v.superOwnedEditPart != null].toIterable»
- «specifyInheritance(extendedObject as ExtendedGenView)»
-«ENDFOR»
-«««END: BEGIN: PapyrusGenCode
-«ELSE»
- extends «IF listLayout»org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart«ELSE»org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.linklf.LinkLFShapeCompartmentEditPart«ENDIF»
-«ENDIF»
- '''
-
- //BEGIN: PapyrusGenCode
- //definition of the inheritance
- def specifyInheritance(ExtendedGenView it) '''«superOwnedEditPart»'''
-
- //END: PapyrusGenCode
- override additions(GenCompartment it) '''
- «handleSize(it)»
- «refreshbound(it)»
- «refreshvisual(it)»
- '''
-
- def handleSize(GenCompartment it) '''
- «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);
- }
-'''
-
- def refreshbound(GenCompartment it) '''
- «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));
- }
- '''
-
- def refreshvisual(GenCompartment it) '''
- «generatedMemberComment»
-protected void refreshVisuals() {
- super.refreshVisuals();
- refreshBounds();
- }
-'''
-}
+/**
+ * Copyright (c) 2006, 2009, 2013 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
+ * Michael Golubev (Montages) - #386838 - migrate to Xtend2
+ */
+package aspects.diagram.editparts
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenCompartment
+import org.eclipse.papyrus.papyrusgmfgenextension.ExtendedGenView
+import xpt.Common
+
+@Singleton class CompartmentEditPart extends diagram.editparts.CompartmentEditPart {
+ @Inject extension Common;
+
+ override extendsList(GenCompartment it) '''
+
+«««BEGIN: PapyrusGenCode
+«««Add own extension
+«IF it.eResource.allContents.filter(typeof(ExtendedGenView)).filter[v|v.genView.contains(it) && v.superOwnedEditPart != null].size != 0»
+ extends «FOR extendedObject : it.eResource.allContents.filter(typeof (ExtendedGenView)).filter[v|v.genView.contains(it) && v.superOwnedEditPart != null].toIterable»
+ «specifyInheritance(extendedObject as ExtendedGenView)»
+«ENDFOR»
+«««END: BEGIN: PapyrusGenCode
+«ELSE»
+ extends «IF listLayout»org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart«ELSE»org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.linklf.LinkLFShapeCompartmentEditPart«ENDIF»
+«ENDIF»
+ '''
+
+ //BEGIN: PapyrusGenCode
+ //definition of the inheritance
+ def specifyInheritance(ExtendedGenView it) '''«superOwnedEditPart»'''
+
+ //END: PapyrusGenCode
+ override additions(GenCompartment it) '''
+ «handleSize(it)»
+ «refreshbound(it)»
+ «refreshvisual(it)»
+ '''
+
+ def handleSize(GenCompartment it) '''
+ «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);
+ }
+'''
+
+ def refreshbound(GenCompartment it) '''
+ «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));
+ }
+ '''
+
+ def refreshvisual(GenCompartment it) '''
+ «generatedMemberComment»
+protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshBounds();
+ }
+'''
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/DiagramEditPart.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/DiagramEditPart.xtend
index d8f7a8e2c3b..a6e7c02d13d 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/DiagramEditPart.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/DiagramEditPart.xtend
@@ -1,28 +1,28 @@
-/**
- * Copyright (c) 2006, 2010, 2013 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
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.diagram.editparts
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram
-
-@Singleton class DiagramEditPart extends diagram.editparts.DiagramEditPart {
-
- @Inject aspects.impl.diagram.editparts.DiagramEditPart aspectDiagramEditPart;
-
- //BEGIN: PapyrusGenCode
- //patches the super type of the diagram edit part in case the controlled object represents a UML element
- override extendsList(GenDiagram it) '''extends «aspectDiagramEditPart.extendsListContents(it)»'''
- //END: PapyrusGenCode
-}
+/**
+ * Copyright (c) 2006, 2010, 2013 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
+ * Michael Golubev (Montages) - #386838 - migrate to Xtend2
+ */
+package aspects.diagram.editparts
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenDiagram
+
+@Singleton class DiagramEditPart extends diagram.editparts.DiagramEditPart {
+
+ @Inject aspects.impl.diagram.editparts.DiagramEditPart aspectDiagramEditPart;
+
+ //BEGIN: PapyrusGenCode
+ //patches the super type of the diagram edit part in case the controlled object represents a UML element
+ override extendsList(GenDiagram it) '''extends «aspectDiagramEditPart.extendsListContents(it)»'''
+ //END: PapyrusGenCode
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/LinkEditPart.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/LinkEditPart.xtend
index 173e2c4de0a..5875e8c2c64 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/LinkEditPart.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/LinkEditPart.xtend
@@ -1,30 +1,30 @@
-/**
- * Copyright (c) 2006, 2009, 2013 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
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.diagram.editparts
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenLink
-
-@Singleton class LinkEditPart extends diagram.editparts.LinkEditPart {
- @Inject aspects.impl.diagram.editparts.LinkEditPart aspectsLinkEditPart;
-
-
-
-//BEGIN: PapyrusGenCode
-//patches the super type of the link edit part in case the controlled object represents a UML element
-override extendsList(GenLink it) '''extends «aspectsLinkEditPart.extendsListContents(it)»'''
-//END: PapyrusGenCode
-
-}
+/**
+ * Copyright (c) 2006, 2009, 2013 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
+ * Michael Golubev (Montages) - #386838 - migrate to Xtend2
+ */
+package aspects.diagram.editparts
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenLink
+
+@Singleton class LinkEditPart extends diagram.editparts.LinkEditPart {
+ @Inject aspects.impl.diagram.editparts.LinkEditPart aspectsLinkEditPart;
+
+
+
+//BEGIN: PapyrusGenCode
+//patches the super type of the link edit part in case the controlled object represents a UML element
+override extendsList(GenLink it) '''extends «aspectsLinkEditPart.extendsListContents(it)»'''
+//END: PapyrusGenCode
+
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/NodeEditPart.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/NodeEditPart.xtend
index 05fa1024b41..d79b500c2ae 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/NodeEditPart.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/NodeEditPart.xtend
@@ -1,112 +1,112 @@
-/**
- * Copyright (c) 2006, 2009, 2013 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
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.diagram.editparts
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenNode
-import xpt.Common
-import xpt.diagram.editparts.Utils_qvto
-
-//DOCUMENTATION: PapyrusGenCode
-//add call template in order to generate handlenotification in order to refresh figure by taking account event
-
-@Singleton class NodeEditPart extends diagram.editparts.NodeEditPart {
- @Inject extension Common;
- @Inject extension Utils_qvto;
-
- @Inject impl.diagram.editparts.NodeEditPart xptNodeEditPartImpl;
- @Inject aspects.impl.diagram.editparts.NodeEditPart aspectsNodeEditPartImpl;
-
-
-
- override Main(GenNode it) '''
- «copyright(diagram.editorGen)»
- package «xptNodeEditPartImpl.packageName(it)»;
-
- «generatedClassComment»
- public class «xptNodeEditPartImpl.className(it)» «extendsList(it)» «implementsList(it)» {
-
- «attributes(it)»
-
- «xptNodeEditPartImpl.constructor(it)»
-
- «createDefaultEditPolicies(it)»
-
- «xptNodeEditPartImpl.createLayoutEditPolicy(it)»
-
-««« BEGIN: PapyrusGenCode
-««« call tamplate to paste code for refresh figure by taking account event
- «aspectsNodeEditPartImpl.specificHandleNotificationEvent(it)»
-««« END: PapyrusGenCode
-
- «xptNodeEditPartImpl.createNodeShape(it.viewmap, it)»
-
- «IF hasFixedChildren(it)»
- «xptNodeEditPartImpl.addFixedChild(it)»
-
- «xptNodeEditPartImpl.removeFixedChild(it)»
-
- «xptNodeEditPartImpl.addChildVisual(it)»
-
- «xptNodeEditPartImpl.removeChildVisual(it)»
-
- «xptNodeEditPartImpl.getContentPaneFor(it)»
- «ENDIF»
-
- «xptNodeEditPartImpl.addBorderItem(it)»
-
- «xptNodeEditPartImpl.createNodePlate(it)»
-
- «xptNodeEditPartImpl.getPrimaryDragEditPolicy(it)»
-
- «xptNodeEditPartImpl.createFigure(it)»
-
- «xptNodeEditPartImpl.setupContentPane(it)»
-
- «xptNodeEditPartImpl.getContentPane(it)»
-
- «xptNodeEditPartImpl.setForegroundColor(it)»
-
-««« «xptNodeEditPartImpl.setBackgroundColor(it)»
-
- «xptNodeEditPartImpl.setLineWidth(it)»
-
- «xptNodeEditPartImpl.setLineStyle(it)»
-
- «xptNodeEditPartImpl.getPrimaryChildEditPart(it)»
-
-
-
- «IF hasChildrenInListCompartments(it)»
- «xptNodeEditPartImpl.getTargetEditPartMethod(it)»
- «ENDIF»
-
- «handleNotificationEvent(it)»
-
- «xptNodeEditPartImpl.innerClassDeclaration(viewmap)»
-
- «additions(it)»
- }
- '''
-
- //BEGIN: PapyrusGenCode
- //patches the super type of the node edit part in case the controlled object represents a UML element
- override extendsList (GenNode it)''' extends «aspectsNodeEditPartImpl.extendsListContents(it)»'''
- //END: PapyrusGenCode
-
- // override additions(GenNode it) '''
- // «aspectsNodeEditPartImpl.genPreferredValue(it)»
- // '''
+/**
+ * Copyright (c) 2006, 2009, 2013 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
+ * Michael Golubev (Montages) - #386838 - migrate to Xtend2
+ */
+package aspects.diagram.editparts
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenNode
+import xpt.Common
+import xpt.diagram.editparts.Utils_qvto
+
+//DOCUMENTATION: PapyrusGenCode
+//add call template in order to generate handlenotification in order to refresh figure by taking account event
+
+@Singleton class NodeEditPart extends diagram.editparts.NodeEditPart {
+ @Inject extension Common;
+ @Inject extension Utils_qvto;
+
+ @Inject impl.diagram.editparts.NodeEditPart xptNodeEditPartImpl;
+ @Inject aspects.impl.diagram.editparts.NodeEditPart aspectsNodeEditPartImpl;
+
+
+
+ override Main(GenNode it) '''
+ «copyright(diagram.editorGen)»
+ package «xptNodeEditPartImpl.packageName(it)»;
+
+ «generatedClassComment»
+ public class «xptNodeEditPartImpl.className(it)» «extendsList(it)» «implementsList(it)» {
+
+ «attributes(it)»
+
+ «xptNodeEditPartImpl.constructor(it)»
+
+ «createDefaultEditPolicies(it)»
+
+ «xptNodeEditPartImpl.createLayoutEditPolicy(it)»
+
+««« BEGIN: PapyrusGenCode
+««« call tamplate to paste code for refresh figure by taking account event
+ «aspectsNodeEditPartImpl.specificHandleNotificationEvent(it)»
+««« END: PapyrusGenCode
+
+ «xptNodeEditPartImpl.createNodeShape(it.viewmap, it)»
+
+ «IF hasFixedChildren(it)»
+ «xptNodeEditPartImpl.addFixedChild(it)»
+
+ «xptNodeEditPartImpl.removeFixedChild(it)»
+
+ «xptNodeEditPartImpl.addChildVisual(it)»
+
+ «xptNodeEditPartImpl.removeChildVisual(it)»
+
+ «xptNodeEditPartImpl.getContentPaneFor(it)»
+ «ENDIF»
+
+ «xptNodeEditPartImpl.addBorderItem(it)»
+
+ «xptNodeEditPartImpl.createNodePlate(it)»
+
+ «xptNodeEditPartImpl.getPrimaryDragEditPolicy(it)»
+
+ «xptNodeEditPartImpl.createFigure(it)»
+
+ «xptNodeEditPartImpl.setupContentPane(it)»
+
+ «xptNodeEditPartImpl.getContentPane(it)»
+
+ «xptNodeEditPartImpl.setForegroundColor(it)»
+
+««« «xptNodeEditPartImpl.setBackgroundColor(it)»
+
+ «xptNodeEditPartImpl.setLineWidth(it)»
+
+ «xptNodeEditPartImpl.setLineStyle(it)»
+
+ «xptNodeEditPartImpl.getPrimaryChildEditPart(it)»
+
+
+
+ «IF hasChildrenInListCompartments(it)»
+ «xptNodeEditPartImpl.getTargetEditPartMethod(it)»
+ «ENDIF»
+
+ «handleNotificationEvent(it)»
+
+ «xptNodeEditPartImpl.innerClassDeclaration(viewmap)»
+
+ «additions(it)»
+ }
+ '''
+
+ //BEGIN: PapyrusGenCode
+ //patches the super type of the node edit part in case the controlled object represents a UML element
+ override extendsList (GenNode it)''' extends «aspectsNodeEditPartImpl.extendsListContents(it)»'''
+ //END: PapyrusGenCode
+
+ // override additions(GenNode it) '''
+ // «aspectsNodeEditPartImpl.genPreferredValue(it)»
+ // '''
} \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/NodeLabelEditPart.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/NodeLabelEditPart.xtend
index 0c009a414db..effa52d178c 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/NodeLabelEditPart.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/diagram/editparts/NodeLabelEditPart.xtend
@@ -11,13 +11,13 @@
* Alexander Shatalin (Borland) - initial API and implementation
* Michael Golubev (Montages) - #386838 - migrate to Xtend2
*/
-package aspects.diagram.editparts
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenNodeLabel
-import xpt.Common
-
+package aspects.diagram.editparts
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenNodeLabel
+import xpt.Common
+
//DOCUMENTATION: PapyrusGenCode
//add in the addition codes in order to refresh the labels
@Singleton class NodeLabelEditPart extends diagram.editparts.NodeLabelEditPart {
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/ChoiceUtils_qvto.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/ChoiceUtils_qvto.xtend
index 1febbf759e9..38e0ccecec7 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/ChoiceUtils_qvto.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/ChoiceUtils_qvto.xtend
@@ -9,25 +9,25 @@
* Contributors:
* Svyatoslav Kovalsky (Montages) - initial API and implementation
* Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.impl.diagram.editparts
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.LabelModelFacet
-import org.eclipse.gmf.codegen.gmfgen.OclChoiceParser
-import org.eclipse.gmf.codegen.gmfgen.PredefinedEnumParser
-import xpt.Common_qvto
-
-@Singleton class ChoiceUtils_qvto extends impl.diagram.editparts.ChoiceUtils_qvto {
- @Inject extension Common_qvto
-
- override boolean isChoiceLabel(LabelModelFacet modelFacet) {
- var parser = modelFacet.parser;
- if (parser != null) {
- return parser.oclIsKindOf(typeof(PredefinedEnumParser)) || parser.oclIsKindOf(typeof(OclChoiceParser));
- } else {
- return false;
- }
- }
-}
+ */
+package aspects.impl.diagram.editparts
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.LabelModelFacet
+import org.eclipse.gmf.codegen.gmfgen.OclChoiceParser
+import org.eclipse.gmf.codegen.gmfgen.PredefinedEnumParser
+import xpt.Common_qvto
+
+@Singleton class ChoiceUtils_qvto extends impl.diagram.editparts.ChoiceUtils_qvto {
+ @Inject extension Common_qvto
+
+ override boolean isChoiceLabel(LabelModelFacet modelFacet) {
+ var parser = modelFacet.parser;
+ if (parser != null) {
+ return parser.oclIsKindOf(typeof(PredefinedEnumParser)) || parser.oclIsKindOf(typeof(OclChoiceParser));
+ } else {
+ return false;
+ }
+ }
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/ExternalNodeLabelEditPart.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/ExternalNodeLabelEditPart.xtend
index f6b5f6168ce..a2dec74c795 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/ExternalNodeLabelEditPart.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/ExternalNodeLabelEditPart.xtend
@@ -1,30 +1,30 @@
-/*****************************************************************************
- * Copyright (c) 2014 CEA LIST 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-
-package aspects.impl.diagram.editparts
-
-import org.eclipse.gmf.codegen.gmfgen.GenExternalNodeLabel
-
-/**
- * @author Mickael ADAM
- *
- */
-class ExternalNodeLabelEditPart extends impl.diagram.editparts.ExternalNodeLabelEditPart {
-
- override additionalEditPolicies(GenExternalNodeLabel it){
- '''
- installEditPolicy(org.eclipse.gef.EditPolicy.PRIMARY_DRAG_ROLE, new org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.ExternalLabelPrimaryDragRoleEditPolicy());
- '''
- }
-
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST 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:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package aspects.impl.diagram.editparts
+
+import org.eclipse.gmf.codegen.gmfgen.GenExternalNodeLabel
+
+/**
+ * @author Mickael ADAM
+ *
+ */
+class ExternalNodeLabelEditPart extends impl.diagram.editparts.ExternalNodeLabelEditPart {
+
+ override additionalEditPolicies(GenExternalNodeLabel it){
+ '''
+ installEditPolicy(org.eclipse.gef.EditPolicy.PRIMARY_DRAG_ROLE, new org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.ExternalLabelPrimaryDragRoleEditPolicy());
+ '''
+ }
+
} \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/LinkEditPart.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/LinkEditPart.xtend
index a5e0e466ad2..5fd8ade4588 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/LinkEditPart.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/LinkEditPart.xtend
@@ -12,15 +12,15 @@
* Michael Golubev (Montages) - #386838 - migrate to Xtend2
* Remi Schnekenburger (CEA LIST) - modification for Papyrus MDT
*/
-package aspects.impl.diagram.editparts
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenLink
-import org.eclipse.gmf.codegen.gmfgen.ModeledViewmap
-import org.eclipse.papyrus.papyrusgmfgenextension.ExtendedGenView
-import xpt.Common
-
+package aspects.impl.diagram.editparts
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenLink
+import org.eclipse.gmf.codegen.gmfgen.ModeledViewmap
+import org.eclipse.papyrus.papyrusgmfgenextension.ExtendedGenView
+import xpt.Common
+
/**
* Revisit: [MG]: @Inject extension same-named-api-class -> template extends api-class?
*/
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/NodeLabelEditPart.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/NodeLabelEditPart.xtend
index 2f07a0b25ff..5e0d1cb8524 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/NodeLabelEditPart.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/editparts/NodeLabelEditPart.xtend
@@ -13,15 +13,15 @@
* Thibault Landre (Atos Origin) - initial API and implementation
* Benoit Maggi (CEA LIST) -#510281 change dependency to replace gmft-runtime
*/
-package aspects.impl.diagram.editparts
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenNodeLabel
-import xpt.diagram.editparts.Common
+package aspects.impl.diagram.editparts
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenNodeLabel
+import xpt.diagram.editparts.Common
import xpt.diagram.editparts.Utils_qvto
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram
-
+import org.eclipse.gmf.codegen.gmfgen.GenDiagram
+
@Singleton class NodeLabelEditPart extends impl.diagram.editparts.NodeLabelEditPart {
@Inject extension Utils_qvto;
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/update/CanonicalUpdate.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/update/CanonicalUpdate.xtend
index ee25e102f69..6e4fe0a5516 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/update/CanonicalUpdate.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/update/CanonicalUpdate.xtend
@@ -10,72 +10,72 @@
* Alexander Shatalin (Borland) - initial API and implementation
* Artem Tikhomirov - refactoring of containerBaseCanonicalMethods.xpt; extraction of API/non-API of CEP templates
* Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.impl.diagram.update
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import metamodel.MetaModel
-import org.eclipse.gmf.codegen.gmfgen.GenContainerBase
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram
-import xpt.Common
-import xpt.diagram.updater.DiagramUpdater
-import xpt.diagram.updater.NodeDescriptor
-import xpt.diagram.updater.Utils_qvto
-import xpt.diagram.updater.LinkDescriptor
-import xpt.editor.VisualIDRegistry
-
-@Singleton class CanonicalUpdate extends impl.diagram.update.CanonicalUpdate {
- @Inject extension Common;
- @Inject extension Utils_qvto;
-
- @Inject NodeDescriptor nodeDescriptor;
- @Inject MetaModel xptMetaModel;
- @Inject DiagramUpdater xptDiagramUpdater;
- @Inject LinkDescriptor linkDescriptor;
- @Inject VisualIDRegistry xptVisualIDRegistry;
-
- override def getFeaturesToSynchronizeMethod(GenContainerBase it) '''
- «IF getSemanticChildrenChildFeatures(it).size == 1»
+ */
+package aspects.impl.diagram.update
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import metamodel.MetaModel
+import org.eclipse.gmf.codegen.gmfgen.GenContainerBase
+import org.eclipse.gmf.codegen.gmfgen.GenDiagram
+import xpt.Common
+import xpt.diagram.updater.DiagramUpdater
+import xpt.diagram.updater.NodeDescriptor
+import xpt.diagram.updater.Utils_qvto
+import xpt.diagram.updater.LinkDescriptor
+import xpt.editor.VisualIDRegistry
+
+@Singleton class CanonicalUpdate extends impl.diagram.update.CanonicalUpdate {
+ @Inject extension Common;
+ @Inject extension Utils_qvto;
+
+ @Inject NodeDescriptor nodeDescriptor;
+ @Inject MetaModel xptMetaModel;
+ @Inject DiagramUpdater xptDiagramUpdater;
+ @Inject LinkDescriptor linkDescriptor;
+ @Inject VisualIDRegistry xptVisualIDRegistry;
+
+ override def getFeaturesToSynchronizeMethod(GenContainerBase it) '''
+ «IF getSemanticChildrenChildFeatures(it).size == 1»
«generatedMemberComment»
protected org.eclipse.emf.ecore.EStructuralFeature getFeatureToSynchronize() {
return «xptMetaModel.MetaFeature(getSemanticChildrenContainmentFeatures(it).head)»;
}
- «ELSEIF getSemanticChildrenChildFeatures(it).size > 1»
+ «ELSEIF getSemanticChildrenChildFeatures(it).size > 1»
«generatedMemberComment»
protected java.util.Set<org.eclipse.emf.ecore.EStructuralFeature> getFeaturesToSynchronize() {
if (myFeaturesToSynchronize == null) {
myFeaturesToSynchronize = new java.util.HashSet<org.eclipse.emf.ecore.EStructuralFeature>();
- «FOR f : getSemanticChildrenContainmentFeatures(it)»
+ «FOR f : getSemanticChildrenContainmentFeatures(it)»
«addContainmentFeature(f)»
- «ENDFOR»
+ «ENDFOR»
}
return myFeaturesToSynchronize;
}
- «ENDIF»
- '''
-
- override def getSemanticChildrenListMethod(GenContainerBase it) '''
+ «ENDIF»
+ '''
+
+ override def getSemanticChildrenListMethod(GenContainerBase it) '''
«generatedMemberComment»
protected java.util.List<org.eclipse.emf.ecore.EObject> getSemanticChildrenList() {
- «IF hasSemanticChildren(it)/*REVISIT: is there real need for this check - Generator seems to consult needsCanonicalEP, which in turns ensures there are semantic children?*/»
+ «IF hasSemanticChildren(it)/*REVISIT: is there real need for this check - Generator seems to consult needsCanonicalEP, which in turns ensures there are semantic children?*/»
org.eclipse.gmf.runtime.notation.View viewObject = (org.eclipse.gmf.runtime.notation.View) getHost().getModel();
java.util.LinkedList<org.eclipse.emf.ecore.EObject> result = new java.util.LinkedList<org.eclipse.emf.ecore.EObject>();
- java.util.List<«nodeDescriptor.qualifiedClassName(it.diagram.editorGen.diagramUpdater)»> childDescriptors = «xptDiagramUpdater.
+ java.util.List<«nodeDescriptor.qualifiedClassName(it.diagram.editorGen.diagramUpdater)»> childDescriptors = «xptDiagramUpdater.
getSemanticChildrenMethodCall(it)»(viewObject);
for («nodeDescriptor.qualifiedClassName(it.diagram.editorGen.diagramUpdater)» d : childDescriptors) {
result.add(d.getModelElement());
}
return result;
- «ELSE»
+ «ELSE»
return java.util.Collections.EMPTY_LIST;
- «ENDIF»
+ «ENDIF»
}
- '''
-
- override def refreshConnectionsBody(GenDiagram it) '''
+ '''
+
+ override def refreshConnectionsBody(GenDiagram it) '''
«Domain2Notation(it)» domain2NotationMap = new «Domain2Notation(it)»();
java.util.Collection<«linkDescriptor.qualifiedClassName(editorGen.diagramUpdater)»> linkDescriptors = collectAllLinks(getDiagram(), domain2NotationMap);
java.util.List<org.eclipse.gmf.runtime.notation.View> edges = new java.util.ArrayList<org.eclipse.gmf.runtime.notation.View>();
@@ -110,16 +110,16 @@ import xpt.editor.VisualIDRegistry
}
deleteViews(existingLinks.iterator());
return createConnections(linkDescriptors, domain2NotationMap);
- '''
-
+ '''
+
override def collectAllLinksMethod(GenDiagram it) '''
«generatedMemberComment»
- private java.util.Collection<«linkDescriptor.qualifiedClassName(it.editorGen.diagramUpdater)»> collectAllLinks(org.eclipse.gmf.runtime.notation.View view, «Domain2Notation(
+ private java.util.Collection<«linkDescriptor.qualifiedClassName(it.editorGen.diagramUpdater)»> collectAllLinks(org.eclipse.gmf.runtime.notation.View view, «Domain2Notation(
it)» domain2NotationMap) {
if (!«VisualIDRegistry::modelID(it)».equals(«xptVisualIDRegistry.getModelIDMethodCall(it)»(view))) {
return java.util.Collections.emptyList();
}
- java.util.LinkedList<«linkDescriptor.qualifiedClassName(it.editorGen.diagramUpdater)»> result = new java.util.LinkedList<«linkDescriptor.
+ java.util.LinkedList<«linkDescriptor.qualifiedClassName(it.editorGen.diagramUpdater)»> result = new java.util.LinkedList<«linkDescriptor.
qualifiedClassName(it.editorGen.diagramUpdater)»>();
String vid = «xptVisualIDRegistry.getVisualIDMethodCall(it)»(view);
if (vid != null) {
@@ -137,7 +137,7 @@ import xpt.editor.VisualIDRegistry
}
return result;
}
- '''
+ '''
override getEditPartMethod(GenDiagram it) '''
«generatedMemberComment»
@@ -160,4 +160,4 @@ import xpt.editor.VisualIDRegistry
return null;
}
'''
-}
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/preferences/StandardPage.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/preferences/StandardPage.xtend
index 0fbf120333e..f934212e028 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/preferences/StandardPage.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/preferences/StandardPage.xtend
@@ -10,17 +10,17 @@
* Dmitry Stadnik (Borland) - initial API and implementation
* Michael Golubev (Montages) - #386838 - migrate to Xtend2
*/
-package aspects.impl.preferences
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenStandardPreferencePage
-import org.eclipse.gmf.codegen.gmfgen.StandardPreferencePages
-import xpt.Common
-
+package aspects.impl.preferences
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenStandardPreferencePage
+import org.eclipse.gmf.codegen.gmfgen.StandardPreferencePages
+import xpt.Common
+
//DOCUMENTATION: PapyrusGencode
//change the superclass and the initialization
-
+
@Singleton class StandardPage extends impl.preferences.StandardPage {
@Inject extension Common;
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/metamodel/Facility.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/metamodel/Facility.xtend
index 4e5660ab15e..7d9127b2272 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/metamodel/Facility.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/metamodel/Facility.xtend
@@ -1,12 +1,12 @@
-package aspects.metamodel;
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import metamodel.Facility_qvto
-import org.eclipse.emf.codegen.ecore.genmodel.GenPackage
-import org.eclipse.gmf.codegen.gmfgen.DynamicModelAccess
-import xpt.Common
-
+package aspects.metamodel;
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import metamodel.Facility_qvto
+import org.eclipse.emf.codegen.ecore.genmodel.GenPackage
+import org.eclipse.gmf.codegen.gmfgen.DynamicModelAccess
+import xpt.Common
+
@Singleton class Facility extends metamodel.Facility {
@Inject extension Common;
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/metamodel/MetaModel.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/metamodel/MetaModel.xtend
index 3b327283dfa..6c597db0afb 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/metamodel/MetaModel.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/metamodel/MetaModel.xtend
@@ -1,16 +1,16 @@
-package aspects.metamodel
-
-import org.eclipse.emf.codegen.ecore.genmodel.GenClass
-import org.eclipse.emf.codegen.ecore.genmodel.GenFeature
-import com.google.inject.Inject
-import metamodel.MetaModel_qvto
-import com.google.inject.Singleton
-
-@Singleton class MetaModel extends metamodel.MetaModel {
-
- @Inject extension MetaModel_qvto;
-
- override DeclareAndAssign2(GenClass it, String assignee, String src, GenClass srcMetaClass, GenFeature srcFeature, String srcExt, boolean needCast) //
- '''«getQualifiedInterfaceName(it)» «assignee» = «getFeatureValue(srcFeature, src, srcMetaClass)».«srcExt»;'''
-
+package aspects.metamodel
+
+import org.eclipse.emf.codegen.ecore.genmodel.GenClass
+import org.eclipse.emf.codegen.ecore.genmodel.GenFeature
+import com.google.inject.Inject
+import metamodel.MetaModel_qvto
+import com.google.inject.Singleton
+
+@Singleton class MetaModel extends metamodel.MetaModel {
+
+ @Inject extension MetaModel_qvto;
+
+ override DeclareAndAssign2(GenClass it, String assignee, String src, GenClass srcMetaClass, GenFeature srcFeature, String srcExt, boolean needCast) //
+ '''«getQualifiedInterfaceName(it)» «assignee» = «getFeatureValue(srcFeature, src, srcMetaClass)».«srcExt»;'''
+
} \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/parsers/PredefinedParser.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/parsers/PredefinedParser.xtend
index 3f2f6eb88b0..881e7e7edf0 100755
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/parsers/PredefinedParser.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/parsers/PredefinedParser.xtend
@@ -1,65 +1,65 @@
-/*****************************************************************************
- * Copyright (c) 2017 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:
- * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
+/*****************************************************************************
+ * Copyright (c) 2017 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:
+ * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
* Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905
- * Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Bug 464625
- *****************************************************************************/
-package aspects.parsers
-
-import com.google.inject.Singleton
-
-@Singleton class PredefinedParser extends parsers.PredefinedParser{
-
- override def extendsList(org.eclipse.gmf.codegen.gmfgen.PredefinedParser it) //
+ * Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Bug 464625
+ *****************************************************************************/
+package aspects.parsers
+
+import com.google.inject.Singleton
+
+@Singleton class PredefinedParser extends parsers.PredefinedParser{
+
+ override def extendsList(org.eclipse.gmf.codegen.gmfgen.PredefinedParser it) //
'''extends org.eclipse.papyrus.infra.gmfdiag.common.parsers.AbstractElementTypeBasedAttributeParser'''
-
- override def additions(org.eclipse.gmf.codegen.gmfgen.PredefinedParser it) //
- '''
- /**
- * @generated
- * {@inheritDoc}
- * @see org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.parsers.AbstractFeatureParser#getModificationCommand(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.lang.Object)
- */
- @Override
- protected org.eclipse.gmf.runtime.common.core.command.ICommand getModificationCommand(final org.eclipse.emf.ecore.EObject element, final org.eclipse.emf.ecore.EStructuralFeature feature, final Object value) {
- org.eclipse.gmf.runtime.common.core.command.ICommand result = null;
-
- // If the feature to edit is the name, check that this is not really the internationalization to edit and not the name
- if (feature.equals(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getNamedElement_Name())) {
- if (org.eclipse.papyrus.infra.internationalization.common.utils.InternationalizationPreferencesUtils.getInternationalizationPreference(element) && null != org.eclipse.papyrus.uml.internationalization.utils.utils.UMLLabelInternationalization.getInstance().getLabelWithoutUML((org.eclipse.uml2.uml.NamedElement) element)) {
- final org.eclipse.papyrus.infra.core.resource.ModelSet modelSet = (org.eclipse.papyrus.infra.core.resource.ModelSet) element.eResource().getResourceSet();
- if (null != modelSet) {
- result = new org.eclipse.papyrus.infra.emf.gmf.command.EMFtoGMFCommandWrapper(UMLLabelInternationalization.getInstance().getSetLabelCommand(modelSet.getTransactionalEditingDomain(), (org.eclipse.uml2.uml.NamedElement) element, (String) value, null));
- }
- }
- }
-
- return null != result ? result : super.getModificationCommand(element, feature, value);
- }
-
- /**
- * @generated
- * {@inheritDoc}
- * @see org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.parsers.AbstractAttributeParser#getValue(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature)
- */
- @Override
- protected Object getValue(final org.eclipse.emf.ecore.EObject element, final org.eclipse.emf.ecore.EStructuralFeature feature) {
- Object result = null;
-
- if(element instanceof org.eclipse.uml2.uml.NamedElement && feature.equals(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getNamedElement_Name())){
- if (org.eclipse.papyrus.infra.internationalization.common.utils.InternationalizationPreferencesUtils.getInternationalizationPreference(element) && null != org.eclipse.papyrus.uml.internationalization.utils.utils.UMLLabelInternationalization.getInstance().getLabelWithoutUML((org.eclipse.uml2.uml.NamedElement)element)) {
- result = UMLLabelInternationalization.getInstance().getLabelWithoutUML((org.eclipse.uml2.uml.NamedElement)element);
- }
- }
-
- return null != result ? result : super.getValue(element, feature);
- }
- '''
+
+ override def additions(org.eclipse.gmf.codegen.gmfgen.PredefinedParser it) //
+ '''
+ /**
+ * @generated
+ * {@inheritDoc}
+ * @see org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.parsers.AbstractFeatureParser#getModificationCommand(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.lang.Object)
+ */
+ @Override
+ protected org.eclipse.gmf.runtime.common.core.command.ICommand getModificationCommand(final org.eclipse.emf.ecore.EObject element, final org.eclipse.emf.ecore.EStructuralFeature feature, final Object value) {
+ org.eclipse.gmf.runtime.common.core.command.ICommand result = null;
+
+ // If the feature to edit is the name, check that this is not really the internationalization to edit and not the name
+ if (feature.equals(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getNamedElement_Name())) {
+ if (org.eclipse.papyrus.infra.internationalization.common.utils.InternationalizationPreferencesUtils.getInternationalizationPreference(element) && null != org.eclipse.papyrus.uml.internationalization.utils.utils.UMLLabelInternationalization.getInstance().getLabelWithoutUML((org.eclipse.uml2.uml.NamedElement) element)) {
+ final org.eclipse.papyrus.infra.core.resource.ModelSet modelSet = (org.eclipse.papyrus.infra.core.resource.ModelSet) element.eResource().getResourceSet();
+ if (null != modelSet) {
+ result = new org.eclipse.papyrus.infra.emf.gmf.command.EMFtoGMFCommandWrapper(UMLLabelInternationalization.getInstance().getSetLabelCommand(modelSet.getTransactionalEditingDomain(), (org.eclipse.uml2.uml.NamedElement) element, (String) value, null));
+ }
+ }
+ }
+
+ return null != result ? result : super.getModificationCommand(element, feature, value);
+ }
+
+ /**
+ * @generated
+ * {@inheritDoc}
+ * @see org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.parsers.AbstractAttributeParser#getValue(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature)
+ */
+ @Override
+ protected Object getValue(final org.eclipse.emf.ecore.EObject element, final org.eclipse.emf.ecore.EStructuralFeature feature) {
+ Object result = null;
+
+ if(element instanceof org.eclipse.uml2.uml.NamedElement && feature.equals(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getNamedElement_Name())){
+ if (org.eclipse.papyrus.infra.internationalization.common.utils.InternationalizationPreferencesUtils.getInternationalizationPreference(element) && null != org.eclipse.papyrus.uml.internationalization.utils.utils.UMLLabelInternationalization.getInstance().getLabelWithoutUML((org.eclipse.uml2.uml.NamedElement)element)) {
+ result = UMLLabelInternationalization.getInstance().getLabelWithoutUML((org.eclipse.uml2.uml.NamedElement)element);
+ }
+ }
+
+ return null != result ? result : super.getValue(element, feature);
+ }
+ '''
}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/CodeStyle.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/CodeStyle.xtend
index ec09d45079a..7b56ab74a76 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/CodeStyle.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/CodeStyle.xtend
@@ -1,12 +1,12 @@
-package aspects.xpt
-
-import org.eclipse.gmf.codegen.gmfgen.GenCommonBase
-import com.google.inject.Singleton
-
-@Singleton class CodeStyle extends xpt.CodeStyle {
-
- override overrideI(GenCommonBase xptSelf) '''
- @Override
- '''
-
+package aspects.xpt
+
+import org.eclipse.gmf.codegen.gmfgen.GenCommonBase
+import com.google.inject.Singleton
+
+@Singleton class CodeStyle extends xpt.CodeStyle {
+
+ override overrideI(GenCommonBase xptSelf) '''
+ @Override
+ '''
+
} \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/commands/CreateLinkUtils.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/commands/CreateLinkUtils.xtend
index 708ff2267fb..3017f6719d9 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/commands/CreateLinkUtils.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/commands/CreateLinkUtils.xtend
@@ -1,82 +1,82 @@
-/**
- * Copyright (c) 2007-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) - #386838 - migrate to Xtend2
- */
-package aspects.xpt.diagram.commands
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import metamodel.MetaModel
-import org.eclipse.gmf.codegen.gmfgen.LinkModelFacet
-import org.eclipse.gmf.codegen.gmfgen.TypeLinkModelFacet
-import xpt.Common
-import xpt.diagram.Utils_qvto
-
-@Singleton class CreateLinkUtils extends xpt.diagram.commands.CreateLinkUtils {
- @Inject extension Common;
- @Inject extension Utils_qvto;
-
- @Inject MetaModel xptMetaModel;
-
-
- /**
- * Fields of command that creates link.
- */
- override dispatch fields(LinkModelFacet it) '''
- «extraLineBreak»
- «generatedMemberComment()»
- protected final org.eclipse.emf.ecore.EObject source;
-
- «generatedMemberComment()»
- protected final org.eclipse.emf.ecore.EObject target;
- '''
-
- override dispatch fields(TypeLinkModelFacet it) '''
- «extraLineBreak»
- «generatedMemberComment()»
- protected final org.eclipse.emf.ecore.EObject source;
-
- «generatedMemberComment()»
- protected final org.eclipse.emf.ecore.EObject target;
- «IF hasContainerOtherThanSource(it)»
-
- «generatedMemberComment()»
- protected «xptMetaModel.QualifiedClassName(it.containmentMetaFeature.genClass)» container;
- «ENDIF»
- '''
-
- override dispatch containerAccessor(TypeLinkModelFacet it) '''
- «IF hasContainerOtherThanSource(it)»
-
- «generatedMemberComment()»
- public «xptMetaModel.QualifiedClassName(it.containmentMetaFeature.genClass)» getContainer() {
- return container;
- }
-
- «generatedMemberComment(
- 'Default approach is to traverse ancestors of the source to find instance of container.\n' + 'Modify with appropriate logic.'
- )»
- protected «xptMetaModel.QualifiedClassName(it.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 («xptMetaModel.IsInstance(containmentMetaFeature.genClass, 'element')») {
- return «xptMetaModel.CastEObject(it.containmentMetaFeature.genClass, 'element')»;
- }
- }
- return null;
- }
- «ENDIF»
-
- '''
-
-}
+/**
+ * Copyright (c) 2007-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) - #386838 - migrate to Xtend2
+ */
+package aspects.xpt.diagram.commands
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import metamodel.MetaModel
+import org.eclipse.gmf.codegen.gmfgen.LinkModelFacet
+import org.eclipse.gmf.codegen.gmfgen.TypeLinkModelFacet
+import xpt.Common
+import xpt.diagram.Utils_qvto
+
+@Singleton class CreateLinkUtils extends xpt.diagram.commands.CreateLinkUtils {
+ @Inject extension Common;
+ @Inject extension Utils_qvto;
+
+ @Inject MetaModel xptMetaModel;
+
+
+ /**
+ * Fields of command that creates link.
+ */
+ override dispatch fields(LinkModelFacet it) '''
+ «extraLineBreak»
+ «generatedMemberComment()»
+ protected final org.eclipse.emf.ecore.EObject source;
+
+ «generatedMemberComment()»
+ protected final org.eclipse.emf.ecore.EObject target;
+ '''
+
+ override dispatch fields(TypeLinkModelFacet it) '''
+ «extraLineBreak»
+ «generatedMemberComment()»
+ protected final org.eclipse.emf.ecore.EObject source;
+
+ «generatedMemberComment()»
+ protected final org.eclipse.emf.ecore.EObject target;
+ «IF hasContainerOtherThanSource(it)»
+
+ «generatedMemberComment()»
+ protected «xptMetaModel.QualifiedClassName(it.containmentMetaFeature.genClass)» container;
+ «ENDIF»
+ '''
+
+ override dispatch containerAccessor(TypeLinkModelFacet it) '''
+ «IF hasContainerOtherThanSource(it)»
+
+ «generatedMemberComment()»
+ public «xptMetaModel.QualifiedClassName(it.containmentMetaFeature.genClass)» getContainer() {
+ return container;
+ }
+
+ «generatedMemberComment(
+ 'Default approach is to traverse ancestors of the source to find instance of container.\n' + 'Modify with appropriate logic.'
+ )»
+ protected «xptMetaModel.QualifiedClassName(it.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 («xptMetaModel.IsInstance(containmentMetaFeature.genClass, 'element')») {
+ return «xptMetaModel.CastEObject(it.containmentMetaFeature.genClass, 'element')»;
+ }
+ }
+ return null;
+ }
+ «ENDIF»
+
+ '''
+
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/commands/ReorientLinkUtils.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/commands/ReorientLinkUtils.xtend
index a50891a8806..acc4f6bfbf4 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/commands/ReorientLinkUtils.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/commands/ReorientLinkUtils.xtend
@@ -1,65 +1,65 @@
-package aspects.xpt.diagram.commands
-
-import org.eclipse.gmf.codegen.gmfgen.LinkModelFacet
-import org.eclipse.gmf.codegen.gmfgen.GenLink
-import xpt.Common
-import com.google.inject.Inject
-import com.google.inject.Singleton
-
-@Singleton class ReorientLinkUtils extends xpt.diagram.commands.ReorientLinkUtils {
-
- @Inject extension Common
-
- override canReorient(LinkModelFacet it, GenLink link) '''
- «generatedMemberComment()»
- public boolean canExecute() {
- «checkLinkValidity(it)»
- if (reorientDirection == org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest.REORIENT_SOURCE) {
- return canReorientSource();
- }
- if (reorientDirection == org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest.REORIENT_TARGET) {
- return canReorientTarget();
- }
- return false;
- }
-
- «generatedMemberComment()»
- protected boolean canReorientSource() {
- «checkSourceRequestValidity(it, link)»
- }
-
- «generatedMemberComment()»
- protected boolean canReorientTarget() {
- «checkTargetRequestValidity(it, link)»
- }
- '''
-
- override reorient(LinkModelFacet it) '''
-
- «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 {
- if (!canExecute()) {
- throw new org.eclipse.core.commands.ExecutionException("Invalid arguments in reorient link command"); «nonNLS()»
- }
- if (reorientDirection == org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest.REORIENT_SOURCE) {
- return reorientSource();
- }
- if (reorientDirection == org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest.REORIENT_TARGET) {
- return reorientTarget();
- }
- throw new IllegalStateException();
- }
-
- «generatedMemberComment()»
- protected org.eclipse.gmf.runtime.common.core.command.CommandResult reorientSource() throws org.eclipse.core.commands.ExecutionException {
- «reorientSource(it)»
- }
-
- «generatedMemberComment()»
- protected org.eclipse.gmf.runtime.common.core.command.CommandResult reorientTarget() throws org.eclipse.core.commands.ExecutionException {
- «reorientTarget(it)»
- }
- '''
+package aspects.xpt.diagram.commands
+
+import org.eclipse.gmf.codegen.gmfgen.LinkModelFacet
+import org.eclipse.gmf.codegen.gmfgen.GenLink
+import xpt.Common
+import com.google.inject.Inject
+import com.google.inject.Singleton
+
+@Singleton class ReorientLinkUtils extends xpt.diagram.commands.ReorientLinkUtils {
+
+ @Inject extension Common
+
+ override canReorient(LinkModelFacet it, GenLink link) '''
+ «generatedMemberComment()»
+ public boolean canExecute() {
+ «checkLinkValidity(it)»
+ if (reorientDirection == org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest.REORIENT_SOURCE) {
+ return canReorientSource();
+ }
+ if (reorientDirection == org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest.REORIENT_TARGET) {
+ return canReorientTarget();
+ }
+ return false;
+ }
+
+ «generatedMemberComment()»
+ protected boolean canReorientSource() {
+ «checkSourceRequestValidity(it, link)»
+ }
+
+ «generatedMemberComment()»
+ protected boolean canReorientTarget() {
+ «checkTargetRequestValidity(it, link)»
+ }
+ '''
+
+ override reorient(LinkModelFacet it) '''
+
+ «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 {
+ if (!canExecute()) {
+ throw new org.eclipse.core.commands.ExecutionException("Invalid arguments in reorient link command"); «nonNLS()»
+ }
+ if (reorientDirection == org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest.REORIENT_SOURCE) {
+ return reorientSource();
+ }
+ if (reorientDirection == org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest.REORIENT_TARGET) {
+ return reorientTarget();
+ }
+ throw new IllegalStateException();
+ }
+
+ «generatedMemberComment()»
+ protected org.eclipse.gmf.runtime.common.core.command.CommandResult reorientSource() throws org.eclipse.core.commands.ExecutionException {
+ «reorientSource(it)»
+ }
+
+ «generatedMemberComment()»
+ protected org.eclipse.gmf.runtime.common.core.command.CommandResult reorientTarget() throws org.eclipse.core.commands.ExecutionException {
+ «reorientTarget(it)»
+ }
+ '''
} \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/edithelpers/BaseEditHelper.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/edithelpers/BaseEditHelper.xtend
index acca2aae353..491519a8f33 100755
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/edithelpers/BaseEditHelper.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/edithelpers/BaseEditHelper.xtend
@@ -1,25 +1,25 @@
-/*****************************************************************************
- * Copyright (c) 2017 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:
- * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
- *****************************************************************************/
-package aspects.xpt.diagram.edithelpers;
-
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram
-
-public class BaseEditHelper extends xpt.diagram.edithelpers.BaseEditHelper {
-
- override superClass(GenDiagram it) '''org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.helpers.GeneratedEditHelperBase'''
-
- override def editPolicyCommandConstant(GenDiagram it) '''org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.helpers.GeneratedEditHelperBase.EDIT_POLICY_COMMAND'''
-
- override def contextElementTypeConstant(GenDiagram it) '''org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.helpers.GeneratedEditHelperBase.CONTEXT_ELEMENT_TYPE'''
-
-
-}
+/*****************************************************************************
+ * Copyright (c) 2017 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:
+ * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package aspects.xpt.diagram.edithelpers;
+
+import org.eclipse.gmf.codegen.gmfgen.GenDiagram
+
+public class BaseEditHelper extends xpt.diagram.edithelpers.BaseEditHelper {
+
+ override superClass(GenDiagram it) '''org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.helpers.GeneratedEditHelperBase'''
+
+ override def editPolicyCommandConstant(GenDiagram it) '''org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.helpers.GeneratedEditHelperBase.EDIT_POLICY_COMMAND'''
+
+ override def contextElementTypeConstant(GenDiagram it) '''org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.helpers.GeneratedEditHelperBase.CONTEXT_ELEMENT_TYPE'''
+
+
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/edithelpers/EditHelper.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/edithelpers/EditHelper.xtend
index f36f1bcdd10..59987137756 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/edithelpers/EditHelper.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/edithelpers/EditHelper.xtend
@@ -1,37 +1,37 @@
-/**
- * Copyright (c) 2006-2013 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) - #386838 - migrate to Xtend2
- */
-package aspects.xpt.diagram.edithelpers;
-
-import com.google.inject.Inject
-import org.eclipse.gmf.codegen.gmfgen.MetamodelType
-import utils.EditHelperUtils_qvto
-import xpt.Common
-
-public class EditHelper extends xpt.diagram.edithelpers.EditHelper {
- @Inject extension Common;
- @Inject extension EditHelperUtils_qvto
-
-
-
-
- override EditHelper(MetamodelType it) '''
- «copyright(diagramElement.diagram.editorGen)»
- package «packageName(it)»;
-
- «generatedClassComment»
- public class «editHelperClassName» extends «getBaseEditHelperFullName(diagramElement.getDiagram())» {
- «additions(it)»
- }
- '''
-
-}
+/**
+ * Copyright (c) 2006-2013 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) - #386838 - migrate to Xtend2
+ */
+package aspects.xpt.diagram.edithelpers;
+
+import com.google.inject.Inject
+import org.eclipse.gmf.codegen.gmfgen.MetamodelType
+import utils.EditHelperUtils_qvto
+import xpt.Common
+
+public class EditHelper extends xpt.diagram.edithelpers.EditHelper {
+ @Inject extension Common;
+ @Inject extension EditHelperUtils_qvto
+
+
+
+
+ override EditHelper(MetamodelType it) '''
+ «copyright(diagramElement.diagram.editorGen)»
+ package «packageName(it)»;
+
+ «generatedClassComment»
+ public class «editHelperClassName» extends «getBaseEditHelperFullName(diagramElement.getDiagram())» {
+ «additions(it)»
+ }
+ '''
+
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editparts/Common.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editparts/Common.xtend
index ebc76f94010..992cfd621c7 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editparts/Common.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editparts/Common.xtend
@@ -1,58 +1,58 @@
-/**
- * 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
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- * Patrick Tessier (CEA LIST)
- */
-package aspects.xpt.diagram.editparts
-
-import aspects.xpt.QualifiedClassNameProvider
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenCommonBase
-import org.eclipse.gmf.codegen.gmfgen.GenContainerBase
-
-//Documentation: PapyrusGenCode
-//This template has been modified in order to remove canonical ediPolicies
-
-@Singleton class Common extends xpt.diagram.editparts.Common {
- @Inject extension aspects.xpt.Common;
-
- @Inject QualifiedClassNameProvider qualifiedClassNameProvider;
-
- override installCanonicalEditPolicy(GenContainerBase it) '''
- «IF it.needsCanonicalEditPolicy»
- ««« BEGIN: PapyrusGenCode
- ««« Used to remove at each time canonical editpolicies
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new «getCanonicalEditPolicyQualifiedClassName()»());
- ««« END: PapyrusGenCode
-
- «ENDIF»
- '''
-
- override creationEditPolicyNewInstance(GenCommonBase it)
- '''new org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultCreationEditPolicy()'''
-
-
- override installSemanticEditPolicy(GenCommonBase it) '''
- «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 «qualifiedClassNameProvider.getItemSemanticEditPolicyQualifiedClassName(it)»());
- «ENDIF»
- '''
-
- override def visualIDConstant(GenCommonBase it) '''
- «generatedMemberComment»
- public static final String VISUAL_ID = "«stringVisualID»";
- '''
-
+/**
+ * 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
+ * Michael Golubev (Montages) - #386838 - migrate to Xtend2
+ * Patrick Tessier (CEA LIST)
+ */
+package aspects.xpt.diagram.editparts
+
+import aspects.xpt.QualifiedClassNameProvider
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenCommonBase
+import org.eclipse.gmf.codegen.gmfgen.GenContainerBase
+
+//Documentation: PapyrusGenCode
+//This template has been modified in order to remove canonical ediPolicies
+
+@Singleton class Common extends xpt.diagram.editparts.Common {
+ @Inject extension aspects.xpt.Common;
+
+ @Inject QualifiedClassNameProvider qualifiedClassNameProvider;
+
+ override installCanonicalEditPolicy(GenContainerBase it) '''
+ «IF it.needsCanonicalEditPolicy»
+ ««« BEGIN: PapyrusGenCode
+ ««« Used to remove at each time canonical editpolicies
+ //in Papyrus diagrams are not strongly synchronised
+ //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new «getCanonicalEditPolicyQualifiedClassName()»());
+ ««« END: PapyrusGenCode
+
+ «ENDIF»
+ '''
+
+ override creationEditPolicyNewInstance(GenCommonBase it)
+ '''new org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultCreationEditPolicy()'''
+
+
+ override installSemanticEditPolicy(GenCommonBase it) '''
+ «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 «qualifiedClassNameProvider.getItemSemanticEditPolicyQualifiedClassName(it)»());
+ «ENDIF»
+ '''
+
+ override def visualIDConstant(GenCommonBase it) '''
+ «generatedMemberComment»
+ public static final String VISUAL_ID = "«stringVisualID»";
+ '''
+
} \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editparts/EditPartFactory.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editparts/EditPartFactory.xtend
index 99ab5af1993..4d9935befe9 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editparts/EditPartFactory.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editparts/EditPartFactory.xtend
@@ -1,75 +1,75 @@
-/**
- * Copyright (c) 2006, 2010, 2013 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) - #386838 - migrate to Xtend2
- */
-package aspects.xpt.diagram.editparts
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram
-
-//DOCUMENTATION: PapyrusGencode
-//change to manage the figure of the comment
-@Singleton class EditPartFactory extends xpt.diagram.editparts.EditPartFactory {
-
- @Inject extension xpt.Common;
-
-
- override getTextCellEditorLocator(GenDiagram it) '''
- «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.papyrus.infra.gmfdiag.tooling.runtime.directedit.locator.CellEditorLocatorAccess.INSTANCE.getTextCellEditorLocator(source);
-
- }
- }
-
-
- «generatedClassComment»
- static private class MultilineCellEditorLocator implements org.eclipse.gef.tools.CellEditorLocator {
-
- «generatedClassComment»
- private org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure multilineEditableFigure;
-
- «generatedClassComment»
- public MultilineCellEditorLocator(org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure figure) {
- this.multilineEditableFigure = figure;
- }
-
- «generatedClassComment»
- public org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure getMultilineEditableFigure() {
- return multilineEditableFigure;
- }
-
- «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,
- org.eclipse.swt.SWT.DEFAULT)));
- }
- if (!rect.equals(new org.eclipse.draw2d.geometry.Rectangle(text.getBounds()))) {
- text.setBounds(rect.x, rect.y, rect.width, rect.height);
- }
- }
- }
- '''
-
-}
+/**
+ * Copyright (c) 2006, 2010, 2013 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) - #386838 - migrate to Xtend2
+ */
+package aspects.xpt.diagram.editparts
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenDiagram
+
+//DOCUMENTATION: PapyrusGencode
+//change to manage the figure of the comment
+@Singleton class EditPartFactory extends xpt.diagram.editparts.EditPartFactory {
+
+ @Inject extension xpt.Common;
+
+
+ override getTextCellEditorLocator(GenDiagram it) '''
+ «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.papyrus.infra.gmfdiag.tooling.runtime.directedit.locator.CellEditorLocatorAccess.INSTANCE.getTextCellEditorLocator(source);
+
+ }
+ }
+
+
+ «generatedClassComment»
+ static private class MultilineCellEditorLocator implements org.eclipse.gef.tools.CellEditorLocator {
+
+ «generatedClassComment»
+ private org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure multilineEditableFigure;
+
+ «generatedClassComment»
+ public MultilineCellEditorLocator(org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure figure) {
+ this.multilineEditableFigure = figure;
+ }
+
+ «generatedClassComment»
+ public org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure getMultilineEditableFigure() {
+ return multilineEditableFigure;
+ }
+
+ «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,
+ org.eclipse.swt.SWT.DEFAULT)));
+ }
+ if (!rect.equals(new org.eclipse.draw2d.geometry.Rectangle(text.getBounds()))) {
+ text.setBounds(rect.x, rect.y, rect.width, rect.height);
+ }
+ }
+ }
+ '''
+
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/CompartmentItemSemanticEditPolicy.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/CompartmentItemSemanticEditPolicy.xtend
index 237da6a0154..846bc041d6e 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/CompartmentItemSemanticEditPolicy.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/CompartmentItemSemanticEditPolicy.xtend
@@ -10,20 +10,20 @@
* Alexander Shatalin (Borland) - initial API and implementation
* Michael Golubev (Montages) - #386838 - migrate to Xtend2
*/
-package aspects.xpt.diagram.editpolicies
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import metamodel.MetaModel
-import org.eclipse.emf.common.util.EList
-import org.eclipse.gmf.codegen.gmfgen.GenChildNode
-import org.eclipse.gmf.codegen.gmfgen.GenCompartment
-import org.eclipse.gmf.codegen.gmfgen.GenNode
-import org.eclipse.gmf.codegen.gmfgen.TypeModelFacet
-import org.eclipse.papyrus.papyrusgmfgenextension.ConstrainedByReferenceCompartmentItemSemanticEditPolicy
-import xpt.Common
-import xpt.diagram.editpolicies.childContainerCreateCommand
-
+package aspects.xpt.diagram.editpolicies
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import metamodel.MetaModel
+import org.eclipse.emf.common.util.EList
+import org.eclipse.gmf.codegen.gmfgen.GenChildNode
+import org.eclipse.gmf.codegen.gmfgen.GenCompartment
+import org.eclipse.gmf.codegen.gmfgen.GenNode
+import org.eclipse.gmf.codegen.gmfgen.TypeModelFacet
+import org.eclipse.papyrus.papyrusgmfgenextension.ConstrainedByReferenceCompartmentItemSemanticEditPolicy
+import xpt.Common
+import xpt.diagram.editpolicies.childContainerCreateCommand
+
@Singleton class CompartmentItemSemanticEditPolicy extends xpt.diagram.editpolicies.CompartmentItemSemanticEditPolicy {
@Inject extension Common;
@Inject extension MetaModel
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/DiagramItemSemanticEditPolicy.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/DiagramItemSemanticEditPolicy.xtend
index 037fcbdaa0f..70e7cd045fd 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/DiagramItemSemanticEditPolicy.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/DiagramItemSemanticEditPolicy.xtend
@@ -1,20 +1,20 @@
-/**
- * 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
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.xpt.diagram.editpolicies
-
-import com.google.inject.Singleton
-
-@Singleton class DiagramItemSemanticEditPolicy extends xpt.diagram.editpolicies.DiagramItemSemanticEditPolicy {
-
-
+/**
+ * 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
+ * Michael Golubev (Montages) - #386838 - migrate to Xtend2
+ */
+package aspects.xpt.diagram.editpolicies
+
+import com.google.inject.Singleton
+
+@Singleton class DiagramItemSemanticEditPolicy extends xpt.diagram.editpolicies.DiagramItemSemanticEditPolicy {
+
+
} \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/LinkItemSemanticEditPolicy.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/LinkItemSemanticEditPolicy.xtend
index 7e62ee0e930..6e90c98ed11 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/LinkItemSemanticEditPolicy.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/LinkItemSemanticEditPolicy.xtend
@@ -1,54 +1,54 @@
-/**
- * Copyright (c) 2007-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:
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Borland) - [243151] explicit source/target for links
- * - #386838 - migrate to Xtend2
- * Vincent Lorenzo (CEA-LIST)
- */
-package aspects.xpt.diagram.editpolicies
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import impl.diagram.commands.DeleteLinkCommand
-import org.eclipse.gmf.codegen.gmfgen.GenLink
-import org.eclipse.gmf.codegen.gmfgen.TypeLinkModelFacet
-import org.eclipse.papyrus.papyrusgmfgenextension.EditPartUsingDeleteService
-import utils.UtilsItemSemanticEditPolicy
-import xpt.Common
-
-@Singleton class LinkItemSemanticEditPolicy extends xpt.diagram.editpolicies.LinkItemSemanticEditPolicy {
- @Inject extension Common;
- @Inject extension DeleteLinkCommand
- @Inject extension UtilsItemSemanticEditPolicy
-
- override dispatch getDestroySemanticCommand(TypeLinkModelFacet it, GenLink genLink) '''
- ««« Test to know which delete command should be used in the generated code : "Traditional Delete Command" or the Delete Service
-
- «IF it.eResource.allContents.filter(typeof (EditPartUsingDeleteService)).filter[v | v.genView.contains(genLink)].size !=0 »
-
- «generatedMemberComment»
- «getDestroyElementCommandByService(it)»
- «ELSE»
- «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.infra.emf.gmf.command.EMFtoGMFCommandWrapper(new org.eclipse.emf.edit.command.DeleteCommand(getEditingDomain(),todestroy )));
- return getGEFWrapper(cmd.reduce());
- //return getGEFWrapper(«newDeleteLinkWithClassCommand(it,genLink, 'req')»);
- }
- «ENDIF»
- '''
-
-
-}
+/**
+ * Copyright (c) 2007-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:
+ * Alexander Shatalin (Borland) - initial API and implementation
+ * Michael Golubev (Borland) - [243151] explicit source/target for links
+ * - #386838 - migrate to Xtend2
+ * Vincent Lorenzo (CEA-LIST)
+ */
+package aspects.xpt.diagram.editpolicies
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import impl.diagram.commands.DeleteLinkCommand
+import org.eclipse.gmf.codegen.gmfgen.GenLink
+import org.eclipse.gmf.codegen.gmfgen.TypeLinkModelFacet
+import org.eclipse.papyrus.papyrusgmfgenextension.EditPartUsingDeleteService
+import utils.UtilsItemSemanticEditPolicy
+import xpt.Common
+
+@Singleton class LinkItemSemanticEditPolicy extends xpt.diagram.editpolicies.LinkItemSemanticEditPolicy {
+ @Inject extension Common;
+ @Inject extension DeleteLinkCommand
+ @Inject extension UtilsItemSemanticEditPolicy
+
+ override dispatch getDestroySemanticCommand(TypeLinkModelFacet it, GenLink genLink) '''
+ ««« Test to know which delete command should be used in the generated code : "Traditional Delete Command" or the Delete Service
+
+ «IF it.eResource.allContents.filter(typeof (EditPartUsingDeleteService)).filter[v | v.genView.contains(genLink)].size !=0 »
+
+ «generatedMemberComment»
+ «getDestroyElementCommandByService(it)»
+ «ELSE»
+ «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.infra.emf.gmf.command.EMFtoGMFCommandWrapper(new org.eclipse.emf.edit.command.DeleteCommand(getEditingDomain(),todestroy )));
+ return getGEFWrapper(cmd.reduce());
+ //return getGEFWrapper(«newDeleteLinkWithClassCommand(it,genLink, 'req')»);
+ }
+ «ENDIF»
+ '''
+
+
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/NodeItemSemanticEditPolicy.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/NodeItemSemanticEditPolicy.xtend
index 5da4736c1e6..793aa38e235 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/NodeItemSemanticEditPolicy.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/NodeItemSemanticEditPolicy.xtend
@@ -1,253 +1,253 @@
-/**
- * Copyright (c) 2007-2013 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
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.xpt.diagram.editpolicies
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import java.util.List
-import org.eclipse.gmf.codegen.gmfgen.FeatureLinkModelFacet
-import org.eclipse.gmf.codegen.gmfgen.GenChildNode
-import org.eclipse.gmf.codegen.gmfgen.GenNode
-import org.eclipse.gmf.codegen.gmfgen.TypeLinkModelFacet
-import org.eclipse.papyrus.papyrusgmfgenextension.EditPartUsingDeleteService
-import utils.UtilsItemSemanticEditPolicy
-import xpt.Common
-import xpt.diagram.editpolicies.childContainerCreateCommand
-import xpt.editor.VisualIDRegistry
-
-/**
- * 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.
- */
-@Singleton class NodeItemSemanticEditPolicy extends xpt.diagram.editpolicies.NodeItemSemanticEditPolicy {
-
- @Inject extension Common;
- @Inject extension xpt.diagram.editpolicies.Utils_qvto;
- @Inject extension UtilsItemSemanticEditPolicy
-
-
- @Inject BaseItemSemanticEditPolicy xptBaseItemSemanticEditPolicy;
- @Inject childContainerCreateCommand xptChildContainerCreateCommand;
- @Inject linkCommands xptLinkCommands;
- @Inject VisualIDRegistry xptVisualIDRegistry;
-
-
-
- override NodeItemSemanticEditPolicy(GenNode it) '''
- «copyright(getDiagram().editorGen)»
- package «packageName(it)»;
-
- «generatedClassComment()»
- public class «className(it)» extends «xptBaseItemSemanticEditPolicy.qualifiedClassName(getDiagram())» {
-
- «xptBaseItemSemanticEditPolicy.defaultConstructor(it)»
-
- «xptChildContainerCreateCommand.childContainerCreateCommand(it.childNodes)»
-
- ««« Papyrus REM :
- ««« Test to know how the delete of this EditPart is done : we used the DeleteService or the "Traditional method"
-
- «IF it.eResource.allContents.filter(typeof (EditPartUsingDeleteService)).filter[v | v.genView.contains(it)].size != 0»
- «generatedMemberComment»
- «getDestroyElementCommandByService(it)»
- «ELSE»
- «getDestroyElementCommand(it)»
- «IF hasChildrenOrCompartments(it)»
- «addDestroyChildNodesCommand(it)»
- «ENDIF»
- «ENDIF»
-
- «xptLinkCommands.linkCommands(it)»
-
- «additions(it)»
- }
- '''
-
- override getDestroyElementCommand(GenNode it) '''
- «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);
- ««« «destroyEdges('view')»
- org.eclipse.emf.ecore.EAnnotation annotation = view.getEAnnotation("Shortcut");«nonNLS»
- if (annotation == null) {
- // there are indirectly referenced children, need extra commands: «it.childNodes.union(compartments.map(c | c.childNodes).flatten).exists[GenChildNode gcn | !isDirectlyOwned(gcn, it)]»
- «IF hasChildrenOrCompartments(it)»
- 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.infra.emf.gmf.command.EMFtoGMFCommandWrapper(new org.eclipse.emf.edit.command.DeleteCommand(getEditingDomain(),todestroy )));
- } else {«««Here, we may play smart and don't generate else for non-toplevel nodes(which can't be shortcuts). Is it worth doing?
- cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), view));
- }
- return getGEFWrapper(cmd.reduce());
-}
- '''
-
- override addDestroyChildNodesCommand(GenNode it) '''
- «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 (java.util.Iterator<?> nit = view.getChildren().iterator(); nit.hasNext();) {
- org.eclipse.gmf.runtime.notation.Node node = (org.eclipse.gmf.runtime.notation.Node) nit.next();
- String vid = «xptVisualIDRegistry.getVisualIDMethodCall(it.diagram)»(node);
- if (vid != null) {
- switch (vid) {
- «FOR cn : it.childNodes»
- «destroyChildNodes(cn, 'node', it)»
- «ENDFOR»
- «FOR compartment : it.compartments»
- «xptVisualIDRegistry.caseVisualID(compartment)»
- for (java.util.Iterator<?> cit = node.getChildren().iterator(); cit.hasNext();) {
- org.eclipse.gmf.runtime.notation.Node cnode = (org.eclipse.gmf.runtime.notation.Node) cit.next();
- String cvid = «xptVisualIDRegistry.getVisualIDMethodCall(it.diagram)»(cnode);
- if (cvid != null) {
- switch (cvid) {
- «FOR cn : compartment.childNodes»
- «destroyChildNodes(cn, 'cnode', it)»
- «ENDFOR»
- }
- }
- }
- break;
- «ENDFOR»
- }
- }
- }
- }
- '''
-
-
- /**
- * @param view - Notation element for the passed node
- * assumes 'cmd' to point to composite command
- */
- override destroyEdges(GenNode it, String view) '''
-
-««« 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)
-
-
-«««// 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-»
-
-
-«IF !genIncomingLinks.isEmpty()»
- for (java.util.Iterator<?> it = «view».getTargetEdges().iterator(); it.hasNext();) {
- org.eclipse.gmf.runtime.notation.Edge incomingLink = (org.eclipse.gmf.runtime.notation.Edge) it.next();
- String vid = «xptVisualIDRegistry.getVisualIDMethodCall(getDiagram())»(incomingLink);
- if (vid != null) {
- switch(vid) {
-«IF !genIncomingLinks.filter[l | l.modelFacet instanceof FeatureLinkModelFacet].empty»
-«FOR il : genIncomingLinks.filter[l | l.modelFacet instanceof FeatureLinkModelFacet]»
- case «VisualIDRegistry.visualID(il)»:
-«ENDFOR»
- 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.filter[l | l.modelFacet instanceof TypeLinkModelFacet].empty»
-«FOR il : genIncomingLinks.filter[l | l.modelFacet instanceof TypeLinkModelFacet]»
- case «VisualIDRegistry.visualID(il)»:
-«ENDFOR»
- 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.isEmpty()»
- for (java.util.Iterator<?> it = «view».getSourceEdges().iterator(); it.hasNext();) {
- org.eclipse.gmf.runtime.notation.Edge outgoingLink = (org.eclipse.gmf.runtime.notation.Edge) it.next();
- String vid = «xptVisualIDRegistry.getVisualIDMethodCall(getDiagram())»(outgoingLink);
- if (vid != null) {
- switch(vid) {
-«IF !genOutgoingLinks.filter[l | l.modelFacet instanceof FeatureLinkModelFacet].empty»
-«FOR ol : genOutgoingLinks.filter[l | l.modelFacet instanceof FeatureLinkModelFacet]»
- case «VisualIDRegistry.visualID(ol)»:
-«ENDFOR»
- 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.filter[l | l.modelFacet instanceof TypeLinkModelFacet].empty»
-«FOR ol : genOutgoingLinks.filter[l | l.modelFacet instanceof TypeLinkModelFacet]»
- case «VisualIDRegistry.visualID(ol)»:
-«ENDFOR»
- 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»
- '''
-
-
-
- private def static <T> Iterable<T> union(Iterable<? extends T> listA, Iterable<? extends T> listB) {
- var List<T> result = newLinkedList();
- result.addAll(listA);
- result.addAll(listB);
- return result;
- }
-
-}
+/**
+ * Copyright (c) 2007-2013 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
+ * Michael Golubev (Montages) - #386838 - migrate to Xtend2
+ */
+package aspects.xpt.diagram.editpolicies
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import java.util.List
+import org.eclipse.gmf.codegen.gmfgen.FeatureLinkModelFacet
+import org.eclipse.gmf.codegen.gmfgen.GenChildNode
+import org.eclipse.gmf.codegen.gmfgen.GenNode
+import org.eclipse.gmf.codegen.gmfgen.TypeLinkModelFacet
+import org.eclipse.papyrus.papyrusgmfgenextension.EditPartUsingDeleteService
+import utils.UtilsItemSemanticEditPolicy
+import xpt.Common
+import xpt.diagram.editpolicies.childContainerCreateCommand
+import xpt.editor.VisualIDRegistry
+
+/**
+ * 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.
+ */
+@Singleton class NodeItemSemanticEditPolicy extends xpt.diagram.editpolicies.NodeItemSemanticEditPolicy {
+
+ @Inject extension Common;
+ @Inject extension xpt.diagram.editpolicies.Utils_qvto;
+ @Inject extension UtilsItemSemanticEditPolicy
+
+
+ @Inject BaseItemSemanticEditPolicy xptBaseItemSemanticEditPolicy;
+ @Inject childContainerCreateCommand xptChildContainerCreateCommand;
+ @Inject linkCommands xptLinkCommands;
+ @Inject VisualIDRegistry xptVisualIDRegistry;
+
+
+
+ override NodeItemSemanticEditPolicy(GenNode it) '''
+ «copyright(getDiagram().editorGen)»
+ package «packageName(it)»;
+
+ «generatedClassComment()»
+ public class «className(it)» extends «xptBaseItemSemanticEditPolicy.qualifiedClassName(getDiagram())» {
+
+ «xptBaseItemSemanticEditPolicy.defaultConstructor(it)»
+
+ «xptChildContainerCreateCommand.childContainerCreateCommand(it.childNodes)»
+
+ ««« Papyrus REM :
+ ««« Test to know how the delete of this EditPart is done : we used the DeleteService or the "Traditional method"
+
+ «IF it.eResource.allContents.filter(typeof (EditPartUsingDeleteService)).filter[v | v.genView.contains(it)].size != 0»
+ «generatedMemberComment»
+ «getDestroyElementCommandByService(it)»
+ «ELSE»
+ «getDestroyElementCommand(it)»
+ «IF hasChildrenOrCompartments(it)»
+ «addDestroyChildNodesCommand(it)»
+ «ENDIF»
+ «ENDIF»
+
+ «xptLinkCommands.linkCommands(it)»
+
+ «additions(it)»
+ }
+ '''
+
+ override getDestroyElementCommand(GenNode it) '''
+ «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);
+ ««« «destroyEdges('view')»
+ org.eclipse.emf.ecore.EAnnotation annotation = view.getEAnnotation("Shortcut");«nonNLS»
+ if (annotation == null) {
+ // there are indirectly referenced children, need extra commands: «it.childNodes.union(compartments.map(c | c.childNodes).flatten).exists[GenChildNode gcn | !isDirectlyOwned(gcn, it)]»
+ «IF hasChildrenOrCompartments(it)»
+ 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.infra.emf.gmf.command.EMFtoGMFCommandWrapper(new org.eclipse.emf.edit.command.DeleteCommand(getEditingDomain(),todestroy )));
+ } else {«««Here, we may play smart and don't generate else for non-toplevel nodes(which can't be shortcuts). Is it worth doing?
+ cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+}
+ '''
+
+ override addDestroyChildNodesCommand(GenNode it) '''
+ «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 (java.util.Iterator<?> nit = view.getChildren().iterator(); nit.hasNext();) {
+ org.eclipse.gmf.runtime.notation.Node node = (org.eclipse.gmf.runtime.notation.Node) nit.next();
+ String vid = «xptVisualIDRegistry.getVisualIDMethodCall(it.diagram)»(node);
+ if (vid != null) {
+ switch (vid) {
+ «FOR cn : it.childNodes»
+ «destroyChildNodes(cn, 'node', it)»
+ «ENDFOR»
+ «FOR compartment : it.compartments»
+ «xptVisualIDRegistry.caseVisualID(compartment)»
+ for (java.util.Iterator<?> cit = node.getChildren().iterator(); cit.hasNext();) {
+ org.eclipse.gmf.runtime.notation.Node cnode = (org.eclipse.gmf.runtime.notation.Node) cit.next();
+ String cvid = «xptVisualIDRegistry.getVisualIDMethodCall(it.diagram)»(cnode);
+ if (cvid != null) {
+ switch (cvid) {
+ «FOR cn : compartment.childNodes»
+ «destroyChildNodes(cn, 'cnode', it)»
+ «ENDFOR»
+ }
+ }
+ }
+ break;
+ «ENDFOR»
+ }
+ }
+ }
+ }
+ '''
+
+
+ /**
+ * @param view - Notation element for the passed node
+ * assumes 'cmd' to point to composite command
+ */
+ override destroyEdges(GenNode it, String view) '''
+
+««« 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)
+
+
+«««// 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-»
+
+
+«IF !genIncomingLinks.isEmpty()»
+ for (java.util.Iterator<?> it = «view».getTargetEdges().iterator(); it.hasNext();) {
+ org.eclipse.gmf.runtime.notation.Edge incomingLink = (org.eclipse.gmf.runtime.notation.Edge) it.next();
+ String vid = «xptVisualIDRegistry.getVisualIDMethodCall(getDiagram())»(incomingLink);
+ if (vid != null) {
+ switch(vid) {
+«IF !genIncomingLinks.filter[l | l.modelFacet instanceof FeatureLinkModelFacet].empty»
+«FOR il : genIncomingLinks.filter[l | l.modelFacet instanceof FeatureLinkModelFacet]»
+ case «VisualIDRegistry.visualID(il)»:
+«ENDFOR»
+ 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.filter[l | l.modelFacet instanceof TypeLinkModelFacet].empty»
+«FOR il : genIncomingLinks.filter[l | l.modelFacet instanceof TypeLinkModelFacet]»
+ case «VisualIDRegistry.visualID(il)»:
+«ENDFOR»
+ 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.isEmpty()»
+ for (java.util.Iterator<?> it = «view».getSourceEdges().iterator(); it.hasNext();) {
+ org.eclipse.gmf.runtime.notation.Edge outgoingLink = (org.eclipse.gmf.runtime.notation.Edge) it.next();
+ String vid = «xptVisualIDRegistry.getVisualIDMethodCall(getDiagram())»(outgoingLink);
+ if (vid != null) {
+ switch(vid) {
+«IF !genOutgoingLinks.filter[l | l.modelFacet instanceof FeatureLinkModelFacet].empty»
+«FOR ol : genOutgoingLinks.filter[l | l.modelFacet instanceof FeatureLinkModelFacet]»
+ case «VisualIDRegistry.visualID(ol)»:
+«ENDFOR»
+ 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.filter[l | l.modelFacet instanceof TypeLinkModelFacet].empty»
+«FOR ol : genOutgoingLinks.filter[l | l.modelFacet instanceof TypeLinkModelFacet]»
+ case «VisualIDRegistry.visualID(ol)»:
+«ENDFOR»
+ 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»
+ '''
+
+
+
+ private def static <T> Iterable<T> union(Iterable<? extends T> listA, Iterable<? extends T> listB) {
+ var List<T> result = newLinkedList();
+ result.addAll(listA);
+ result.addAll(listB);
+ return result;
+ }
+
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/TextNonResizableEditPolicy.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/TextNonResizableEditPolicy.xtend
index e02ba0f64e6..2487fbd04ec 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/TextNonResizableEditPolicy.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/TextNonResizableEditPolicy.xtend
@@ -1,21 +1,21 @@
-/*****************************************************************************
- * Copyright (c) 2017 CEA LIST and other.
- *
- * 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:
- * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - #510281 change dependency to replace gmft-runtime
- *****************************************************************************/
-package aspects.xpt.diagram.editpolicies
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram
-import xpt.Common
-
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST and other.
+ *
+ * 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:
+ * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - #510281 change dependency to replace gmft-runtime
+ *****************************************************************************/
+package aspects.xpt.diagram.editpolicies
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenDiagram
+import xpt.Common
+
/**
* FIXME: [MG] - reverse the calls? call common code from here and TextelectionEP and not vice versa
*/
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/TextSelectionEditPolicy.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/TextSelectionEditPolicy.xtend
index 75567599f6c..f9eeda69216 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/TextSelectionEditPolicy.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/TextSelectionEditPolicy.xtend
@@ -1,56 +1,56 @@
-/*****************************************************************************
- * Copyright (c) 2017 CEA LIST and other.
- *
- * 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:
- * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - #510281 change dependency to replace gmft-runtime
- *****************************************************************************/
-package aspects.xpt.diagram.editpolicies
-
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram
-import com.google.inject.Inject
-import xpt.Common
-import com.google.inject.Singleton
-import xpt.CodeStyle
-
-@Singleton class TextSelectionEditPolicy extends xpt.diagram.editpolicies.TextSelectionEditPolicy {
-
- @Inject extension Common
- @Inject extension CodeStyle
-
- // rebranch to the tooling runtime in the release train.
- override TextSelectionEditPolicy_implementsClause(GenDiagram it) '''implements org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy'''
-
- override textFeedback_createFocusFeedbackFigure(GenDiagram it) '''
- «generatedMemberComment»
- protected org.eclipse.draw2d.IFigure createFocusFeedbackFigure() {
- return new org.eclipse.draw2d.Figure() {
-
- «overrideC»
- protected void paintFigure(org.eclipse.draw2d.Graphics graphics) {
- graphics.drawFocus(getBounds().getResized(-1, -1));
- }
- };
- }
- '''
-
- override textFeedback_getHostPositionListener(GenDiagram it) '''
- «generatedMemberComment»
- private org.eclipse.draw2d.FigureListener getHostPositionListener() {
- if (hostPositionListener == null) {
- hostPositionListener = new org.eclipse.draw2d.FigureListener() {
- «overrideI»
- public void figureMoved(org.eclipse.draw2d.IFigure source) {
- refreshFeedback();
- }
- };
- }
- return hostPositionListener;
- }
- '''
-
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST and other.
+ *
+ * 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:
+ * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - #510281 change dependency to replace gmft-runtime
+ *****************************************************************************/
+package aspects.xpt.diagram.editpolicies
+
+import org.eclipse.gmf.codegen.gmfgen.GenDiagram
+import com.google.inject.Inject
+import xpt.Common
+import com.google.inject.Singleton
+import xpt.CodeStyle
+
+@Singleton class TextSelectionEditPolicy extends xpt.diagram.editpolicies.TextSelectionEditPolicy {
+
+ @Inject extension Common
+ @Inject extension CodeStyle
+
+ // rebranch to the tooling runtime in the release train.
+ override TextSelectionEditPolicy_implementsClause(GenDiagram it) '''implements org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy'''
+
+ override textFeedback_createFocusFeedbackFigure(GenDiagram it) '''
+ «generatedMemberComment»
+ protected org.eclipse.draw2d.IFigure createFocusFeedbackFigure() {
+ return new org.eclipse.draw2d.Figure() {
+
+ «overrideC»
+ protected void paintFigure(org.eclipse.draw2d.Graphics graphics) {
+ graphics.drawFocus(getBounds().getResized(-1, -1));
+ }
+ };
+ }
+ '''
+
+ override textFeedback_getHostPositionListener(GenDiagram it) '''
+ «generatedMemberComment»
+ private org.eclipse.draw2d.FigureListener getHostPositionListener() {
+ if (hostPositionListener == null) {
+ hostPositionListener = new org.eclipse.draw2d.FigureListener() {
+ «overrideI»
+ public void figureMoved(org.eclipse.draw2d.IFigure source) {
+ refreshFeedback();
+ }
+ };
+ }
+ return hostPositionListener;
+ }
+ '''
+
} \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/Utils_qvto.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/Utils_qvto.xtend
index 50246d06683..4eb215bd4d6 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/Utils_qvto.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/Utils_qvto.xtend
@@ -11,11 +11,11 @@
* Michael Golubev (Borland) - [243151] explicit source/target for links
* - #386838 - migrate to Xtend2
*/
-package aspects.xpt.diagram.editpolicies
-
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenLinkEnd
-
+package aspects.xpt.diagram.editpolicies
+
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenLinkEnd
+
@Singleton class Utils_qvto extends xpt.diagram.editpolicies.Utils_qvto {
def Boolean containsCreateStartLinkCommand(GenLinkEnd it){
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/linkCommands.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/linkCommands.xtend
index 7141f4fb939..0b053d973f3 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/linkCommands.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/editpolicies/linkCommands.xtend
@@ -12,21 +12,21 @@
* Michael Golubev (Borland) - [243151] explicit source/target for links
* - #386838 - migrate to Xtend2
* Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- */
-package aspects.xpt.diagram.editpolicies
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenLink
-import org.eclipse.gmf.codegen.gmfgen.GenLinkEnd
-import org.eclipse.papyrus.papyrusgmfgenextension.EditPartUsingReorientService
-import org.eclipse.papyrus.papyrusgmfgenextension.GenerateUsingElementTypeCreationCommand
-import xpt.Common
-import xpt.diagram.commands.CreateLinkCommand
-import xpt.diagram.editpolicies.Utils_qvto
-import xpt.editor.VisualIDRegistry
-import xpt.providers.ElementTypes
-
+ */
+package aspects.xpt.diagram.editpolicies
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenLink
+import org.eclipse.gmf.codegen.gmfgen.GenLinkEnd
+import org.eclipse.papyrus.papyrusgmfgenextension.EditPartUsingReorientService
+import org.eclipse.papyrus.papyrusgmfgenextension.GenerateUsingElementTypeCreationCommand
+import xpt.Common
+import xpt.diagram.commands.CreateLinkCommand
+import xpt.diagram.editpolicies.Utils_qvto
+import xpt.editor.VisualIDRegistry
+import xpt.providers.ElementTypes
+
/**
* Start start of link creation.
* User click to this editpart and start dragging with link tool.
@@ -47,16 +47,16 @@ import xpt.providers.ElementTypes
* 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
*
-*/
-@Singleton class linkCommands extends xpt.diagram.editpolicies.linkCommands {
- @Inject extension Utils_qvto;
- @Inject extension Common;
+*/
+@Singleton class linkCommands extends xpt.diagram.editpolicies.linkCommands {
+ @Inject extension Utils_qvto;
+ @Inject extension Common;
- @Inject aspects.xpt.diagram.editpolicies.Utils_qvto aspectsUtils_qvto
+ @Inject aspects.xpt.diagram.editpolicies.Utils_qvto aspectsUtils_qvto
@Inject VisualIDRegistry xptVisualIDRegistry;
@Inject ElementTypes xptElementTypes;
- @Inject CreateLinkCommand xptCreateLinkCommand;
-
+ @Inject CreateLinkCommand xptCreateLinkCommand;
+
override createLinkCommands(GenLinkEnd it) '''
«IF it.eResource.allContents.filter(typeof (GenerateUsingElementTypeCreationCommand)).size <1»
@@ -133,11 +133,11 @@ import xpt.providers.ElementTypes
«ENDIF»
'''
-
+
// We overwrite the reorientTypeLinkCommands to manages the links which use the ReorientCommand provided by the EditService
- override reorientTypeLinkCommands(GenLinkEnd it) '''
- «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'
+ override reorientTypeLinkCommands(GenLinkEnd it) '''
+ «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) {
@@ -155,21 +155,21 @@ import xpt.providers.ElementTypes
}
return super.getReorientRelationshipCommand(req);
}
- '''
-
+ '''
+
//This function writes only : "case myLinkEditPart.VISUAL_ID:"
//for the link which uses the ReorientCommand provided by the EditService
- def reorientLinkCommandWithService(GenLink it) '''
- «IF it.eResource.allContents.filter(typeof(EditPartUsingReorientService)).filter[v| v.genView.contains(it)].size != 0»
+ def reorientLinkCommandWithService(GenLink it) '''
+ «IF it.eResource.allContents.filter(typeof(EditPartUsingReorientService)).filter[v| v.genView.contains(it)].size != 0»
«xptVisualIDRegistry.caseVisualID(it)»
- «ENDIF»
- '''
-
+ «ENDIF»
+ '''
+
// This function writes the code to call the ReorientCommand provided by the ReorientService
- def callReorientCommand(GenLinkEnd it) '''
+ def callReorientCommand(GenLinkEnd it) '''
«var rServiceNodes = it.eResource.allContents.filter(typeof (EditPartUsingReorientService))»
- «IF !rServiceNodes.empty»
- «IF !rServiceNodes.filter[rServiceNode|(!(rServiceNode.genView.filter[view|getReroutableTypeLinks(it).toList.contains(view)].empty))].empty»
+ «IF !rServiceNodes.empty»
+ «IF !rServiceNodes.filter[rServiceNode|(!(rServiceNode.genView.filter[view|getReroutableTypeLinks(it).toList.contains(view)].empty))].empty»
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;
@@ -180,15 +180,15 @@ import xpt.providers.ElementTypes
return org.eclipse.gef.commands.UnexecutableCommand.INSTANCE;
}
return getGEFWrapper(reorientCommand.reduce());
- «ENDIF»
- «ENDIF»
- '''
-
+ «ENDIF»
+ «ENDIF»
+ '''
+
// This function writes the code for the Links which uses their own ReorientCommand (the initial code)
- def reorientLinkCommandWithoutService(GenLink it) '''
- «IF it.eResource.allContents.filter(EditPartUsingReorientService).filter[v|v.genView.contains(it)].size == 0»
+ def reorientLinkCommandWithoutService(GenLink it) '''
+ «IF it.eResource.allContents.filter(EditPartUsingReorientService).filter[v|v.genView.contains(it)].size == 0»
«reorientLinkCommand(it)»
- «ENDIF»
- '''
-
-}
+ «ENDIF»
+ '''
+
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/preferences/PreferenceInitializer.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/preferences/PreferenceInitializer.xtend
index 5533f877c41..fcfd307dae9 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/preferences/PreferenceInitializer.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/preferences/PreferenceInitializer.xtend
@@ -11,7 +11,7 @@
* Michael Golubev (Montages) - #386838 - migrate to Xtend2
* Thibault Landre (Atos Origin) - initial API and implementation
* Patrick Tessier (CEA LIST)
- */
+ */
package aspects.xpt.diagram.preferences
import com.google.inject.Inject
@@ -19,9 +19,9 @@ import com.google.inject.Singleton
import plugin.Activator
import xpt.Common
-@Singleton class PreferenceInitializer extends xpt.diagram.preferences.PreferenceInitializer {
- @Inject extension Common;
-
- @Inject Activator xptActivator;
-
-}
+@Singleton class PreferenceInitializer extends xpt.diagram.preferences.PreferenceInitializer {
+ @Inject extension Common;
+
+ @Inject Activator xptActivator;
+
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/preferences/extensions.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/preferences/extensions.xtend
index 8bc5f544dd3..0e890118934 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/preferences/extensions.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/preferences/extensions.xtend
@@ -1,70 +1,70 @@
-/**
- * Copyright (c) 2007, 2010, 2013 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) - #386838 - migrate to Xtend2
- * Thibault Landre (Atos Origin) - initial API and implementation
- */
-package aspects.xpt.diagram.preferences
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram
-import org.eclipse.gmf.codegen.gmfgen.GenStandardPreferencePage
-import org.eclipse.gmf.codegen.gmfgen.StandardPreferencePages
-import utils.PrefsConstant_qvto
-import xpt.Common
-import xpt.diagram.Utils_qvto
-
-@Singleton class extensions extends xpt.diagram.preferences.extensions {
- @Inject extension Common;
- @Inject extension Utils_qvto;
- @Inject extension PrefsConstant_qvto;
-
- @Inject xpt.diagram.preferences.PreferenceInitializer xptPreferenceInitializer;
-
- override extensions(GenDiagram it) '''
-
- «tripleSpace(1)»<extension point="org.eclipse.core.runtime.preferences" id="prefs">
- «tripleSpace(2)»«xmlGeneratedTag»
- «tripleSpace(2)»<initializer class="«xptPreferenceInitializer.qualifiedClassName(it)»"/>
- «tripleSpace(1)»</extension>
-
- «IF ! it.preferencePages.empty»
- «tripleSpace(1)»<extension point="org.eclipse.ui.preferencePages" id="prefpages">
- «tripleSpace(2)»«xmlGeneratedTag»
- «FOR pref : allPreferencePages(it)»
- «IF pref instanceof GenStandardPreferencePage»
- «papyrusPreferencePage(pref as GenStandardPreferencePage)»
- «ENDIF»
- «ENDFOR»
- «tripleSpace(1)»</extension>
- «ENDIF»
- '''
-
- def papyrusPreferencePage(GenStandardPreferencePage it) '''
- «IF StandardPreferencePages.GENERAL_LITERAL == kind»
- <page
- id="«getDiagramPreferencePageCategory()».«getDiagram().editorGen.modelID»"
- name="«getDiagram().editorGen.modelID» Diagram"
- category="«getDiagramPreferencePageCategory()»"
- class="«getQualifiedClassName()»">
- </page>
- «ELSEIF StandardPreferencePages.PRINTING_LITERAL == kind ||
- StandardPreferencePages.RULERS_AND_GRID_LITERAL == kind»
- <page
- id="«getQualifiedClassName()»"
- name="%prefpage.«ID»"
- category="«getDiagramPreferencePageCategory()».«getDiagram().editorGen.modelID»"
- class="«getQualifiedClassName()»">
- </page>
- «ENDIF»
- '''
-
-}
+/**
+ * Copyright (c) 2007, 2010, 2013 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) - #386838 - migrate to Xtend2
+ * Thibault Landre (Atos Origin) - initial API and implementation
+ */
+package aspects.xpt.diagram.preferences
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenDiagram
+import org.eclipse.gmf.codegen.gmfgen.GenStandardPreferencePage
+import org.eclipse.gmf.codegen.gmfgen.StandardPreferencePages
+import utils.PrefsConstant_qvto
+import xpt.Common
+import xpt.diagram.Utils_qvto
+
+@Singleton class extensions extends xpt.diagram.preferences.extensions {
+ @Inject extension Common;
+ @Inject extension Utils_qvto;
+ @Inject extension PrefsConstant_qvto;
+
+ @Inject xpt.diagram.preferences.PreferenceInitializer xptPreferenceInitializer;
+
+ override extensions(GenDiagram it) '''
+
+ «tripleSpace(1)»<extension point="org.eclipse.core.runtime.preferences" id="prefs">
+ «tripleSpace(2)»«xmlGeneratedTag»
+ «tripleSpace(2)»<initializer class="«xptPreferenceInitializer.qualifiedClassName(it)»"/>
+ «tripleSpace(1)»</extension>
+
+ «IF ! it.preferencePages.empty»
+ «tripleSpace(1)»<extension point="org.eclipse.ui.preferencePages" id="prefpages">
+ «tripleSpace(2)»«xmlGeneratedTag»
+ «FOR pref : allPreferencePages(it)»
+ «IF pref instanceof GenStandardPreferencePage»
+ «papyrusPreferencePage(pref as GenStandardPreferencePage)»
+ «ENDIF»
+ «ENDFOR»
+ «tripleSpace(1)»</extension>
+ «ENDIF»
+ '''
+
+ def papyrusPreferencePage(GenStandardPreferencePage it) '''
+ «IF StandardPreferencePages.GENERAL_LITERAL == kind»
+ <page
+ id="«getDiagramPreferencePageCategory()».«getDiagram().editorGen.modelID»"
+ name="«getDiagram().editorGen.modelID» Diagram"
+ category="«getDiagramPreferencePageCategory()»"
+ class="«getQualifiedClassName()»">
+ </page>
+ «ELSEIF StandardPreferencePages.PRINTING_LITERAL == kind ||
+ StandardPreferencePages.RULERS_AND_GRID_LITERAL == kind»
+ <page
+ id="«getQualifiedClassName()»"
+ name="%prefpage.«ID»"
+ category="«getDiagramPreferencePageCategory()».«getDiagram().editorGen.modelID»"
+ class="«getQualifiedClassName()»">
+ </page>
+ «ENDIF»
+ '''
+
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/updater/Extensions.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/updater/Extensions.xtend
index db07790510c..a402f262ff2 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/updater/Extensions.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/diagram/updater/Extensions.xtend
@@ -1,24 +1,24 @@
-/**
- * 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
- * Gabriel Pascual (ALL4TEC) - Bug 372322
- */
-package aspects.xpt.diagram.updater
-
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenDiagramUpdater
-
-@Singleton class Extensions extends xpt.diagram.updater.extensions{
-
- override def extensions(GenDiagramUpdater it) {
- // Override Refresh contribution
- }
-
+/**
+ * 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
+ * Gabriel Pascual (ALL4TEC) - Bug 372322
+ */
+package aspects.xpt.diagram.updater
+
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenDiagramUpdater
+
+@Singleton class Extensions extends xpt.diagram.updater.extensions{
+
+ override def extensions(GenDiagramUpdater it) {
+ // Override Refresh contribution
+ }
+
} \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/ActionBarContributor.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/ActionBarContributor.xtend
index cdf087b52f0..a9b3fa8ab2d 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/ActionBarContributor.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/ActionBarContributor.xtend
@@ -10,13 +10,13 @@
* Dmitry Stadnik (Borland) - initial API and implementation
* Michael Golubev (Montages) - #386838 - migrate to Xtend2
*/
-package aspects.xpt.editor
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenEditorView
-import xpt.Common
-
+package aspects.xpt.editor
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenEditorView
+import xpt.Common
+
@Singleton class ActionBarContributor extends xpt.editor.ActionBarContributor {
@Inject extension Common;
@Inject Editor xptEditor;
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/CreationWizard.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/CreationWizard.xtend
index b5c3548f670..29754ba7811 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/CreationWizard.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/CreationWizard.xtend
@@ -1,174 +1,174 @@
-package aspects.xpt.editor
-
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram
-import xpt.Common
-import com.google.inject.Inject
-import xpt.CodeStyle
-import xpt.editor.GenDiagram_qvto
-import xpt.editor.CreationWizardPage
-import xpt.Externalizer
-import plugin.Activator
-import xpt.editor.DiagramEditorUtil
-import xpt.ExternalizerUtils_qvto
-import com.google.inject.Singleton
-
-@Singleton class CreationWizard extends xpt.editor.CreationWizard {
-
- @Inject extension Common
- @Inject extension CodeStyle
- @Inject extension ExternalizerUtils_qvto
- @Inject extension GenDiagram_qvto
-
- @Inject Activator xptActivator
- @Inject CreationWizardPage xptCreationWizardPage
- @Inject DiagramEditorUtil xptDiagramEditorUtil
- @Inject Externalizer xptExternalizer
-
- override CreationWizard(GenDiagram it) '''
- «copyright(editorGen)»
- package «packageName(it)»;
-
- «generatedClassComment»
- public class «className(it)»
- «extendsList(it)» «implementsList(it)» {
-
- «generatedMemberComment»
- private org.eclipse.ui.IWorkbench workbench;
-
- «generatedMemberComment»
- protected org.eclipse.jface.viewers.IStructuredSelection selection;
-
- «generatedMemberComment»
- protected «xptCreationWizardPage.qualifiedClassName(it)» diagramModelFilePage;
-
- «IF standaloneDomainModel(it)»
- «generatedMemberComment»
- protected «xptCreationWizardPage.qualifiedClassName(it)» domainModelFilePage;
- «ENDIF»
-
- «generatedMemberComment»
- protected org.eclipse.emf.ecore.resource.Resource diagram;
-
- «generatedMemberComment»
- private boolean openNewlyCreatedDiagramEditor = true;
-
- «generatedMemberComment»
- public org.eclipse.ui.IWorkbench getWorkbench() {
- return workbench;
- }
-
- «generatedMemberComment»
- public org.eclipse.jface.viewers.IStructuredSelection getSelection() {
- return selection;
- }
-
- «generatedMemberComment»
- public final org.eclipse.emf.ecore.resource.Resource getDiagram() {
- return diagram;
- }
-
- «generatedMemberComment»
- public final boolean isOpenNewlyCreatedDiagramEditor() {
- return openNewlyCreatedDiagramEditor;
- }
-
- «generatedMemberComment»
- public void setOpenNewlyCreatedDiagramEditor(boolean openNewlyCreatedDiagramEditor) {
- this.openNewlyCreatedDiagramEditor = openNewlyCreatedDiagramEditor;
- }
-
- «generatedMemberComment»
- public void init(org.eclipse.ui.IWorkbench workbench, org.eclipse.jface.viewers.IStructuredSelection selection) {
- this.workbench = workbench;
- this.selection = selection;
- setWindowTitle(«xptExternalizer.accessorCall(editorGen, titleKey(i18nKeyForCreationWizard(it)))»);
- setDefaultPageImageDescriptor(«xptActivator.qualifiedClassName(editorGen.plugin)».getBundledImageDescriptor(
- "icons/wizban/New«IF domainDiagramElement != null»«domainDiagramElement.genPackage.prefix»«ENDIF»Wizard.gif")); //$NON-NLS-1$
- setNeedsProgressMonitor(true);
- }
-
- «generatedMemberComment»
- public void addPages() {
- diagramModelFilePage = new «xptCreationWizardPage.qualifiedClassName(it)»(
- "DiagramModelFile", getSelection(), "«editorGen.diagramFileExtension»"); //$NON-NLS-1$ //$NON-NLS-2$
- diagramModelFilePage.setTitle(«xptExternalizer.accessorCall(editorGen,
- titleKey(i18nKeyForCreationWizardDiagramPage(it)))»);
- diagramModelFilePage.setDescription(«xptExternalizer.accessorCall(editorGen,
- descriptionKey(i18nKeyForCreationWizardDiagramPage(it)))»);
- addPage(diagramModelFilePage);
- «IF standaloneDomainModel(it)»
-
- domainModelFilePage = new «xptCreationWizardPage.qualifiedClassName(it)»(
- "DomainModelFile", getSelection(), "«editorGen.domainFileExtension»") { //$NON-NLS-1$ //$NON-NLS-2$
-
- «overrideC»
- public void setVisible(boolean visible) {
- if (visible) {
- String fileName = diagramModelFilePage.getFileName();
- fileName = fileName.substring(0, fileName.length() - ".«editorGen.diagramFileExtension»".length()); //$NON-NLS-1$
- setFileName(«xptDiagramEditorUtil.qualifiedClassName(it)».getUniqueFileName(
- getContainerFullPath(), fileName, "«editorGen.domainFileExtension»")); //$NON-NLS-1$
- }
- super.setVisible(visible);
- }
- };
- domainModelFilePage.setTitle(«xptExternalizer.accessorCall(editorGen,
- titleKey(i18nKeyForCreationWizardDomainPage(it)))»);
- domainModelFilePage.setDescription(«xptExternalizer.accessorCall(editorGen,
- descriptionKey(i18nKeyForCreationWizardDomainPage(it)))»);
- addPage(domainModelFilePage);
- «ENDIF»
- }
-
- «generatedMemberComment»
- public boolean performFinish() {
- org.eclipse.jface.operation.IRunnableWithProgress op =
- «IF editorGen.application == null»
- new org.eclipse.ui.actions.WorkspaceModifyOperation(null) {
-
- «overrideC»
- protected void execute(org.eclipse.core.runtime.IProgressMonitor monitor)
- throws org.eclipse.core.runtime.CoreException, InterruptedException {
- «ELSE»
- new org.eclipse.jface.operation.IRunnableWithProgress() {
-
- public void run(org.eclipse.core.runtime.IProgressMonitor monitor)
- throws InvocationTargetException, InterruptedException {
- «ENDIF»
- diagram = «xptDiagramEditorUtil.qualifiedClassName(it)».createDiagram(diagramModelFilePage.getURI(),
- «IF standaloneDomainModel(it)»
- domainModelFilePage.getURI(),
- «ENDIF»
- monitor);
- if (isOpenNewlyCreatedDiagramEditor() && diagram != null) {
- try {
- «xptDiagramEditorUtil.qualifiedClassName(it)».openDiagram(diagram);
- } catch (org.eclipse.ui.PartInitException e) {
- org.eclipse.jface.dialogs.ErrorDialog.openError(getContainer().getShell(),
- «xptExternalizer.accessorCall(editorGen, i18nKeyForCreationWizardOpenEditorError(it))», null, e.getStatus());
- }
- }
- }
- };
- try {
- getContainer().run(false, true, op);
- } catch (InterruptedException e) {
- return false;
- } catch (java.lang.reflect.InvocationTargetException e) {
- if (e.getTargetException() instanceof org.eclipse.core.runtime.CoreException) {
- org.eclipse.jface.dialogs.ErrorDialog.openError(getContainer().getShell(),
- «xptExternalizer.accessorCall(editorGen, i18nKeyForCreationWizardCreationError(it))», null,
- ((org.eclipse.core.runtime.CoreException) e.getTargetException()).getStatus());
- } else {
- «xptActivator.qualifiedClassName(editorGen.plugin)».getInstance().logError(
- "Error creating diagram", e.getTargetException()); //$NON-NLS-1$
- }
- return false;
- }
- return diagram != null;
- }
- «additions(it)»
- }
- '''
-
+package aspects.xpt.editor
+
+import org.eclipse.gmf.codegen.gmfgen.GenDiagram
+import xpt.Common
+import com.google.inject.Inject
+import xpt.CodeStyle
+import xpt.editor.GenDiagram_qvto
+import xpt.editor.CreationWizardPage
+import xpt.Externalizer
+import plugin.Activator
+import xpt.editor.DiagramEditorUtil
+import xpt.ExternalizerUtils_qvto
+import com.google.inject.Singleton
+
+@Singleton class CreationWizard extends xpt.editor.CreationWizard {
+
+ @Inject extension Common
+ @Inject extension CodeStyle
+ @Inject extension ExternalizerUtils_qvto
+ @Inject extension GenDiagram_qvto
+
+ @Inject Activator xptActivator
+ @Inject CreationWizardPage xptCreationWizardPage
+ @Inject DiagramEditorUtil xptDiagramEditorUtil
+ @Inject Externalizer xptExternalizer
+
+ override CreationWizard(GenDiagram it) '''
+ «copyright(editorGen)»
+ package «packageName(it)»;
+
+ «generatedClassComment»
+ public class «className(it)»
+ «extendsList(it)» «implementsList(it)» {
+
+ «generatedMemberComment»
+ private org.eclipse.ui.IWorkbench workbench;
+
+ «generatedMemberComment»
+ protected org.eclipse.jface.viewers.IStructuredSelection selection;
+
+ «generatedMemberComment»
+ protected «xptCreationWizardPage.qualifiedClassName(it)» diagramModelFilePage;
+
+ «IF standaloneDomainModel(it)»
+ «generatedMemberComment»
+ protected «xptCreationWizardPage.qualifiedClassName(it)» domainModelFilePage;
+ «ENDIF»
+
+ «generatedMemberComment»
+ protected org.eclipse.emf.ecore.resource.Resource diagram;
+
+ «generatedMemberComment»
+ private boolean openNewlyCreatedDiagramEditor = true;
+
+ «generatedMemberComment»
+ public org.eclipse.ui.IWorkbench getWorkbench() {
+ return workbench;
+ }
+
+ «generatedMemberComment»
+ public org.eclipse.jface.viewers.IStructuredSelection getSelection() {
+ return selection;
+ }
+
+ «generatedMemberComment»
+ public final org.eclipse.emf.ecore.resource.Resource getDiagram() {
+ return diagram;
+ }
+
+ «generatedMemberComment»
+ public final boolean isOpenNewlyCreatedDiagramEditor() {
+ return openNewlyCreatedDiagramEditor;
+ }
+
+ «generatedMemberComment»
+ public void setOpenNewlyCreatedDiagramEditor(boolean openNewlyCreatedDiagramEditor) {
+ this.openNewlyCreatedDiagramEditor = openNewlyCreatedDiagramEditor;
+ }
+
+ «generatedMemberComment»
+ public void init(org.eclipse.ui.IWorkbench workbench, org.eclipse.jface.viewers.IStructuredSelection selection) {
+ this.workbench = workbench;
+ this.selection = selection;
+ setWindowTitle(«xptExternalizer.accessorCall(editorGen, titleKey(i18nKeyForCreationWizard(it)))»);
+ setDefaultPageImageDescriptor(«xptActivator.qualifiedClassName(editorGen.plugin)».getBundledImageDescriptor(
+ "icons/wizban/New«IF domainDiagramElement != null»«domainDiagramElement.genPackage.prefix»«ENDIF»Wizard.gif")); //$NON-NLS-1$
+ setNeedsProgressMonitor(true);
+ }
+
+ «generatedMemberComment»
+ public void addPages() {
+ diagramModelFilePage = new «xptCreationWizardPage.qualifiedClassName(it)»(
+ "DiagramModelFile", getSelection(), "«editorGen.diagramFileExtension»"); //$NON-NLS-1$ //$NON-NLS-2$
+ diagramModelFilePage.setTitle(«xptExternalizer.accessorCall(editorGen,
+ titleKey(i18nKeyForCreationWizardDiagramPage(it)))»);
+ diagramModelFilePage.setDescription(«xptExternalizer.accessorCall(editorGen,
+ descriptionKey(i18nKeyForCreationWizardDiagramPage(it)))»);
+ addPage(diagramModelFilePage);
+ «IF standaloneDomainModel(it)»
+
+ domainModelFilePage = new «xptCreationWizardPage.qualifiedClassName(it)»(
+ "DomainModelFile", getSelection(), "«editorGen.domainFileExtension»") { //$NON-NLS-1$ //$NON-NLS-2$
+
+ «overrideC»
+ public void setVisible(boolean visible) {
+ if (visible) {
+ String fileName = diagramModelFilePage.getFileName();
+ fileName = fileName.substring(0, fileName.length() - ".«editorGen.diagramFileExtension»".length()); //$NON-NLS-1$
+ setFileName(«xptDiagramEditorUtil.qualifiedClassName(it)».getUniqueFileName(
+ getContainerFullPath(), fileName, "«editorGen.domainFileExtension»")); //$NON-NLS-1$
+ }
+ super.setVisible(visible);
+ }
+ };
+ domainModelFilePage.setTitle(«xptExternalizer.accessorCall(editorGen,
+ titleKey(i18nKeyForCreationWizardDomainPage(it)))»);
+ domainModelFilePage.setDescription(«xptExternalizer.accessorCall(editorGen,
+ descriptionKey(i18nKeyForCreationWizardDomainPage(it)))»);
+ addPage(domainModelFilePage);
+ «ENDIF»
+ }
+
+ «generatedMemberComment»
+ public boolean performFinish() {
+ org.eclipse.jface.operation.IRunnableWithProgress op =
+ «IF editorGen.application == null»
+ new org.eclipse.ui.actions.WorkspaceModifyOperation(null) {
+
+ «overrideC»
+ protected void execute(org.eclipse.core.runtime.IProgressMonitor monitor)
+ throws org.eclipse.core.runtime.CoreException, InterruptedException {
+ «ELSE»
+ new org.eclipse.jface.operation.IRunnableWithProgress() {
+
+ public void run(org.eclipse.core.runtime.IProgressMonitor monitor)
+ throws InvocationTargetException, InterruptedException {
+ «ENDIF»
+ diagram = «xptDiagramEditorUtil.qualifiedClassName(it)».createDiagram(diagramModelFilePage.getURI(),
+ «IF standaloneDomainModel(it)»
+ domainModelFilePage.getURI(),
+ «ENDIF»
+ monitor);
+ if (isOpenNewlyCreatedDiagramEditor() && diagram != null) {
+ try {
+ «xptDiagramEditorUtil.qualifiedClassName(it)».openDiagram(diagram);
+ } catch (org.eclipse.ui.PartInitException e) {
+ org.eclipse.jface.dialogs.ErrorDialog.openError(getContainer().getShell(),
+ «xptExternalizer.accessorCall(editorGen, i18nKeyForCreationWizardOpenEditorError(it))», null, e.getStatus());
+ }
+ }
+ }
+ };
+ try {
+ getContainer().run(false, true, op);
+ } catch (InterruptedException e) {
+ return false;
+ } catch (java.lang.reflect.InvocationTargetException e) {
+ if (e.getTargetException() instanceof org.eclipse.core.runtime.CoreException) {
+ org.eclipse.jface.dialogs.ErrorDialog.openError(getContainer().getShell(),
+ «xptExternalizer.accessorCall(editorGen, i18nKeyForCreationWizardCreationError(it))», null,
+ ((org.eclipse.core.runtime.CoreException) e.getTargetException()).getStatus());
+ } else {
+ «xptActivator.qualifiedClassName(editorGen.plugin)».getInstance().logError(
+ "Error creating diagram", e.getTargetException()); //$NON-NLS-1$
+ }
+ return false;
+ }
+ return diagram != null;
+ }
+ «additions(it)»
+ }
+ '''
+
} \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/DeleteElementAction.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/DeleteElementAction.xtend
index e1cf1a326c3..dff428d05d8 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/DeleteElementAction.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/DeleteElementAction.xtend
@@ -12,10 +12,10 @@
* Vincent Lorenzo (CEA LIST)
*
*/
-package aspects.xpt.editor
-
-import com.google.inject.Singleton
-
+package aspects.xpt.editor
+
+import com.google.inject.Singleton
+
//This class is not used, now we use org.eclipse.papyrus.common.actions.DeleteFromModelAction
@Singleton class DeleteElementAction extends xpt.editor.DeleteElementAction {
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/DiagramContentInitializer.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/DiagramContentInitializer.xtend
index 2f72a067024..02b9853d772 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/DiagramContentInitializer.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/DiagramContentInitializer.xtend
@@ -1,30 +1,30 @@
-package aspects.xpt.editor
-
-import aspects.xpt.Common
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenContainerBase
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram
-
-@Singleton class DiagramContentInitializer extends xpt.editor.DiagramContentInitializer {
- @Inject extension Common;
-
- @Inject VisualIDRegistry xptVisualIDRegistry;
-
- override def getCompartment(GenDiagram it) '''
- «generatedMemberComment»
- private org.eclipse.gmf.runtime.notation.Node getCompartment(org.eclipse.gmf.runtime.notation.View node, String visualID) {
- String type = «xptVisualIDRegistry.typeMethodCall(it, 'visualID')»;
- for (java.util.Iterator it = node.getChildren().iterator(); it.hasNext();) {
- org.eclipse.gmf.runtime.notation.View nextView = (org.eclipse.gmf.runtime.notation.View) it.next();
- if (nextView instanceof org.eclipse.gmf.runtime.notation.Node && type.equals(nextView.getType())) {
- return (org.eclipse.gmf.runtime.notation.Node) nextView;
- }
- }
- return null;
- }
- '''
-
- override def createChildrenMethodName(GenContainerBase it) '''create«it.stringUniqueIdentifier»_Children'''
-
+package aspects.xpt.editor
+
+import aspects.xpt.Common
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenContainerBase
+import org.eclipse.gmf.codegen.gmfgen.GenDiagram
+
+@Singleton class DiagramContentInitializer extends xpt.editor.DiagramContentInitializer {
+ @Inject extension Common;
+
+ @Inject VisualIDRegistry xptVisualIDRegistry;
+
+ override def getCompartment(GenDiagram it) '''
+ «generatedMemberComment»
+ private org.eclipse.gmf.runtime.notation.Node getCompartment(org.eclipse.gmf.runtime.notation.View node, String visualID) {
+ String type = «xptVisualIDRegistry.typeMethodCall(it, 'visualID')»;
+ for (java.util.Iterator it = node.getChildren().iterator(); it.hasNext();) {
+ org.eclipse.gmf.runtime.notation.View nextView = (org.eclipse.gmf.runtime.notation.View) it.next();
+ if (nextView instanceof org.eclipse.gmf.runtime.notation.Node && type.equals(nextView.getType())) {
+ return (org.eclipse.gmf.runtime.notation.Node) nextView;
+ }
+ }
+ return null;
+ }
+ '''
+
+ override def createChildrenMethodName(GenContainerBase it) '''create«it.stringUniqueIdentifier»_Children'''
+
} \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/DiagramEditorContextMenuProvider.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/DiagramEditorContextMenuProvider.xtend
index 80bb6f5de02..07c5e97ef5f 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/DiagramEditorContextMenuProvider.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/DiagramEditorContextMenuProvider.xtend
@@ -11,12 +11,12 @@
* Michael Golubev (Montages) - #386838 - migrate to Xtend2
* Vincent Lorenzo (CEA LIST)
*/
-package aspects.xpt.editor
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram
-import plugin.Activator
+package aspects.xpt.editor
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenDiagram
+import plugin.Activator
import xpt.Common import xpt.CodeStyle
//We remove the dependance with DeleteElementAction. Now this action is added to the popup menu with the extension point org.eclipse.ui.popup
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/DiagramEditorUtil.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/DiagramEditorUtil.xtend
index 5a4879ae1f5..0fa3f092235 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/DiagramEditorUtil.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/DiagramEditorUtil.xtend
@@ -1,106 +1,106 @@
-/*****************************************************************************
- * Copyright (c) 2017 CEA LIST and other.
- *
- * 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:
- * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - #510281 change dependency to replace gmft-runtime
- *****************************************************************************/
-package aspects.xpt.editor
-
-import com.google.inject.Inject
-import xpt.Common
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram
-import xpt.Externalizer
-import xpt.CodeStyle
-import metamodel.MetaModel
-import plugin.Activator
-import xpt.editor.GenDiagram_qvto
-import com.google.inject.Singleton
-
-@Singleton class DiagramEditorUtil extends xpt.editor.DiagramEditorUtil {
-
- @Inject extension Common
- @Inject extension CodeStyle
- @Inject extension GenDiagram_qvto
-
- @Inject Activator xptActivator
- @Inject Externalizer xptExternalizer
- @Inject MetaModel xptMetaModel
-
- override def getUniqueFileNameMethod(GenDiagram it) '''
- «generatedMemberComment»
- public static String getUniqueFileName(org.eclipse.core.runtime.IPath containerFullPath, String fileName, String extension) {
- return org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.part.DefaultDiagramEditorUtil.getUniqueFileName(containerFullPath, fileName, extension, «»
- org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.part.DefaultDiagramEditorUtil.«IF editorGen.application == null»EXISTS_IN_WORKSPACE«ELSE»EXISTS_AS_IO_FILE«ENDIF»);
- }
- '''
-
- override createDiagramMethod(GenDiagram it) '''
- «generatedMemberComment(
- (if(editorGen.application == null) 'This method should be called within a workspace modify operation since it creates resources.' else ''))»
- public static org.eclipse.emf.ecore.resource.Resource createDiagram(org.eclipse.emf.common.util.URI diagramURI,«IF standaloneDomainModel(
- it)» org.eclipse.emf.common.util.URI modelURI,«ENDIF» org.eclipse.core.runtime.IProgressMonitor progressMonitor) {
- org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain = org.eclipse.emf.workspace.WorkspaceEditingDomainFactory.INSTANCE.createEditingDomain();
- progressMonitor.beginTask(«xptExternalizer.accessorCall(editorGen, i18nKeyForCreateDiagramProgressTask(it))», 3);
- final org.eclipse.emf.ecore.resource.Resource diagramResource = editingDomain.getResourceSet().createResource(diagramURI);
- «IF standaloneDomainModel(it)»
- final org.eclipse.emf.ecore.resource.Resource modelResource = editingDomain.getResourceSet().createResource(modelURI);
- «ELSEIF domainDiagramElement != null && hasDocumentRoot(it)/*for standalone models, we assume its resourcefactory would be able to set extendedMetaData option*/»
- ((org.eclipse.emf.ecore.xmi.XMLResource) diagramResource).getDefaultSaveOptions().put(org.eclipse.emf.ecore.xmi.XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);
- ((org.eclipse.emf.ecore.xmi.XMLResource) diagramResource).getDefaultLoadOptions().put(org.eclipse.emf.ecore.xmi.XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);
- «ENDIF»
- final String diagramName = diagramURI.lastSegment();
- org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand command = new org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand(editingDomain, «xptExternalizer.
- accessorCall(editorGen, i18nKeyForCreateDiagramCommandLabel(it))», java.util.Collections.EMPTY_LIST) {
- «overrideC»
- 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 {
- «IF domainDiagramElement != null»
- «xptMetaModel.QualifiedClassName(domainDiagramElement)» model = createInitialModel();
- attachModelToResource(model, «IF standaloneDomainModel(it)»model«ELSE»diagram«ENDIF»Resource);
- «ENDIF»
- «extraLineBreak»
- org.eclipse.gmf.runtime.notation.Diagram diagram = org.eclipse.gmf.runtime.diagram.core.services.ViewService.createDiagram(
- «IF domainDiagramElement != null»
- «xptMetaModel.DowncastToEObject(domainDiagramElement, 'model')»,
- «ENDIF»
- «VisualIDRegistry::modelID(it)», «xptActivator.preferenceHintAccess(editorGen)»);
- if (diagram != null) {
- diagramResource.getContents().add(diagram);
- diagram.setName(diagramName);
- «IF domainDiagramElement != null»
- diagram.setElement(«xptMetaModel.DowncastToEObject(domainDiagramElement, 'model')»);
- «ENDIF»
- }
-
- try {
- «IF standaloneDomainModel(it)»modelResource.save(«callGetSaveOptions(it)»);«ENDIF»
- diagramResource.save(«callGetSaveOptions(it)»);
- } catch (java.io.IOException e) {
- «/*
- * TODO CommandResult.newErrorCommandResult(e) would be better? Or even throw ExecutionEx?
- * */
- extraLineBreak»
- «xptActivator.qualifiedClassName(editorGen.plugin)».getInstance().logError("Unable to store model and diagram resources", e); «nonNLS(1)»
- }
- return org.eclipse.gmf.runtime.common.core.command.CommandResult.newOKCommandResult();
- }
- };
- try {
- org.eclipse.core.commands.operations.OperationHistoryFactory.getOperationHistory().execute(command, new org.eclipse.core.runtime.SubProgressMonitor(progressMonitor, 1), null);
- } catch (org.eclipse.core.commands.ExecutionException e) {
- «xptActivator.qualifiedClassName(editorGen.plugin)».getInstance().logError("Unable to create model and diagram", e); «nonNLS(
- 1)»
- }
- «IF editorGen.application == null»
- «IF standaloneDomainModel(it)»setCharset(org.eclipse.emf.workspace.util.WorkspaceSynchronizer.getFile(modelResource));«ENDIF»
- setCharset(org.eclipse.emf.workspace.util.WorkspaceSynchronizer.getFile(diagramResource));
- «ENDIF»
- return diagramResource;
- }
- '''
-
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST and other.
+ *
+ * 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:
+ * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - #510281 change dependency to replace gmft-runtime
+ *****************************************************************************/
+package aspects.xpt.editor
+
+import com.google.inject.Inject
+import xpt.Common
+import org.eclipse.gmf.codegen.gmfgen.GenDiagram
+import xpt.Externalizer
+import xpt.CodeStyle
+import metamodel.MetaModel
+import plugin.Activator
+import xpt.editor.GenDiagram_qvto
+import com.google.inject.Singleton
+
+@Singleton class DiagramEditorUtil extends xpt.editor.DiagramEditorUtil {
+
+ @Inject extension Common
+ @Inject extension CodeStyle
+ @Inject extension GenDiagram_qvto
+
+ @Inject Activator xptActivator
+ @Inject Externalizer xptExternalizer
+ @Inject MetaModel xptMetaModel
+
+ override def getUniqueFileNameMethod(GenDiagram it) '''
+ «generatedMemberComment»
+ public static String getUniqueFileName(org.eclipse.core.runtime.IPath containerFullPath, String fileName, String extension) {
+ return org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.part.DefaultDiagramEditorUtil.getUniqueFileName(containerFullPath, fileName, extension, «»
+ org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.part.DefaultDiagramEditorUtil.«IF editorGen.application == null»EXISTS_IN_WORKSPACE«ELSE»EXISTS_AS_IO_FILE«ENDIF»);
+ }
+ '''
+
+ override createDiagramMethod(GenDiagram it) '''
+ «generatedMemberComment(
+ (if(editorGen.application == null) 'This method should be called within a workspace modify operation since it creates resources.' else ''))»
+ public static org.eclipse.emf.ecore.resource.Resource createDiagram(org.eclipse.emf.common.util.URI diagramURI,«IF standaloneDomainModel(
+ it)» org.eclipse.emf.common.util.URI modelURI,«ENDIF» org.eclipse.core.runtime.IProgressMonitor progressMonitor) {
+ org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain = org.eclipse.emf.workspace.WorkspaceEditingDomainFactory.INSTANCE.createEditingDomain();
+ progressMonitor.beginTask(«xptExternalizer.accessorCall(editorGen, i18nKeyForCreateDiagramProgressTask(it))», 3);
+ final org.eclipse.emf.ecore.resource.Resource diagramResource = editingDomain.getResourceSet().createResource(diagramURI);
+ «IF standaloneDomainModel(it)»
+ final org.eclipse.emf.ecore.resource.Resource modelResource = editingDomain.getResourceSet().createResource(modelURI);
+ «ELSEIF domainDiagramElement != null && hasDocumentRoot(it)/*for standalone models, we assume its resourcefactory would be able to set extendedMetaData option*/»
+ ((org.eclipse.emf.ecore.xmi.XMLResource) diagramResource).getDefaultSaveOptions().put(org.eclipse.emf.ecore.xmi.XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);
+ ((org.eclipse.emf.ecore.xmi.XMLResource) diagramResource).getDefaultLoadOptions().put(org.eclipse.emf.ecore.xmi.XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);
+ «ENDIF»
+ final String diagramName = diagramURI.lastSegment();
+ org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand command = new org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand(editingDomain, «xptExternalizer.
+ accessorCall(editorGen, i18nKeyForCreateDiagramCommandLabel(it))», java.util.Collections.EMPTY_LIST) {
+ «overrideC»
+ 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 {
+ «IF domainDiagramElement != null»
+ «xptMetaModel.QualifiedClassName(domainDiagramElement)» model = createInitialModel();
+ attachModelToResource(model, «IF standaloneDomainModel(it)»model«ELSE»diagram«ENDIF»Resource);
+ «ENDIF»
+ «extraLineBreak»
+ org.eclipse.gmf.runtime.notation.Diagram diagram = org.eclipse.gmf.runtime.diagram.core.services.ViewService.createDiagram(
+ «IF domainDiagramElement != null»
+ «xptMetaModel.DowncastToEObject(domainDiagramElement, 'model')»,
+ «ENDIF»
+ «VisualIDRegistry::modelID(it)», «xptActivator.preferenceHintAccess(editorGen)»);
+ if (diagram != null) {
+ diagramResource.getContents().add(diagram);
+ diagram.setName(diagramName);
+ «IF domainDiagramElement != null»
+ diagram.setElement(«xptMetaModel.DowncastToEObject(domainDiagramElement, 'model')»);
+ «ENDIF»
+ }
+
+ try {
+ «IF standaloneDomainModel(it)»modelResource.save(«callGetSaveOptions(it)»);«ENDIF»
+ diagramResource.save(«callGetSaveOptions(it)»);
+ } catch (java.io.IOException e) {
+ «/*
+ * TODO CommandResult.newErrorCommandResult(e) would be better? Or even throw ExecutionEx?
+ * */
+ extraLineBreak»
+ «xptActivator.qualifiedClassName(editorGen.plugin)».getInstance().logError("Unable to store model and diagram resources", e); «nonNLS(1)»
+ }
+ return org.eclipse.gmf.runtime.common.core.command.CommandResult.newOKCommandResult();
+ }
+ };
+ try {
+ org.eclipse.core.commands.operations.OperationHistoryFactory.getOperationHistory().execute(command, new org.eclipse.core.runtime.SubProgressMonitor(progressMonitor, 1), null);
+ } catch (org.eclipse.core.commands.ExecutionException e) {
+ «xptActivator.qualifiedClassName(editorGen.plugin)».getInstance().logError("Unable to create model and diagram", e); «nonNLS(
+ 1)»
+ }
+ «IF editorGen.application == null»
+ «IF standaloneDomainModel(it)»setCharset(org.eclipse.emf.workspace.util.WorkspaceSynchronizer.getFile(modelResource));«ENDIF»
+ setCharset(org.eclipse.emf.workspace.util.WorkspaceSynchronizer.getFile(diagramResource));
+ «ENDIF»
+ return diagramResource;
+ }
+ '''
+
} \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/InitDiagramFileAction.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/InitDiagramFileAction.xtend
index c5f3afdc95e..af515676fe1 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/InitDiagramFileAction.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/InitDiagramFileAction.xtend
@@ -1,81 +1,81 @@
-package aspects.xpt.editor
-
-import xpt.Common
-import com.google.inject.Inject
-import plugin.Activator
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram
-import xpt.Externalizer
-import xpt.ExternalizerUtils_qvto
-import com.google.inject.Singleton
-
-@Singleton class InitDiagramFileAction extends xpt.editor.InitDiagramFileAction {
-
- @Inject extension Common
- @Inject extension ExternalizerUtils_qvto
-
- @Inject Activator xptActivator
- @Inject xpt.editor.DiagramEditorUtil xptDiagramEditorUtil
- @Inject Externalizer xptExternalizer
-
- override classBody_PDE(GenDiagram it) '''
- «generatedMemberComment»
- private org.eclipse.ui.IWorkbenchPart targetPart;
-
- «generatedMemberComment»
- private org.eclipse.emf.common.util.URI domainModelURI;
-
- «generatedMemberComment»
- public void setActivePart(org.eclipse.jface.action.IAction action, org.eclipse.ui.IWorkbenchPart targetPart) {
- this.targetPart = targetPart;
- }
-
- «generatedMemberComment»
- public void selectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection) {
- domainModelURI = null;
- action.setEnabled(false);
- if (selection instanceof org.eclipse.jface.viewers.IStructuredSelection == false || selection.isEmpty()) {
- return;
- }
- org.eclipse.core.resources.IFile file =
- (org.eclipse.core.resources.IFile) ((org.eclipse.jface.viewers.IStructuredSelection) selection).getFirstElement();
- domainModelURI = org.eclipse.emf.common.util.URI.createPlatformResourceURI(file.getFullPath().toString(), true);
- action.setEnabled(true);
- }
-
- «generatedMemberComment»
- private org.eclipse.swt.widgets.Shell getShell() {
- return targetPart.getSite().getShell();
- }
-
- «generatedMemberComment»
- public void run(org.eclipse.jface.action.IAction action) {
- org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain =
- org.eclipse.emf.workspace.WorkspaceEditingDomainFactory.INSTANCE.createEditingDomain();
- «IF editorGen.sameFileForDiagramAndModel»
- org.eclipse.emf.ecore.resource.ResourceSet resourceSet = new org.eclipse.emf.ecore.resource.impl.ResourceSetImpl();
- «ELSE»
- org.eclipse.emf.ecore.resource.ResourceSet resourceSet = editingDomain.getResourceSet();
- «ENDIF»
- org.eclipse.emf.ecore.EObject diagramRoot = null;
- try {
- org.eclipse.emf.ecore.resource.Resource resource = resourceSet.getResource(domainModelURI, true);
- diagramRoot = resource.getContents().get(0);
- } catch (org.eclipse.emf.common.util.WrappedException ex) {
- «xptActivator.qualifiedClassName(editorGen.plugin)».getInstance().logError(
- "Unable to load resource: " + domainModelURI, ex); «nonNLS(1)»
- }
- if (diagramRoot == null) {
- org.eclipse.jface.dialogs.MessageDialog.openError(getShell(),
- «xptExternalizer.accessorCall(editorGen, titleKey(i18nKeyForInitDiagramFileResourceErrorDialog()))»,
- «xptExternalizer.accessorCall(editorGen, messageKey(i18nKeyForInitDiagramFileResourceErrorDialog()))»);
- return;
- }
- org.eclipse.jface.wizard.Wizard wizard = new «editorGen.diagram.getNewDiagramFileWizardQualifiedClassName()»(domainModelURI, diagramRoot, editingDomain);
- wizard.setWindowTitle(org.eclipse.osgi.util.NLS.bind(
- «xptExternalizer.accessorCall(editorGen, i18nKeyForInitDiagramFileWizardTitle())»,
- «VisualIDRegistry::modelID(editorGen.diagram)»));
- «xptDiagramEditorUtil.qualifiedClassName(editorGen.diagram)».runWizard(getShell(), wizard, "InitDiagramFile"); «nonNLS(
- 1)»
- }
- '''
+package aspects.xpt.editor
+
+import xpt.Common
+import com.google.inject.Inject
+import plugin.Activator
+import org.eclipse.gmf.codegen.gmfgen.GenDiagram
+import xpt.Externalizer
+import xpt.ExternalizerUtils_qvto
+import com.google.inject.Singleton
+
+@Singleton class InitDiagramFileAction extends xpt.editor.InitDiagramFileAction {
+
+ @Inject extension Common
+ @Inject extension ExternalizerUtils_qvto
+
+ @Inject Activator xptActivator
+ @Inject xpt.editor.DiagramEditorUtil xptDiagramEditorUtil
+ @Inject Externalizer xptExternalizer
+
+ override classBody_PDE(GenDiagram it) '''
+ «generatedMemberComment»
+ private org.eclipse.ui.IWorkbenchPart targetPart;
+
+ «generatedMemberComment»
+ private org.eclipse.emf.common.util.URI domainModelURI;
+
+ «generatedMemberComment»
+ public void setActivePart(org.eclipse.jface.action.IAction action, org.eclipse.ui.IWorkbenchPart targetPart) {
+ this.targetPart = targetPart;
+ }
+
+ «generatedMemberComment»
+ public void selectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection) {
+ domainModelURI = null;
+ action.setEnabled(false);
+ if (selection instanceof org.eclipse.jface.viewers.IStructuredSelection == false || selection.isEmpty()) {
+ return;
+ }
+ org.eclipse.core.resources.IFile file =
+ (org.eclipse.core.resources.IFile) ((org.eclipse.jface.viewers.IStructuredSelection) selection).getFirstElement();
+ domainModelURI = org.eclipse.emf.common.util.URI.createPlatformResourceURI(file.getFullPath().toString(), true);
+ action.setEnabled(true);
+ }
+
+ «generatedMemberComment»
+ private org.eclipse.swt.widgets.Shell getShell() {
+ return targetPart.getSite().getShell();
+ }
+
+ «generatedMemberComment»
+ public void run(org.eclipse.jface.action.IAction action) {
+ org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain =
+ org.eclipse.emf.workspace.WorkspaceEditingDomainFactory.INSTANCE.createEditingDomain();
+ «IF editorGen.sameFileForDiagramAndModel»
+ org.eclipse.emf.ecore.resource.ResourceSet resourceSet = new org.eclipse.emf.ecore.resource.impl.ResourceSetImpl();
+ «ELSE»
+ org.eclipse.emf.ecore.resource.ResourceSet resourceSet = editingDomain.getResourceSet();
+ «ENDIF»
+ org.eclipse.emf.ecore.EObject diagramRoot = null;
+ try {
+ org.eclipse.emf.ecore.resource.Resource resource = resourceSet.getResource(domainModelURI, true);
+ diagramRoot = resource.getContents().get(0);
+ } catch (org.eclipse.emf.common.util.WrappedException ex) {
+ «xptActivator.qualifiedClassName(editorGen.plugin)».getInstance().logError(
+ "Unable to load resource: " + domainModelURI, ex); «nonNLS(1)»
+ }
+ if (diagramRoot == null) {
+ org.eclipse.jface.dialogs.MessageDialog.openError(getShell(),
+ «xptExternalizer.accessorCall(editorGen, titleKey(i18nKeyForInitDiagramFileResourceErrorDialog()))»,
+ «xptExternalizer.accessorCall(editorGen, messageKey(i18nKeyForInitDiagramFileResourceErrorDialog()))»);
+ return;
+ }
+ org.eclipse.jface.wizard.Wizard wizard = new «editorGen.diagram.getNewDiagramFileWizardQualifiedClassName()»(domainModelURI, diagramRoot, editingDomain);
+ wizard.setWindowTitle(org.eclipse.osgi.util.NLS.bind(
+ «xptExternalizer.accessorCall(editorGen, i18nKeyForInitDiagramFileWizardTitle())»,
+ «VisualIDRegistry::modelID(editorGen.diagram)»));
+ «xptDiagramEditorUtil.qualifiedClassName(editorGen.diagram)».runWizard(getShell(), wizard, "InitDiagramFile"); «nonNLS(
+ 1)»
+ }
+ '''
} \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/ResourceSetInfo.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/ResourceSetInfo.xtend
index 7c552041346..bd5de605a1b 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/ResourceSetInfo.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/ResourceSetInfo.xtend
@@ -1,60 +1,60 @@
-package aspects.xpt.editor
-
-import com.google.inject.Inject
-import xpt.Common
-import xpt.CodeStyle
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram
-import com.google.inject.Singleton
-
-@Singleton class ResourceSetInfo extends xpt.editor.ResourceSetInfo {
-
- @Inject extension Common
- @Inject extension CodeStyle
-
- override handleResourceChangedSD(GenDiagram it) '''
- «generatedMemberComment»
- public boolean handleResourceChanged(final org.eclipse.emf.ecore.resource.Resource resource) {
- «updateSynchStateSD(it)»
- org.eclipse.swt.widgets.Display.getDefault().asyncExec(new java.lang.Runnable() {
- «overrideI»
- public void run() {
- handleElementChanged(ResourceSetInfo.this, resource, null);
- }
- });
- return true;
- }
- '''
-
- override handleResourceDeletedSD(GenDiagram it) '''
- «generatedMemberComment»
- public boolean handleResourceDeleted(org.eclipse.emf.ecore.resource.Resource resource) {
- «updateSynchStateSD(it)»
- org.eclipse.swt.widgets.Display.getDefault().asyncExec(new java.lang.Runnable() {
- «overrideI»
- public void run() {
- fireElementDeleted(ResourceSetInfo.this.getEditorInput());
- }
- });
- return true;
- }
- '''
-
- override handleResourceMovedSD(GenDiagram it) '''
- «generatedMemberComment»
- public boolean handleResourceMoved(org.eclipse.emf.ecore.resource.Resource resource, final org.eclipse.emf.common.util.URI newURI) {
- «updateSynchStateSD(it)»
- if (myDocument.getDiagram().eResource() == resource) {
- org.eclipse.swt.widgets.Display.getDefault().asyncExec(new java.lang.Runnable() {
- «overrideI»
- public void run() {
- handleElementMoved(ResourceSetInfo.this.getEditorInput(), newURI);
- }
- });
- } else {
- handleResourceDeleted(resource);
- }
- return true;
- }
- '''
-
+package aspects.xpt.editor
+
+import com.google.inject.Inject
+import xpt.Common
+import xpt.CodeStyle
+import org.eclipse.gmf.codegen.gmfgen.GenDiagram
+import com.google.inject.Singleton
+
+@Singleton class ResourceSetInfo extends xpt.editor.ResourceSetInfo {
+
+ @Inject extension Common
+ @Inject extension CodeStyle
+
+ override handleResourceChangedSD(GenDiagram it) '''
+ «generatedMemberComment»
+ public boolean handleResourceChanged(final org.eclipse.emf.ecore.resource.Resource resource) {
+ «updateSynchStateSD(it)»
+ org.eclipse.swt.widgets.Display.getDefault().asyncExec(new java.lang.Runnable() {
+ «overrideI»
+ public void run() {
+ handleElementChanged(ResourceSetInfo.this, resource, null);
+ }
+ });
+ return true;
+ }
+ '''
+
+ override handleResourceDeletedSD(GenDiagram it) '''
+ «generatedMemberComment»
+ public boolean handleResourceDeleted(org.eclipse.emf.ecore.resource.Resource resource) {
+ «updateSynchStateSD(it)»
+ org.eclipse.swt.widgets.Display.getDefault().asyncExec(new java.lang.Runnable() {
+ «overrideI»
+ public void run() {
+ fireElementDeleted(ResourceSetInfo.this.getEditorInput());
+ }
+ });
+ return true;
+ }
+ '''
+
+ override handleResourceMovedSD(GenDiagram it) '''
+ «generatedMemberComment»
+ public boolean handleResourceMoved(org.eclipse.emf.ecore.resource.Resource resource, final org.eclipse.emf.common.util.URI newURI) {
+ «updateSynchStateSD(it)»
+ if (myDocument.getDiagram().eResource() == resource) {
+ org.eclipse.swt.widgets.Display.getDefault().asyncExec(new java.lang.Runnable() {
+ «overrideI»
+ public void run() {
+ handleElementMoved(ResourceSetInfo.this.getEditorInput(), newURI);
+ }
+ });
+ } else {
+ handleResourceDeleted(resource);
+ }
+ return true;
+ }
+ '''
+
} \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/extensions.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/extensions.xtend
index 69462e9b562..5ed49a3255a 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/extensions.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/extensions.xtend
@@ -10,13 +10,13 @@
* Dmitry Stadnik (Borland) - initial API and implementation
* Michael Golubev (Montages) - #386838 - migrate to Xtend2
*/
-package aspects.xpt.editor
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator
-import xpt.Common
-
+package aspects.xpt.editor
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator
+import xpt.Common
+
@Singleton class extensions extends xpt.editor.extensions {
@Inject extension Common;
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/palette/PaletteConfiguration.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/palette/PaletteConfiguration.xtend
index 5af93bde682..db9c8b642ca 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/palette/PaletteConfiguration.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/palette/PaletteConfiguration.xtend
@@ -110,4 +110,4 @@ import xpt.Common_qvto
«ENDFOR»
</ownedConfigurations>
'''
-}
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/palette/PaletteFactory.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/palette/PaletteFactory.xtend
index 3c8fc7d8701..73366e5576e 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/palette/PaletteFactory.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/editor/palette/PaletteFactory.xtend
@@ -1,119 +1,119 @@
-/**
- * Copyright (c) 2006, 2010, 2013 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:
- * Artem Tikhomirov (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.xpt.editor.palette
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.AbstractToolEntry
-import org.eclipse.gmf.codegen.gmfgen.Palette
-import org.eclipse.gmf.codegen.gmfgen.ToolEntry
-import xpt.Common
-import xpt.Common_qvto
-import xpt.providers.ElementTypes
-
-@Singleton class PaletteFactory extends xpt.editor.palette.PaletteFactory {
- @Inject extension Common;
- @Inject extension Common_qvto;
- @Inject extension Utils_qvto;
-
- @Inject ElementTypes xptElementTypes;
-
-
- override PaletteFactory(Palette it) '''
- «copyright(diagram.editorGen)»
- package «packageName»;
-
- «generatedClassComment»
- public class «factoryClassName» extends org.eclipse.gmf.runtime.diagram.ui.services.palette.PaletteFactory.Adapter {
- //RS: New Palette generation
-
- //Generates the ID for the tool elements
- //Generate the tool factory (if(ID) createtool...)
- «FOR tool : collectTools(it)»
- «generateIDAttribute(tool)»
- «ENDFOR»
-
- «««Generates the default constructor
- «generatedMemberComment»
- public «factoryClassName»() {
-
- }
-
- «««Generates the main method to create tool
- «generateCreateTool(it)»
-
- «««Generates the main method to create template
- «generateGetTemplate(it)»
-
- «««Generates each method for tool creation
-
- «FOR tool : collectTools(it)»
- «createTool(tool)»
- «ENDFOR»
-
- }
- '''
-
- def generateCreateTool(Palette it) '''
- «generatedMemberComment»
- public org.eclipse.gef.Tool createTool(String toolId) {
- «FOR tool : collectTools(it)»
- «checkToolID(tool)»
- «ENDFOR»
- // default return: null
- return null;
- }
- '''
-
- def checkToolID(AbstractToolEntry it) '''
- if (toolId.equals(«getConstantIDName(id)»)) {
- return «createMethodName»();
- }
- '''
-
- def generateGetTemplate(Palette it) '''
- «generatedMemberComment»
- public Object getTemplate(String templateId) {
-
- // default return: null
- return null;
- }
- '''
-
- def generateIDAttribute(AbstractToolEntry it) '''
- «generatedMemberComment»
- private final static String «getConstantIDName(id)» = «id»;«IF isQuoted(id,'"')»«nonNLS»«ENDIF»
- '''
-
- def createTool(AbstractToolEntry it) '''
- «generatedMemberComment»
- private org.eclipse.gef.Tool «createMethodName»() {
- «newTool(it as ToolEntry, 'entry')»
- }
- '''
-
- def newTool(ToolEntry it, String toolVarName) '''
- «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»);
- «FOR e : elements»
- types.add(«xptElementTypes.accessElementType(e)»);
- «ENDFOR»
- ««« RS: modified tool creation to have stereotypes-aware tools
- org.eclipse.gef.Tool tool = new org.eclipse.papyrus.uml.diagram.common.service.«IF it.genNodes.isEmpty()»AspectUnspecifiedTypeConnectionTool«ELSE»AspectUnspecifiedTypeCreationTool«ENDIF»(types);
- return tool;
- «ENDIF»
- '''
-
-}
+/**
+ * Copyright (c) 2006, 2010, 2013 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:
+ * Artem Tikhomirov (Borland) - initial API and implementation
+ * Michael Golubev (Montages) - #386838 - migrate to Xtend2
+ */
+package aspects.xpt.editor.palette
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.AbstractToolEntry
+import org.eclipse.gmf.codegen.gmfgen.Palette
+import org.eclipse.gmf.codegen.gmfgen.ToolEntry
+import xpt.Common
+import xpt.Common_qvto
+import xpt.providers.ElementTypes
+
+@Singleton class PaletteFactory extends xpt.editor.palette.PaletteFactory {
+ @Inject extension Common;
+ @Inject extension Common_qvto;
+ @Inject extension Utils_qvto;
+
+ @Inject ElementTypes xptElementTypes;
+
+
+ override PaletteFactory(Palette it) '''
+ «copyright(diagram.editorGen)»
+ package «packageName»;
+
+ «generatedClassComment»
+ public class «factoryClassName» extends org.eclipse.gmf.runtime.diagram.ui.services.palette.PaletteFactory.Adapter {
+ //RS: New Palette generation
+
+ //Generates the ID for the tool elements
+ //Generate the tool factory (if(ID) createtool...)
+ «FOR tool : collectTools(it)»
+ «generateIDAttribute(tool)»
+ «ENDFOR»
+
+ «««Generates the default constructor
+ «generatedMemberComment»
+ public «factoryClassName»() {
+
+ }
+
+ «««Generates the main method to create tool
+ «generateCreateTool(it)»
+
+ «««Generates the main method to create template
+ «generateGetTemplate(it)»
+
+ «««Generates each method for tool creation
+
+ «FOR tool : collectTools(it)»
+ «createTool(tool)»
+ «ENDFOR»
+
+ }
+ '''
+
+ def generateCreateTool(Palette it) '''
+ «generatedMemberComment»
+ public org.eclipse.gef.Tool createTool(String toolId) {
+ «FOR tool : collectTools(it)»
+ «checkToolID(tool)»
+ «ENDFOR»
+ // default return: null
+ return null;
+ }
+ '''
+
+ def checkToolID(AbstractToolEntry it) '''
+ if (toolId.equals(«getConstantIDName(id)»)) {
+ return «createMethodName»();
+ }
+ '''
+
+ def generateGetTemplate(Palette it) '''
+ «generatedMemberComment»
+ public Object getTemplate(String templateId) {
+
+ // default return: null
+ return null;
+ }
+ '''
+
+ def generateIDAttribute(AbstractToolEntry it) '''
+ «generatedMemberComment»
+ private final static String «getConstantIDName(id)» = «id»;«IF isQuoted(id,'"')»«nonNLS»«ENDIF»
+ '''
+
+ def createTool(AbstractToolEntry it) '''
+ «generatedMemberComment»
+ private org.eclipse.gef.Tool «createMethodName»() {
+ «newTool(it as ToolEntry, 'entry')»
+ }
+ '''
+
+ def newTool(ToolEntry it, String toolVarName) '''
+ «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»);
+ «FOR e : elements»
+ types.add(«xptElementTypes.accessElementType(e)»);
+ «ENDFOR»
+ ««« RS: modified tool creation to have stereotypes-aware tools
+ org.eclipse.gef.Tool tool = new org.eclipse.papyrus.uml.diagram.common.service.«IF it.genNodes.isEmpty()»AspectUnspecifiedTypeConnectionTool«ELSE»AspectUnspecifiedTypeCreationTool«ENDIF»(types);
+ return tool;
+ «ENDIF»
+ '''
+
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/expressions/AbstractExpression.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/expressions/AbstractExpression.xtend
index aee02cc7c51..0cd13c1a923 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/expressions/AbstractExpression.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/expressions/AbstractExpression.xtend
@@ -1,64 +1,64 @@
-package aspects.xpt.expressions
-
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram
-import com.google.inject.Inject
-import aspects.xpt.Common
-import com.google.inject.Singleton
-
-@Singleton class AbstractExpression extends xpt.expressions.AbstractExpression {
-
- @Inject extension Common
-
- override performCast(GenDiagram it) '''
- «generatedMemberComment(
- 'Expression may return number value which is not directly compatible with feature type (e.g. Double when Integer is expected), or EEnumLiteral meta-object when literal instance is expected')»
- public static Object performCast(Object value, org.eclipse.emf.ecore.EDataType targetType) {
- if (targetType instanceof org.eclipse.emf.ecore.EEnum) {
- if (value instanceof org.eclipse.emf.ecore.EEnumLiteral) {
- org.eclipse.emf.ecore.EEnumLiteral literal = (org.eclipse.emf.ecore.EEnumLiteral) value;
- return (literal.getInstance() != null) ? literal.getInstance() : literal;
- }
- }
- if (false == value instanceof Number || targetType == null || targetType.getInstanceClass() == null) {
- return value;
- }
- Class<?> targetClass = targetType.getInstanceClass();
- Number num = (Number) value;
- Class<?> valClass = value.getClass();
- Class<?> targetWrapperClass = targetClass;
- if (targetClass.isPrimitive()) {
- targetWrapperClass = org.eclipse.emf.ecore.util.EcoreUtil.wrapperClassFor(targetClass);
- }
- if (valClass.equals(targetWrapperClass)) {
- return value;
- }
- if (Number.class.isAssignableFrom(targetWrapperClass)) {
- if (targetWrapperClass.equals(Byte.class)) {
- return new Byte(num.byteValue());
- }
- if (targetWrapperClass.equals(Integer.class)) {
- return new Integer(num.intValue());
- }
- if (targetWrapperClass.equals(Short.class)) {
- return new Short(num.shortValue());
- }
- if (targetWrapperClass.equals(Long.class)) {
- return new Long(num.longValue());
- }
- if (targetWrapperClass.equals(java.math.BigInteger.class)) {
- return java.math.BigInteger.valueOf(num.longValue());
- }
- if (targetWrapperClass.equals(Float.class)) {
- return new Float(num.floatValue());
- }
- if (targetWrapperClass.equals(Double.class)) {
- return new Double(num.doubleValue());
- }
- if (targetWrapperClass.equals(java.math.BigDecimal.class)) {
- return new java.math.BigDecimal(num.doubleValue());
- }
- }
- return value;
- }
- '''
+package aspects.xpt.expressions
+
+import org.eclipse.gmf.codegen.gmfgen.GenDiagram
+import com.google.inject.Inject
+import aspects.xpt.Common
+import com.google.inject.Singleton
+
+@Singleton class AbstractExpression extends xpt.expressions.AbstractExpression {
+
+ @Inject extension Common
+
+ override performCast(GenDiagram it) '''
+ «generatedMemberComment(
+ 'Expression may return number value which is not directly compatible with feature type (e.g. Double when Integer is expected), or EEnumLiteral meta-object when literal instance is expected')»
+ public static Object performCast(Object value, org.eclipse.emf.ecore.EDataType targetType) {
+ if (targetType instanceof org.eclipse.emf.ecore.EEnum) {
+ if (value instanceof org.eclipse.emf.ecore.EEnumLiteral) {
+ org.eclipse.emf.ecore.EEnumLiteral literal = (org.eclipse.emf.ecore.EEnumLiteral) value;
+ return (literal.getInstance() != null) ? literal.getInstance() : literal;
+ }
+ }
+ if (false == value instanceof Number || targetType == null || targetType.getInstanceClass() == null) {
+ return value;
+ }
+ Class<?> targetClass = targetType.getInstanceClass();
+ Number num = (Number) value;
+ Class<?> valClass = value.getClass();
+ Class<?> targetWrapperClass = targetClass;
+ if (targetClass.isPrimitive()) {
+ targetWrapperClass = org.eclipse.emf.ecore.util.EcoreUtil.wrapperClassFor(targetClass);
+ }
+ if (valClass.equals(targetWrapperClass)) {
+ return value;
+ }
+ if (Number.class.isAssignableFrom(targetWrapperClass)) {
+ if (targetWrapperClass.equals(Byte.class)) {
+ return new Byte(num.byteValue());
+ }
+ if (targetWrapperClass.equals(Integer.class)) {
+ return new Integer(num.intValue());
+ }
+ if (targetWrapperClass.equals(Short.class)) {
+ return new Short(num.shortValue());
+ }
+ if (targetWrapperClass.equals(Long.class)) {
+ return new Long(num.longValue());
+ }
+ if (targetWrapperClass.equals(java.math.BigInteger.class)) {
+ return java.math.BigInteger.valueOf(num.longValue());
+ }
+ if (targetWrapperClass.equals(Float.class)) {
+ return new Float(num.floatValue());
+ }
+ if (targetWrapperClass.equals(Double.class)) {
+ return new Double(num.doubleValue());
+ }
+ if (targetWrapperClass.equals(java.math.BigDecimal.class)) {
+ return new java.math.BigDecimal(num.doubleValue());
+ }
+ }
+ return value;
+ }
+ '''
} \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/AbstractNavigatorItem.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/AbstractNavigatorItem.xtend
index 7f1888e89f8..d729966b66b 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/AbstractNavigatorItem.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/AbstractNavigatorItem.xtend
@@ -9,19 +9,19 @@
* Contributors:
* Alexander Shatalin (Borland) - initial API and implementation
* Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.xpt.navigator
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenNavigator
+ */
+package aspects.xpt.navigator
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenNavigator
import xpt.Common import xpt.CodeStyle
-@Singleton class AbstractNavigatorItem extends xpt.navigator.AbstractNavigatorItem {
- @Inject extension Common;
+@Singleton class AbstractNavigatorItem extends xpt.navigator.AbstractNavigatorItem {
+ @Inject extension Common;
@Inject extension CodeStyle
-
- override def registerAdapterFactory(GenNavigator it) '''
+
+ override def registerAdapterFactory(GenNavigator it) '''
«generatedMemberComment()»
static {
@SuppressWarnings("rawtypes")
@@ -50,6 +50,6 @@ import xpt.Common import xpt.CodeStyle
}
}, «qualifiedClassName(it)».class);
}
- '''
-
-}
+ '''
+
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/DomainNavigatorContentProvider.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/DomainNavigatorContentProvider.xtend
index 3ae343a8f5c..99bccffe2cb 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/DomainNavigatorContentProvider.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/DomainNavigatorContentProvider.xtend
@@ -9,23 +9,23 @@
* Contributors:
* Alexander Shatalin (Borland) - initial API and implementation
* Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.xpt.navigator
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenNavigator
-import plugin.Activator
-import xpt.Common
-
-@Singleton class DomainNavigatorContentProvider extends xpt.navigator.DomainNavigatorContentProvider {
- @Inject extension Common;
-
- @Inject Activator xptActivator
- @Inject NavigatorContentProvider xptNavigatorContentProvider;
- @Inject DomainNavigatorItem xptDomainNavigatorItem;
-
- override def wrapEObjects(GenNavigator it) '''
+ */
+package aspects.xpt.navigator
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenNavigator
+import plugin.Activator
+import xpt.Common
+
+@Singleton class DomainNavigatorContentProvider extends xpt.navigator.DomainNavigatorContentProvider {
+ @Inject extension Common;
+
+ @Inject Activator xptActivator
+ @Inject NavigatorContentProvider xptNavigatorContentProvider;
+ @Inject DomainNavigatorItem xptDomainNavigatorItem;
+
+ override def wrapEObjects(GenNavigator it) '''
«generatedMemberComment()»
public Object[] wrapEObjects(Object[] objects, Object parentElement) {
java.util.Collection<«xptDomainNavigatorItem.qualifiedClassName(it)»> result = new java.util.ArrayList<«xptDomainNavigatorItem.qualifiedClassName(it)»>();
@@ -36,6 +36,6 @@ import xpt.Common
}
return result.toArray();
}
- '''
-
-}
+ '''
+
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/DomainNavigatorItem.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/DomainNavigatorItem.xtend
index 26322174d6a..e8e32303b09 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/DomainNavigatorItem.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/DomainNavigatorItem.xtend
@@ -1,58 +1,58 @@
-/**
- * Copyright (c) 2007, 2009, 2013 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) - #386838 - migrate to Xtend2
- */
-package aspects.xpt.navigator
-
-import com.google.inject.Inject
-import org.eclipse.gmf.codegen.gmfgen.GenNavigator
-import xpt.Common
-import xpt.CodeStyle
-
-@com.google.inject.Singleton class DomainNavigatorItem extends xpt.navigator.DomainNavigatorItem {
- @Inject extension Common;
- @Inject extension CodeStyle
-
- override def registerAdapterFactory(GenNavigator it) '''
- «generatedMemberComment()»
- static {
- @SuppressWarnings("rawtypes")
- final Class[] supportedTypes = new Class[] { org.eclipse.emf.ecore.EObject.class, org.eclipse.ui.views.properties.IPropertySource.class };
- org.eclipse.core.runtime.Platform.getAdapterManager().registerAdapters(new org.eclipse.core.runtime.IAdapterFactory() {
-
- «overrideI(it.editorGen.diagram)»
- @SuppressWarnings("rawtypes")
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (adaptableObject instanceof «qualifiedClassName(it)») {
- «qualifiedClassName(it)» domainNavigatorItem = («qualifiedClassName(it)») adaptableObject;
- org.eclipse.emf.ecore.EObject eObject = domainNavigatorItem.getEObject();
- if (adapterType == org.eclipse.emf.ecore.EObject.class) {
- return eObject;
- }
- if (adapterType == org.eclipse.ui.views.properties.IPropertySource.class) {
- return domainNavigatorItem.getPropertySourceProvider().getPropertySource(eObject);
- }
- }
-
- return null;
- }
-
- «overrideI(it.editorGen.diagram)»
- @SuppressWarnings("rawtypes")
- public Class[] getAdapterList() {
- return supportedTypes;
- }
- }, «qualifiedClassName(it)».class);
- }
- '''
-
-
-}
+/**
+ * Copyright (c) 2007, 2009, 2013 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) - #386838 - migrate to Xtend2
+ */
+package aspects.xpt.navigator
+
+import com.google.inject.Inject
+import org.eclipse.gmf.codegen.gmfgen.GenNavigator
+import xpt.Common
+import xpt.CodeStyle
+
+@com.google.inject.Singleton class DomainNavigatorItem extends xpt.navigator.DomainNavigatorItem {
+ @Inject extension Common;
+ @Inject extension CodeStyle
+
+ override def registerAdapterFactory(GenNavigator it) '''
+ «generatedMemberComment()»
+ static {
+ @SuppressWarnings("rawtypes")
+ final Class[] supportedTypes = new Class[] { org.eclipse.emf.ecore.EObject.class, org.eclipse.ui.views.properties.IPropertySource.class };
+ org.eclipse.core.runtime.Platform.getAdapterManager().registerAdapters(new org.eclipse.core.runtime.IAdapterFactory() {
+
+ «overrideI(it.editorGen.diagram)»
+ @SuppressWarnings("rawtypes")
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ if (adaptableObject instanceof «qualifiedClassName(it)») {
+ «qualifiedClassName(it)» domainNavigatorItem = («qualifiedClassName(it)») adaptableObject;
+ org.eclipse.emf.ecore.EObject eObject = domainNavigatorItem.getEObject();
+ if (adapterType == org.eclipse.emf.ecore.EObject.class) {
+ return eObject;
+ }
+ if (adapterType == org.eclipse.ui.views.properties.IPropertySource.class) {
+ return domainNavigatorItem.getPropertySourceProvider().getPropertySource(eObject);
+ }
+ }
+
+ return null;
+ }
+
+ «overrideI(it.editorGen.diagram)»
+ @SuppressWarnings("rawtypes")
+ public Class[] getAdapterList() {
+ return supportedTypes;
+ }
+ }, «qualifiedClassName(it)».class);
+ }
+ '''
+
+
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/NavigatorContentProvider.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/NavigatorContentProvider.xtend
index 4bf150c60d5..7a3a47a1c69 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/NavigatorContentProvider.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/NavigatorContentProvider.xtend
@@ -11,7 +11,7 @@
* Michael Golubev (Montages) - #386838 - migrate to Xtend2
* Modified by Patrick Tessier (CEA LIST)
* Emilien Perico (Atos Origin) - update template for GMF 2.2 compliance
- */
+ */
package aspects.xpt.navigator
import aspects.xpt.Common
@@ -26,16 +26,16 @@ import xpt.Common_qvto
import xpt.editor.VisualIDRegistry
import xpt.navigator.Utils_qvto
-@Singleton class NavigatorContentProvider extends xpt.navigator.NavigatorContentProvider {
- @Inject extension Common;
- @Inject extension Common_qvto;
- @Inject extension Utils_qvto;
+@Singleton class NavigatorContentProvider extends xpt.navigator.NavigatorContentProvider {
+ @Inject extension Common;
+ @Inject extension Common_qvto;
+ @Inject extension Utils_qvto;
@Inject extension CodeStyle
- @Inject VisualIDRegistry xptVisualIDRegistry;
-
-
- override NavigatorContentProvider(GenNavigator it) '''
+ @Inject VisualIDRegistry xptVisualIDRegistry;
+
+
+ override NavigatorContentProvider(GenNavigator it) '''
«copyright(editorGen)»
package «packageName(it)»;
@@ -60,11 +60,11 @@ import xpt.navigator.Utils_qvto
«additions(it)»
}
- '''
-
-
-
- override processChanges(GenNavigator it) '''
+ '''
+
+
+
+ override processChanges(GenNavigator it) '''
for (java.util.Iterator<org.eclipse.emf.ecore.resource.Resource> it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
org.eclipse.emf.ecore.resource.Resource nextResource = it.next();
nextResource.unload();
@@ -73,8 +73,8 @@ import xpt.navigator.Utils_qvto
myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
}
return true;
- '''
-
+ '''
+
override def initCommonAttributes(GenNavigator it) '''
org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain = «createEditingDomain(it)»;
myEditingDomain = (org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain) editingDomain;
@@ -129,9 +129,9 @@ import xpt.navigator.Utils_qvto
public «className(it)»() {
«initCommonAttributes(it)»
}
- '''
-
- override dispose(GenNavigator it) '''
+ '''
+
+ override dispose(GenNavigator it) '''
«generatedMemberComment()»
public void dispose() {
myWorkspaceSynchronizer.dispose();
@@ -146,35 +146,35 @@ import xpt.navigator.Utils_qvto
((org.eclipse.emf.transaction.TransactionalEditingDomain) myEditingDomain).dispose();
myEditingDomain = null;
}
- '''
-
-
-
- override getFileChildren(GenNavigator it) '''
+ '''
+
+
+
+ override getFileChildren(GenNavigator it) '''
«var references = getChildReferencesFrom(it, null)»
«getFileResource(it)»
java.util.Collection<Object> result = new java.util.ArrayList<Object>();
- «FOR groupName : getGroupNames(references)»
+ «FOR groupName : getGroupNames(references)»
«initGroupVariables(groupName, it, references, 'file', null)»
- «ENDFOR»
+ «ENDFOR»
java.util.List<org.eclipse.gmf.runtime.notation.View> topViews = new java.util.ArrayList<org.eclipse.gmf.runtime.notation.View>(resource.getContents().size());
for (org.eclipse.emf.ecore.EObject o : resource.getContents()) {
if (o instanceof org.eclipse.gmf.runtime.notation.View) {
topViews.add((org.eclipse.gmf.runtime.notation.View) o);
}
}
- «FOR ref : references»
+ «FOR ref : references»
«addNavigatorItemsPrefix(ref)»selectViewsByType(resource.getContents(), «getChildViewType(ref.child)»)«addNavigatorItemsSuffix(ref, 'file', false)»
- «ENDFOR»
- «FOR groupName : getGroupNames(references)»
+ «ENDFOR»
+ «FOR groupName : getGroupNames(references)»
«addGroups(groupName, references)»
- «ENDFOR»
+ «ENDFOR»
return result.toArray();
- '''
-
-
-
- override getViewChildren(GenNavigator it) '''
+ '''
+
+
+
+ override getViewChildren(GenNavigator it) '''
«generatedMemberComment()»
private Object[] getViewChildren(org.eclipse.gmf.runtime.notation.View view, Object parentElement) {
String vid = «xptVisualIDRegistry.getVisualIDMethodCall(it.editorGen.diagram)»(view);
@@ -182,17 +182,17 @@ import xpt.navigator.Utils_qvto
switch (vid) {
««« BEGIN: PapyrusGenCode
««« Restructuration of the case
- «FOR node : getNavigatorContainerNodes(it)»
+ «FOR node : getNavigatorContainerNodes(it)»
«caseNavigatorNode(node, it)»
«ENDFOR»
- «««BEGIN: PapyrusGenCode
+ «««BEGIN: PapyrusGenCode
}
}
return EMPTY_ARRAY;
}
- '''
-
- override utilityMethods(GenNavigator it) '''
+ '''
+
+ override utilityMethods(GenNavigator it) '''
«IF getNavigatorContainerNodes(it).notEmpty»
«generatedMemberComment»
private java.util.Collection getLinksSourceByType(java.util.Collection edges, String type) {
@@ -288,10 +288,10 @@ import xpt.navigator.Utils_qvto
«getForeignShortcuts(it)»
- '''
-
- override getForeignShortcuts(GenNavigator it) '''
- «IF editorGen.diagram.generateCreateShortcutAction() && getChildReferencesFrom(it, editorGen.diagram).notEmpty»
+ '''
+
+ override getForeignShortcuts(GenNavigator it) '''
+ «IF editorGen.diagram.generateCreateShortcutAction() && getChildReferencesFrom(it, editorGen.diagram).notEmpty»
«generatedMemberComment()»
private java.util.Collection getForeignShortcuts(org.eclipse.gmf.runtime.notation.Diagram diagram, Object parent) {
@@ -304,12 +304,12 @@ import xpt.navigator.Utils_qvto
}
return createNavigatorItems(result, parent, false);
}
- «ENDIF»
- '''
-
-
-
- override caseNavigatorNode(GenCommonBase it, GenNavigator navigator) '''
+ «ENDIF»
+ '''
+
+
+
+ override caseNavigatorNode(GenCommonBase it, GenNavigator navigator) '''
case «VisualIDRegistry::visualID(it)»: {
«««BEGIN: PapyrusGenCode
@@ -321,7 +321,7 @@ import xpt.navigator.Utils_qvto
'''
override createEditingDomain(GenNavigator it) '''org.eclipse.emf.workspace.WorkspaceEditingDomainFactory.INSTANCE.createEditingDomain()'''
-
+
//BEGIN: PapyrusGenCode
//Loop to call generator of each method
def genAllMethodNodeCase(GenNavigator it)'''
@@ -387,5 +387,5 @@ override def String i18nKeyForGroup(String groupName, GenCommonBase contextEleme
CodeGenUtil::validJavaIdentifier(groupName)
}
-//END: PapyrusGenCod
-}
+//END: PapyrusGenCod
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/NavigatorGroup.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/NavigatorGroup.xtend
index 33d56d921da..a700b38c498 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/NavigatorGroup.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/NavigatorGroup.xtend
@@ -1,40 +1,40 @@
-/**
- * Copyright (c) 2007, 2009, 2013 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) - #386838 - migrate to Xtend2
- */
-package aspects.xpt.navigator
-
-import com.google.inject.Inject
-import org.eclipse.gmf.codegen.gmfgen.GenNavigator
-import xpt.Common
-
-@com.google.inject.Singleton class NavigatorGroup extends xpt.navigator.NavigatorGroup {
- @Inject extension Common;
-
- override def attributes(GenNavigator it) '''
- «generatedMemberComment()»
- private String myGroupName;
-
- «generatedMemberComment()»
- private String myIcon;
-
- «generatedMemberComment()»
- private java.util.Collection<java.lang.Object> myChildren = new java.util.LinkedList<java.lang.Object>();
- '''
-
- override def addChildren(GenNavigator it) '''
- «generatedMemberComment()»
- public void addChildren(java.util.Collection<java.lang.Object> children) {
- myChildren.addAll(children);
- }
- '''
-
-}
+/**
+ * Copyright (c) 2007, 2009, 2013 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) - #386838 - migrate to Xtend2
+ */
+package aspects.xpt.navigator
+
+import com.google.inject.Inject
+import org.eclipse.gmf.codegen.gmfgen.GenNavigator
+import xpt.Common
+
+@com.google.inject.Singleton class NavigatorGroup extends xpt.navigator.NavigatorGroup {
+ @Inject extension Common;
+
+ override def attributes(GenNavigator it) '''
+ «generatedMemberComment()»
+ private String myGroupName;
+
+ «generatedMemberComment()»
+ private String myIcon;
+
+ «generatedMemberComment()»
+ private java.util.Collection<java.lang.Object> myChildren = new java.util.LinkedList<java.lang.Object>();
+ '''
+
+ override def addChildren(GenNavigator it) '''
+ «generatedMemberComment()»
+ public void addChildren(java.util.Collection<java.lang.Object> children) {
+ myChildren.addAll(children);
+ }
+ '''
+
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/NavigatorItem.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/NavigatorItem.xtend
index 2580c603b74..8f3292085b9 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/NavigatorItem.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/navigator/NavigatorItem.xtend
@@ -10,11 +10,11 @@
* Alexander Shatalin (Borland) - initial API and implementation
* Michael Golubev (Montages) - #386838 - migrate to Xtend2
*/
-package aspects.xpt.navigator
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenNavigator
+package aspects.xpt.navigator
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenNavigator
import xpt.Common import xpt.CodeStyle
@Singleton class NavigatorItem extends xpt.navigator.NavigatorItem {
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/plugin/ActivatorImpl.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/plugin/ActivatorImpl.xtend
index 3d01ab3323c..124ae49cc9a 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/plugin/ActivatorImpl.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/plugin/ActivatorImpl.xtend
@@ -1,16 +1,16 @@
-package aspects.xpt.plugin
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
+package aspects.xpt.plugin
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator
import org.eclipse.gmf.codegen.gmfgen.GenExpressionInterpreter
-import org.eclipse.gmf.codegen.gmfgen.GenPlugin
-import plugin.Activator
-import xpt.Common
+import org.eclipse.gmf.codegen.gmfgen.GenPlugin
+import plugin.Activator
+import xpt.Common
import xpt.editor.DocumentProvider
import xpt.providers.ElementInitializers
import xpt.expressions.getExpression
-
+
@Singleton class ActivatorImpl extends xpt.plugin.ActivatorImpl {
@Inject extension Common;
@@ -30,9 +30,9 @@ import xpt.expressions.getExpression
«constructor(it)»
«start(it)»
«stop(editorGen)»
- «getInstance(it)»
-
- «getPreferenceStore»
+ «getInstance(it)»
+
+ «getPreferenceStore»
«getItemProvidersAdaptorFactory(it)»
«getItemImageDescriptor(it)»
@@ -67,7 +67,7 @@ override attrs(GenPlugin it)'''
private static «xptActivator.className(it)» instance;
«generatedMemberComment»
- private org.eclipse.emf.common.notify.AdapterFactory adapterFactory;
+ private org.eclipse.emf.common.notify.AdapterFactory adapterFactory;
«generatedMemberComment»
private «xptDocProvider.qualifiedClassName(editorGen.diagram)» documentProvider;
@@ -102,7 +102,7 @@ override start(GenPlugin it)'''
}
'''
-
+
override stop(GenEditorGenerator it)'''
«generatedMemberComment»
public void stop(org.osgi.framework.BundleContext context) throws Exception {
@@ -121,13 +121,13 @@ override stop(GenEditorGenerator it)'''
}
'''
-def getPreferenceStore()'''
- «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;
- }
-
+def getPreferenceStore()'''
+ «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;
+ }
+
'''
override logError(GenPlugin it) '''
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/plugin/plugin.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/plugin/plugin.xtend
index 962deb0b53d..a9070fe132a 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/plugin/plugin.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/plugin/plugin.xtend
@@ -1,39 +1,39 @@
-/*****************************************************************************
- * Copyright (c) 2017 CEA LIST, ALL4TEC 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:
- * CEA LIST - initial API and implementation
- * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Bug 510587: the palette must not be generated by using GMF gen
- *****************************************************************************/
-package aspects.xpt.plugin
-
-import aspects.xpt.Common
-import aspects.xpt.editor.palette.Utils_qvto
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import java.util.Iterator
-import java.util.List
-import org.eclipse.emf.ecore.EObject
-import org.eclipse.gmf.codegen.gmfgen.AbstractToolEntry
-import org.eclipse.gmf.codegen.gmfgen.GenCompartment
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator
-import org.eclipse.gmf.codegen.gmfgen.GenExternalNodeLabel
-import org.eclipse.gmf.codegen.gmfgen.GenLink
-import org.eclipse.gmf.codegen.gmfgen.GenLinkLabel
-import org.eclipse.gmf.codegen.gmfgen.GenPlugin
-import org.eclipse.gmf.codegen.gmfgen.ToolEntry
-import org.eclipse.gmf.codegen.gmfgen.ToolGroup
-import org.eclipse.papyrus.papyrusgmfgenextension.ExtendedGenView
-import org.eclipse.papyrus.papyrusgmfgenextension.LabelVisibilityPreference
-import xpt.editor.extensions
-import xpt.plugin.pluginUtils
-import java.io.File
-
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST, ALL4TEC 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:
+ * CEA LIST - initial API and implementation
+ * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Bug 510587: the palette must not be generated by using GMF gen
+ *****************************************************************************/
+package aspects.xpt.plugin
+
+import aspects.xpt.Common
+import aspects.xpt.editor.palette.Utils_qvto
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import java.util.Iterator
+import java.util.List
+import org.eclipse.emf.ecore.EObject
+import org.eclipse.gmf.codegen.gmfgen.AbstractToolEntry
+import org.eclipse.gmf.codegen.gmfgen.GenCompartment
+import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator
+import org.eclipse.gmf.codegen.gmfgen.GenExternalNodeLabel
+import org.eclipse.gmf.codegen.gmfgen.GenLink
+import org.eclipse.gmf.codegen.gmfgen.GenLinkLabel
+import org.eclipse.gmf.codegen.gmfgen.GenPlugin
+import org.eclipse.gmf.codegen.gmfgen.ToolEntry
+import org.eclipse.gmf.codegen.gmfgen.ToolGroup
+import org.eclipse.papyrus.papyrusgmfgenextension.ExtendedGenView
+import org.eclipse.papyrus.papyrusgmfgenextension.LabelVisibilityPreference
+import xpt.editor.extensions
+import xpt.plugin.pluginUtils
+import java.io.File
+
@Singleton class plugin extends xpt.plugin.plugin {
@Inject extension Common
@@ -72,34 +72,34 @@ import java.io.File
«extensionsConstraintProviders(it.editorGen)»
«xptUpdaterExtension.extensions(it.editorGen.diagramUpdater)»
«xptActionExtension.Main(it.editorGen)»
- «additions(it)»
- «notationTypesMap(editorGen)»
-««« «paletteConfiguration(editorGen)»
+ «additions(it)»
+ «notationTypesMap(editorGen)»
+««« «paletteConfiguration(editorGen)»
</plugin>
- '''
-
-
- /**
- * deprecated: palette configuration are now declared through architecture model.
- */
- def paletteConfiguration(GenEditorGenerator it) '''
-<extension point="org.eclipse.papyrus.infra.gmfdiag.common.paletteDefinition">
- «xmlGeneratedTag»
- <paletteDefinition
- ID="«plugin.ID».paletteconfiguration"
- class="org.eclipse.papyrus.infra.gmfdiag.common.service.palette.ExtendedPluginPaletteProvider"
- name="«plugin.name» Palette"
- path="«relativePath»/«modelID».paletteconfiguration"
- provider="Eclipse Modeling Project">
- <Priority
- name="Lowest">
- </Priority>
- <!-- Specify diagram to which this palette tool relates -->
- <editor
- id="«plugin.ID»">
- </editor>
- </paletteDefinition>
-</extension>
+ '''
+
+
+ /**
+ * deprecated: palette configuration are now declared through architecture model.
+ */
+ def paletteConfiguration(GenEditorGenerator it) '''
+<extension point="org.eclipse.papyrus.infra.gmfdiag.common.paletteDefinition">
+ «xmlGeneratedTag»
+ <paletteDefinition
+ ID="«plugin.ID».paletteconfiguration"
+ class="org.eclipse.papyrus.infra.gmfdiag.common.service.palette.ExtendedPluginPaletteProvider"
+ name="«plugin.name» Palette"
+ path="«relativePath»/«modelID».paletteconfiguration"
+ provider="Eclipse Modeling Project">
+ <Priority
+ name="Lowest">
+ </Priority>
+ <!-- Specify diagram to which this palette tool relates -->
+ <editor
+ id="«plugin.ID»">
+ </editor>
+ </paletteDefinition>
+</extension>
'''
override additions(GenPlugin it) ''''''
@@ -150,7 +150,7 @@ import java.io.File
<predefinedEntry id="standardGroup/noteStack/textTool" remove="true"/>
<predefinedEntry id="standardGroup/noteStack/noteattachmentTool" remove="true"/>
- «FOR tool : diagram.palette.groups»
+ «FOR tool : diagram.palette.groups»
«groupUsage(tool)»
«ENDFOR»
</contribution>
@@ -161,54 +161,54 @@ import java.io.File
'''
def groupUsage(ToolGroup it) '''
- <entry
- description="«it.description»"
- id=«IF isQuoted(id,'"')»«id»«ELSE»"«id»"«ENDIF»
- kind="«IF it.stack && it.toolsOnly»stack«ELSE»drawer«ENDIF»"
- label="«it.title»"
- large_icon="«largeIconPath»"
- path="«getPath(it)»"
- small_icon="«smallIconPath»">
- <expand
- force="true">
- </expand>
- </entry>
- ««« TODO: call sub entries...
- «FOR entry : it.entries.filter[e| e instanceof ToolEntry]»
- «toolUsage(entry, it)»
- «ENDFOR»
- «FOR entry : it.entries.filter[e| e instanceof ToolGroup]»
- «toolUsage(entry, it)»
- «ENDFOR»
+ <entry
+ description="«it.description»"
+ id=«IF isQuoted(id,'"')»«id»«ELSE»"«id»"«ENDIF»
+ kind="«IF it.stack && it.toolsOnly»stack«ELSE»drawer«ENDIF»"
+ label="«it.title»"
+ large_icon="«largeIconPath»"
+ path="«getPath(it)»"
+ small_icon="«smallIconPath»">
+ <expand
+ force="true">
+ </expand>
+ </entry>
+ ««« TODO: call sub entries...
+ «FOR entry : it.entries.filter[e| e instanceof ToolEntry]»
+ «toolUsage(entry, it)»
+ «ENDFOR»
+ «FOR entry : it.entries.filter[e| e instanceof ToolGroup]»
+ «toolUsage(entry, it)»
+ «ENDFOR»
'''
-
- private def getPath(ToolEntry it) {
- return buildPath(it.eContainer);
- }
-
- private def getPath(ToolGroup it) {
- return buildPath(it.eContainer);
- }
-
- private def buildPath(EObject it) {
- var path = new StringBuilder();
- var container = it;
- while (container instanceof ToolGroup) {
- path.insert(0, getToolPath((container as ToolGroup).id));
- container = container.eContainer;
- }
- return if(path.length() != 0) path.toString else "/" ;
- }
-
- def dispatch toolUsage(ToolEntry it, ToolGroup group) '''
- <predefinedEntry
- id=«IF isQuoted(id,'"')»«id»«ELSE»"«id»"«ENDIF»
- path="«getPath(it)»">
- </predefinedEntry>
- '''
-
- def dispatch toolUsage(ToolGroup it, ToolGroup group) '''
- «groupUsage(it)»
+
+ private def getPath(ToolEntry it) {
+ return buildPath(it.eContainer);
+ }
+
+ private def getPath(ToolGroup it) {
+ return buildPath(it.eContainer);
+ }
+
+ private def buildPath(EObject it) {
+ var path = new StringBuilder();
+ var container = it;
+ while (container instanceof ToolGroup) {
+ path.insert(0, getToolPath((container as ToolGroup).id));
+ container = container.eContainer;
+ }
+ return if(path.length() != 0) path.toString else "/" ;
+ }
+
+ def dispatch toolUsage(ToolEntry it, ToolGroup group) '''
+ <predefinedEntry
+ id=«IF isQuoted(id,'"')»«id»«ELSE»"«id»"«ENDIF»
+ path="«getPath(it)»">
+ </predefinedEntry>
+ '''
+
+ def dispatch toolUsage(ToolGroup it, ToolGroup group) '''
+ «groupUsage(it)»
'''
def predefinedEntryDefinition(AbstractToolEntry it) '''
@@ -222,71 +222,71 @@ import java.io.File
path=""
small_icon="«smallIconPath»">
</entry>
- '''
-
- // set notation type mapping extension point
- def notationTypesMap(GenEditorGenerator it) '''
-«tripleSpace(0)»<extension point="org.eclipse.papyrus.infra.gmfdiag.common.notationTypesMapping">
-«tripleSpace(1)»«xmlGeneratedTag»
-«tripleSpace(1)»<diagramMappings diagramID="«modelID»">
-«tripleSpace(1)» <mapping type="«modelID»" humanReadableType="«modelID.replaceAll('Papyrus|UML|Diagram', '')»Diagram"/>
- «FOR compartment : diagram.compartments»
- «compartmentToTypeMap(compartment)»
- «ENDFOR»
- «FOR link : diagram.links»
- «linksToTypeMap(link)»
- «ENDFOR»
- «FOR externalLabel : diagram.eResource.allContents.filter(typeof (GenExternalNodeLabel)).toIterable»
- «floatingLabelToTypeMap(externalLabel)»
- «externalNodeLabelToTypeMap(externalLabel)»
- «ENDFOR»
-«tripleSpace(1)»</diagramMappings>
-«tripleSpace(0)»</extension>
- '''
- def compartmentToTypeMap(GenCompartment it) '''
- <mapping
- humanReadableType="«title.replaceAll('Compartment', '')»"
- type="«stringVisualID»">
- </mapping>
- '''
-
- def linksToTypeMap(GenLink it) '''
- «FOR label : labels»
- «linkLabelToTypeMap(label)»
- «ENDFOR»
- '''
-
- def linkLabelToTypeMap(GenLinkLabel it)'''
- ««« it is used on a LabelVisibilityPreference...
- «LabelVisibilityPreferenceToTypeMap(it.eResource.allContents.filter(typeof (LabelVisibilityPreference)).filter[v | v.linkLabels != null && v.linkLabels.contains(it) && v.role != null], stringVisualID)»
- '''
-
- def externalNodeLabelToTypeMap(GenExternalNodeLabel it)'''
- «LabelVisibilityPreferenceToTypeMap(it.eResource.allContents.filter(typeof (LabelVisibilityPreference)).filter[v | v.externalNodeLabels != null && v.externalNodeLabels.contains(it) && v.role != null],stringVisualID)»
- '''
-
- def LabelVisibilityPreferenceToTypeMap(Iterator<LabelVisibilityPreference> it, String visualID)'''
- «var List<LabelVisibilityPreference> links = it.toList»
- «IF links.size != 0»
- <mapping
- humanReadableType="«links.get(0).role»"
- type="«visualID»">
- </mapping>
- «ENDIF»
- '''
-
- def floatingLabelToTypeMap(GenExternalNodeLabel it)'''
- ««« it is used on a ExtensionGenView...
- «IF it.eResource.allContents.filter(typeof (ExtendedGenView)).filter[v | v.genView.contains(it) && v.superOwnedEditPart != null].size != 0»
- «FOR extendedObject : it.eResource.allContents.filter(typeof (ExtendedGenView)).filter[v|v.genView.contains(it) && v.superOwnedEditPart != null].toIterable»
- «««...to be extended as floatingLabel
- «IF "FloatingLabelEditPart".equals(extendedObject.name) »
- <mapping
- humanReadableType="Floating Label"
- type="«stringVisualID»">
- </mapping>
- «ENDIF»
- «ENDFOR»
- «ENDIF»
- '''
+ '''
+
+ // set notation type mapping extension point
+ def notationTypesMap(GenEditorGenerator it) '''
+«tripleSpace(0)»<extension point="org.eclipse.papyrus.infra.gmfdiag.common.notationTypesMapping">
+«tripleSpace(1)»«xmlGeneratedTag»
+«tripleSpace(1)»<diagramMappings diagramID="«modelID»">
+«tripleSpace(1)» <mapping type="«modelID»" humanReadableType="«modelID.replaceAll('Papyrus|UML|Diagram', '')»Diagram"/>
+ «FOR compartment : diagram.compartments»
+ «compartmentToTypeMap(compartment)»
+ «ENDFOR»
+ «FOR link : diagram.links»
+ «linksToTypeMap(link)»
+ «ENDFOR»
+ «FOR externalLabel : diagram.eResource.allContents.filter(typeof (GenExternalNodeLabel)).toIterable»
+ «floatingLabelToTypeMap(externalLabel)»
+ «externalNodeLabelToTypeMap(externalLabel)»
+ «ENDFOR»
+«tripleSpace(1)»</diagramMappings>
+«tripleSpace(0)»</extension>
+ '''
+ def compartmentToTypeMap(GenCompartment it) '''
+ <mapping
+ humanReadableType="«title.replaceAll('Compartment', '')»"
+ type="«stringVisualID»">
+ </mapping>
+ '''
+
+ def linksToTypeMap(GenLink it) '''
+ «FOR label : labels»
+ «linkLabelToTypeMap(label)»
+ «ENDFOR»
+ '''
+
+ def linkLabelToTypeMap(GenLinkLabel it)'''
+ ««« it is used on a LabelVisibilityPreference...
+ «LabelVisibilityPreferenceToTypeMap(it.eResource.allContents.filter(typeof (LabelVisibilityPreference)).filter[v | v.linkLabels != null && v.linkLabels.contains(it) && v.role != null], stringVisualID)»
+ '''
+
+ def externalNodeLabelToTypeMap(GenExternalNodeLabel it)'''
+ «LabelVisibilityPreferenceToTypeMap(it.eResource.allContents.filter(typeof (LabelVisibilityPreference)).filter[v | v.externalNodeLabels != null && v.externalNodeLabels.contains(it) && v.role != null],stringVisualID)»
+ '''
+
+ def LabelVisibilityPreferenceToTypeMap(Iterator<LabelVisibilityPreference> it, String visualID)'''
+ «var List<LabelVisibilityPreference> links = it.toList»
+ «IF links.size != 0»
+ <mapping
+ humanReadableType="«links.get(0).role»"
+ type="«visualID»">
+ </mapping>
+ «ENDIF»
+ '''
+
+ def floatingLabelToTypeMap(GenExternalNodeLabel it)'''
+ ««« it is used on a ExtensionGenView...
+ «IF it.eResource.allContents.filter(typeof (ExtendedGenView)).filter[v | v.genView.contains(it) && v.superOwnedEditPart != null].size != 0»
+ «FOR extendedObject : it.eResource.allContents.filter(typeof (ExtendedGenView)).filter[v|v.genView.contains(it) && v.superOwnedEditPart != null].toIterable»
+ «««...to be extended as floatingLabel
+ «IF "FloatingLabelEditPart".equals(extendedObject.name) »
+ <mapping
+ humanReadableType="Floating Label"
+ type="«stringVisualID»">
+ </mapping>
+ «ENDIF»
+ «ENDFOR»
+ «ENDIF»
+ '''
}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/MarkerNavigationProvider.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/MarkerNavigationProvider.xtend
index 7adbabfee98..75f9fd4cd94 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/MarkerNavigationProvider.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/MarkerNavigationProvider.xtend
@@ -10,13 +10,13 @@
* Dmitry Stadnik (Borland) - initial API and implementation
* Michael Golubev (Montages) - #386838 - migrate to Xtend2
*/
-package aspects.xpt.providers
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram
-import xpt.Common
-
+package aspects.xpt.providers
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenDiagram
+import xpt.Common
+
@Singleton class MarkerNavigationProvider extends xpt.providers.MarkerNavigationProvider {
@Inject extension Common;
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/extensions.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/extensions.xtend
index b02c8b5d3d3..f8e6615941d 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/extensions.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/xpt/providers/extensions.xtend
@@ -1,225 +1,225 @@
-/**
- * Copyright (c) 2007, 2010, 2013, 2017 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) - #386838 - migrate to Xtend2
- * Vincent Lorenzo (CEA-LIST) - Bug 520882
- */
-package aspects.xpt.providers
-
-import aspects.xpt.Common
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenCommonBase
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram
-import org.eclipse.gmf.codegen.gmfgen.MetamodelType
-import org.eclipse.gmf.codegen.gmfgen.NotationType
-import org.eclipse.gmf.codegen.gmfgen.SpecializationType
-import parsers.ParserProvider
-import xpt.diagram.Utils_qvto
-import xpt.diagram.edithelpers.EditHelper
-import xpt.diagram.edithelpers.EditHelperAdvice
-import xpt.providers.ShortcutsDecoratorProvider
-
-@Singleton class extensions extends xpt.providers.extensions {
- @Inject extension Common;
- @Inject extension Utils_qvto;
-
- @Inject ViewProvider viewProvider;
- @Inject xpt.providers.IconProvider iconProvider;
- @Inject xpt.providers.EditPartProvider editPartProvider;
- @Inject ParserProvider labelParsers;
- @Inject ShortcutsDecoratorProvider shorcutProvider;
- @Inject VisualTypeProvider visualTypeProvider;
- @Inject EditHelper editHelper;
- @Inject EditHelperAdvice editHelperAdvice;
-
- override extensions(GenDiagram it) '''
- «extraLineBreak»
- «tripleSpace(1)»<extension point="org.eclipse.gmf.runtime.diagram.core.viewProviders" id="view-provider">
- «tripleSpace(2)»«xmlGeneratedTag»
- «tripleSpace(2)»<viewProvider class="«viewProvider.qualifiedClassName(it)»">
- «tripleSpace(3)»<Priority name="«notationViewProviderPriority»"/>
- «IF ! shortcutsProvidedFor.empty/*allow provider activation when another diagram tries to create a node, perhaps ours*/»
- «tripleSpace(3)»<object id="referencing-diagrams" class="org.eclipse.gmf.runtime.notation.Diagram">
- «tripleSpace(4)»<method name="getType()" value="«FOR s : shortcutsProvidedFor SEPARATOR ','»«s»«ENDFOR»"/>
- «tripleSpace(3)»</object>
- «tripleSpace(3)»<context viewClass="org.eclipse.gmf.runtime.notation.Node" containerViews="referencing-diagrams"/>
- «ENDIF»
- «tripleSpace(3)»<context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="«editorGen.modelID»"/>
- «tripleSpace(3)»<context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="«commaSeparatedVisualIDs(allNodes)»"/>
- «IF ! links.empty/*it is unlikely there would be a diagram without a node, but a diagram without links deemed possible */»
- «tripleSpace(3)»<context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="«commaSeparatedVisualIDs(links)»"/>
- «ENDIF»
- «tripleSpace(2)»</viewProvider>
- «tripleSpace(1)»</extension>
-
- «tripleSpace(1)»<extension point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders" id="ep-provider">
- «tripleSpace(2)»«xmlGeneratedTag»
- «tripleSpace(2)»<editpartProvider class="«editPartProvider.qualifiedClassName(it)»">
- «tripleSpace(3)»<Priority name="«editPartProviderPriority»"/>
- «tripleSpace(3)»<object class="org.eclipse.gmf.runtime.notation.Diagram" id="generated-diagram">
- «tripleSpace(4)»<method name="getType()" value="«editorGen.modelID»"/>
- «tripleSpace(3)»</object>
- «tripleSpace(3)»<object class="org.eclipse.gmf.runtime.notation.Node" id="generated-nodes">
- «tripleSpace(4)»<method name="getType()" value="«commaSeparatedVisualIDs(allNodes)»"/>
- «tripleSpace(3)»</object>
- «tripleSpace(3)»<object class="org.eclipse.gmf.runtime.notation.Edge" id="generated-links">
- «tripleSpace(4)»<method name="getType()" value="«commaSeparatedVisualIDs(links)»"/>
- «tripleSpace(3)»</object>
- «tripleSpace(3)»<object class="org.eclipse.gmf.runtime.notation.Node" id="generated-labels">
- «tripleSpace(4)»<method name="getType()" value="«commaSeparatedVisualIDs(allNodes.map[n|n.labels].flatten)»"/>
- «tripleSpace(3)»</object>
- «tripleSpace(3)»<object class="org.eclipse.gmf.runtime.notation.Node" id="generated-compartments">
- «tripleSpace(4)»<method name="getType()" value="«commaSeparatedVisualIDs(compartments)»"/>
- «tripleSpace(3)»</object>
- «tripleSpace(3)»<context views="generated-diagram,generated-nodes,generated-links,generated-labels,generated-compartments"/>
- «tripleSpace(2)»</editpartProvider>
- «tripleSpace(1)»</extension>
-
-««« «modelingAssistantProvider(it)»
-
- «tripleSpace(1)»<extension point="org.eclipse.gmf.runtime.common.ui.services.iconProviders" id="icon-provider">
- «tripleSpace(2)»«xmlGeneratedTag»
- «tripleSpace(2)»<IconProvider class="«iconProvider.qualifiedClassName(it)»">
- «tripleSpace(3)»<Priority name="«iconProviderPriority»"/>
- «tripleSpace(2)»</IconProvider>
- «tripleSpace(1)»</extension>
- «IF editorGen.labelParsers != null && editorGen.labelParsers.extensibleViaService»
- «extraLineBreak»
- «tripleSpace(1)»<extension point="org.eclipse.gmf.runtime.common.ui.services.parserProviders" id="parser-provider">
- «tripleSpace(2)»«xmlGeneratedTag»
- «tripleSpace(2)»<ParserProvider class="«labelParsers.qualifiedClassName(editorGen.labelParsers)»">
- «tripleSpace(3)»<Priority name="«editorGen.labelParsers.providerPriority»"/>
- «tripleSpace(2)»</ParserProvider>
- «tripleSpace(1)»</extension>
- «ENDIF»
- «IF generateShortcutIcon()»
- «extraLineBreak»
- «tripleSpace(1)»<extension point="org.eclipse.gmf.runtime.diagram.ui.decoratorProviders" id="decorator-provider">
- «tripleSpace(2)»«xmlGeneratedTag»
- «tripleSpace(2)»<decoratorProvider class="«shorcutProvider.qualifiedClassName(it)»">
- «tripleSpace(3)»<Priority name="«shortcutsDecoratorProviderPriority»"/>
- «tripleSpace(3)»<object class="org.eclipse.gmf.runtime.notation.Node(org.eclipse.gmf.runtime.notation)" id="generated-top-nodes">
- «tripleSpace(4)»<method name="getType()" value="«commaSeparatedVisualIDs(it.topLevelNodes)/*generated code supports shortcuts only to top-level nodes*/»"/>
- «tripleSpace(3)»</object>
- «tripleSpace(3)»<context decoratorTargets="generated-top-nodes"/>
- «tripleSpace(2)»</decoratorProvider>
- «tripleSpace(1)»</extension>
- «ENDIF»
-
-««« commented for bug 520882
-««« «IF !getLocalDefineTypedElements(it).empty»
-««« «tripleSpace(1)»<extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes" id="element-types">
-««« «tripleSpace(2)»«xmlGeneratedTag»
-««« «FOR e : getLocalDefineTypedElements(it)»
-««« «elementTypeSafe(e.elementType)»
-««« «ENDFOR»
-««« «tripleSpace(1)»</extension>
-««« «ENDIF»
-«««
-««« «tripleSpace(1)»<extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings" id="element-types-bindings">
-««« «tripleSpace(2)»«xmlGeneratedTag»
-««« «IF it.eResource.allContents.filter(typeof (GenerateUsingElementTypeCreationCommand)).size<1»
-««« «tripleSpace(2)»<clientContext id="«editorGen.plugin.ID».TypeContext">
-««« «tripleSpace(3)»<enablement>
-««« «tripleSpace(4)»<test
-««« «tripleSpace(5)»property="org.eclipse.gmf.runtime.emf.core.editingDomain"
-««« «tripleSpace(5)»value="«editingDomainID»"/>
-««« «tripleSpace(3)»</enablement>
-««« «tripleSpace(2)»</clientContext>
-««« «tripleSpace(2)»<binding context="«editorGen.plugin.ID».TypeContext">
-««« «ENDIF»
-««« «IF it.eResource.allContents.filter(typeof (GenerateUsingElementTypeCreationCommand)).size>0»
-«««
-««« <binding context="org.eclipse.papyrus.infra.services.edit.TypeContext">
-««« «ENDIF»
-««« «FOR e : getLocalDefineTypedElements(it)»
-««« «tripleSpace(3)»<elementType ref="«e.elementType.uniqueIdentifier»"/>
-««« «ENDFOR»
-««« «tripleSpace(3)»<advice ref="org.eclipse.gmf.runtime.diagram.core.advice.notationDepdendents"/>
-««« «tripleSpace(2)»</binding>
-««« «tripleSpace(1)»</extension>
-
+/**
+ * Copyright (c) 2007, 2010, 2013, 2017 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) - #386838 - migrate to Xtend2
+ * Vincent Lorenzo (CEA-LIST) - Bug 520882
+ */
+package aspects.xpt.providers
+
+import aspects.xpt.Common
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenCommonBase
+import org.eclipse.gmf.codegen.gmfgen.GenDiagram
+import org.eclipse.gmf.codegen.gmfgen.MetamodelType
+import org.eclipse.gmf.codegen.gmfgen.NotationType
+import org.eclipse.gmf.codegen.gmfgen.SpecializationType
+import parsers.ParserProvider
+import xpt.diagram.Utils_qvto
+import xpt.diagram.edithelpers.EditHelper
+import xpt.diagram.edithelpers.EditHelperAdvice
+import xpt.providers.ShortcutsDecoratorProvider
+
+@Singleton class extensions extends xpt.providers.extensions {
+ @Inject extension Common;
+ @Inject extension Utils_qvto;
+
+ @Inject ViewProvider viewProvider;
+ @Inject xpt.providers.IconProvider iconProvider;
+ @Inject xpt.providers.EditPartProvider editPartProvider;
+ @Inject ParserProvider labelParsers;
+ @Inject ShortcutsDecoratorProvider shorcutProvider;
+ @Inject VisualTypeProvider visualTypeProvider;
+ @Inject EditHelper editHelper;
+ @Inject EditHelperAdvice editHelperAdvice;
+
+ override extensions(GenDiagram it) '''
+ «extraLineBreak»
+ «tripleSpace(1)»<extension point="org.eclipse.gmf.runtime.diagram.core.viewProviders" id="view-provider">
+ «tripleSpace(2)»«xmlGeneratedTag»
+ «tripleSpace(2)»<viewProvider class="«viewProvider.qualifiedClassName(it)»">
+ «tripleSpace(3)»<Priority name="«notationViewProviderPriority»"/>
+ «IF ! shortcutsProvidedFor.empty/*allow provider activation when another diagram tries to create a node, perhaps ours*/»
+ «tripleSpace(3)»<object id="referencing-diagrams" class="org.eclipse.gmf.runtime.notation.Diagram">
+ «tripleSpace(4)»<method name="getType()" value="«FOR s : shortcutsProvidedFor SEPARATOR ','»«s»«ENDFOR»"/>
+ «tripleSpace(3)»</object>
+ «tripleSpace(3)»<context viewClass="org.eclipse.gmf.runtime.notation.Node" containerViews="referencing-diagrams"/>
+ «ENDIF»
+ «tripleSpace(3)»<context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="«editorGen.modelID»"/>
+ «tripleSpace(3)»<context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="«commaSeparatedVisualIDs(allNodes)»"/>
+ «IF ! links.empty/*it is unlikely there would be a diagram without a node, but a diagram without links deemed possible */»
+ «tripleSpace(3)»<context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="«commaSeparatedVisualIDs(links)»"/>
+ «ENDIF»
+ «tripleSpace(2)»</viewProvider>
+ «tripleSpace(1)»</extension>
+
+ «tripleSpace(1)»<extension point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders" id="ep-provider">
+ «tripleSpace(2)»«xmlGeneratedTag»
+ «tripleSpace(2)»<editpartProvider class="«editPartProvider.qualifiedClassName(it)»">
+ «tripleSpace(3)»<Priority name="«editPartProviderPriority»"/>
+ «tripleSpace(3)»<object class="org.eclipse.gmf.runtime.notation.Diagram" id="generated-diagram">
+ «tripleSpace(4)»<method name="getType()" value="«editorGen.modelID»"/>
+ «tripleSpace(3)»</object>
+ «tripleSpace(3)»<object class="org.eclipse.gmf.runtime.notation.Node" id="generated-nodes">
+ «tripleSpace(4)»<method name="getType()" value="«commaSeparatedVisualIDs(allNodes)»"/>
+ «tripleSpace(3)»</object>
+ «tripleSpace(3)»<object class="org.eclipse.gmf.runtime.notation.Edge" id="generated-links">
+ «tripleSpace(4)»<method name="getType()" value="«commaSeparatedVisualIDs(links)»"/>
+ «tripleSpace(3)»</object>
+ «tripleSpace(3)»<object class="org.eclipse.gmf.runtime.notation.Node" id="generated-labels">
+ «tripleSpace(4)»<method name="getType()" value="«commaSeparatedVisualIDs(allNodes.map[n|n.labels].flatten)»"/>
+ «tripleSpace(3)»</object>
+ «tripleSpace(3)»<object class="org.eclipse.gmf.runtime.notation.Node" id="generated-compartments">
+ «tripleSpace(4)»<method name="getType()" value="«commaSeparatedVisualIDs(compartments)»"/>
+ «tripleSpace(3)»</object>
+ «tripleSpace(3)»<context views="generated-diagram,generated-nodes,generated-links,generated-labels,generated-compartments"/>
+ «tripleSpace(2)»</editpartProvider>
+ «tripleSpace(1)»</extension>
+
+««« «modelingAssistantProvider(it)»
+
+ «tripleSpace(1)»<extension point="org.eclipse.gmf.runtime.common.ui.services.iconProviders" id="icon-provider">
+ «tripleSpace(2)»«xmlGeneratedTag»
+ «tripleSpace(2)»<IconProvider class="«iconProvider.qualifiedClassName(it)»">
+ «tripleSpace(3)»<Priority name="«iconProviderPriority»"/>
+ «tripleSpace(2)»</IconProvider>
+ «tripleSpace(1)»</extension>
+ «IF editorGen.labelParsers != null && editorGen.labelParsers.extensibleViaService»
+ «extraLineBreak»
+ «tripleSpace(1)»<extension point="org.eclipse.gmf.runtime.common.ui.services.parserProviders" id="parser-provider">
+ «tripleSpace(2)»«xmlGeneratedTag»
+ «tripleSpace(2)»<ParserProvider class="«labelParsers.qualifiedClassName(editorGen.labelParsers)»">
+ «tripleSpace(3)»<Priority name="«editorGen.labelParsers.providerPriority»"/>
+ «tripleSpace(2)»</ParserProvider>
+ «tripleSpace(1)»</extension>
+ «ENDIF»
+ «IF generateShortcutIcon()»
+ «extraLineBreak»
+ «tripleSpace(1)»<extension point="org.eclipse.gmf.runtime.diagram.ui.decoratorProviders" id="decorator-provider">
+ «tripleSpace(2)»«xmlGeneratedTag»
+ «tripleSpace(2)»<decoratorProvider class="«shorcutProvider.qualifiedClassName(it)»">
+ «tripleSpace(3)»<Priority name="«shortcutsDecoratorProviderPriority»"/>
+ «tripleSpace(3)»<object class="org.eclipse.gmf.runtime.notation.Node(org.eclipse.gmf.runtime.notation)" id="generated-top-nodes">
+ «tripleSpace(4)»<method name="getType()" value="«commaSeparatedVisualIDs(it.topLevelNodes)/*generated code supports shortcuts only to top-level nodes*/»"/>
+ «tripleSpace(3)»</object>
+ «tripleSpace(3)»<context decoratorTargets="generated-top-nodes"/>
+ «tripleSpace(2)»</decoratorProvider>
+ «tripleSpace(1)»</extension>
+ «ENDIF»
+
+««« commented for bug 520882
+««« «IF !getLocalDefineTypedElements(it).empty»
+««« «tripleSpace(1)»<extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes" id="element-types">
+««« «tripleSpace(2)»«xmlGeneratedTag»
+««« «FOR e : getLocalDefineTypedElements(it)»
+««« «elementTypeSafe(e.elementType)»
+««« «ENDFOR»
+««« «tripleSpace(1)»</extension>
+««« «ENDIF»
+«««
+««« «tripleSpace(1)»<extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings" id="element-types-bindings">
+««« «tripleSpace(2)»«xmlGeneratedTag»
+««« «IF it.eResource.allContents.filter(typeof (GenerateUsingElementTypeCreationCommand)).size<1»
+««« «tripleSpace(2)»<clientContext id="«editorGen.plugin.ID».TypeContext">
+««« «tripleSpace(3)»<enablement>
+««« «tripleSpace(4)»<test
+««« «tripleSpace(5)»property="org.eclipse.gmf.runtime.emf.core.editingDomain"
+««« «tripleSpace(5)»value="«editingDomainID»"/>
+««« «tripleSpace(3)»</enablement>
+««« «tripleSpace(2)»</clientContext>
+««« «tripleSpace(2)»<binding context="«editorGen.plugin.ID».TypeContext">
+««« «ENDIF»
+««« «IF it.eResource.allContents.filter(typeof (GenerateUsingElementTypeCreationCommand)).size>0»
+«««
+««« <binding context="org.eclipse.papyrus.infra.services.edit.TypeContext">
+««« «ENDIF»
+««« «FOR e : getLocalDefineTypedElements(it)»
+««« «tripleSpace(3)»<elementType ref="«e.elementType.uniqueIdentifier»"/>
+««« «ENDFOR»
+««« «tripleSpace(3)»<advice ref="org.eclipse.gmf.runtime.diagram.core.advice.notationDepdendents"/>
+««« «tripleSpace(2)»</binding>
+««« «tripleSpace(1)»</extension>
+
«extraLineBreak»
«tripleSpace(1)»<extension point="org.eclipse.papyrus.infra.gmfdiag.common.visualTypeProviders">
- «tripleSpace(2)»«xmlGeneratedTag»
+ «tripleSpace(2)»«xmlGeneratedTag»
«tripleSpace(2)»<visualTypeProvider
«tripleSpace(4)»class="«visualTypeProvider.qualifiedClassName(it)»"
«tripleSpace(4)»diagramType="«editorGen.modelID»">
«tripleSpace(3)»</visualTypeProvider>
- «tripleSpace(1)»</extension>
- '''
-
- def getLocalDefineTypedElements(GenDiagram it) {
- getAllTypedElements(it).filter[et| false == et.elementType.definedExternally]
- }
-// override modelingAssistantProvider(GenDiagram it) '''
-//
-// <extension point="org.eclipse.gmf.runtime.emf.ui.modelingAssistantProviders" id="modelassist-provider">
-// «xmlGeneratedTag»
-// <modelingAssistantProvider class="«getModelingAssistantProviderQualifiedClassName()»">
-// <Priority name="«modelingAssistantProviderPriority»"/>
-// <object class="«getEditPartQualifiedClassName()»" id="«getUniqueIdentifier()»"/>
-// «FOR n :topLevelNodes»
-// <object class="«n.getEditPartQualifiedClassName()»" id="«n.getUniqueIdentifier()»"/>
-// «ENDFOR»
-// «FOR n:childNodes»
-// <object class="«n.getEditPartQualifiedClassName()»" id="«n.getUniqueIdentifier()»"/>
-// «ENDFOR»
-// <context elements="«getUniqueIdentifier()»,«FOR n : topLevelNodes SEPARATOR ','»«n.getUniqueIdentifier()»«ENDFOR»,«FOR n : childNodes SEPARATOR ','»«n.getUniqueIdentifier()»«ENDFOR»"/>
-// </modelingAssistantProvider>
-// </extension>
-//
-//
-// '''
-
- override def commaSeparatedVisualIDs(Iterable<? extends GenCommonBase> list) '''«FOR gcb : list SEPARATOR ','»«gcb.stringUniqueIdentifier»«ENDFOR»'''
-
- override def dispatch elementType(MetamodelType it) '''
- «tripleSpace(2)»<metamodel nsURI="«getMetaClass().genPackage.getEcorePackage.nsURI»">
- «tripleSpace(3)»<metamodelType
- «tripleSpace(5)»id="«uniqueIdentifier»"
- «IF null != displayName»
- «tripleSpace(5)»name="%metatype.name.«diagramElement.stringUniqueIdentifier»"
- «ENDIF»
- «tripleSpace(5)»kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- «tripleSpace(5)»eclass="«getMetaClass().ecoreClass.name»"
- «tripleSpace(5)»edithelper="«editHelper.qualifiedClassName(it)»">
- «tripleSpace(4)»<param name="semanticHint" value="«diagramElement.stringVisualID»"/>
- «tripleSpace(3)»</metamodelType>
- «tripleSpace(2)»</metamodel>
- '''
-
- override def specializationType(SpecializationType it) '''
- «tripleSpace(3)»<specializationType
- «tripleSpace(5)»id="«uniqueIdentifier»"
- «IF null != displayName»
- «tripleSpace(5)»name="%metatype.name.«diagramElement.stringUniqueIdentifier»"
- «ENDIF»
- «tripleSpace(5)»kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"«IF editHelperAdviceClassName != null»
- «tripleSpace(5)»edithelperadvice="«editHelperAdvice.qualifiedClassName(it)»"«ENDIF»>
- «tripleSpace(4)»<specializes id="«IF (null == metamodelType)»org.eclipse.gmf.runtime.emf.type.core.null«ELSE»«metamodelType.
- uniqueIdentifier»«ENDIF»"/>
- «tripleSpace(4)»<param name="semanticHint" value="«diagramElement.stringVisualID»"/>
- «tripleSpace(3)»</specializationType>
- '''
-
- override def dispatch elementType(NotationType it) '''
- «tripleSpace(2)»<specializationType
- «tripleSpace(4)»id="«uniqueIdentifier»"
- «IF null != displayName»
- «tripleSpace(4)»name="%metatype.name.«diagramElement.stringUniqueIdentifier»"
- «ENDIF»
- «tripleSpace(4)»kind="org.eclipse.gmf.runtime.diagram.ui.util.INotationType">
- «tripleSpace(3)»<specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- «tripleSpace(3)»<param name="semanticHint" value="«diagramElement.stringVisualID»"/>
- «tripleSpace(2)»</specializationType>
- '''
-}
+ «tripleSpace(1)»</extension>
+ '''
+
+ def getLocalDefineTypedElements(GenDiagram it) {
+ getAllTypedElements(it).filter[et| false == et.elementType.definedExternally]
+ }
+// override modelingAssistantProvider(GenDiagram it) '''
+//
+// <extension point="org.eclipse.gmf.runtime.emf.ui.modelingAssistantProviders" id="modelassist-provider">
+// «xmlGeneratedTag»
+// <modelingAssistantProvider class="«getModelingAssistantProviderQualifiedClassName()»">
+// <Priority name="«modelingAssistantProviderPriority»"/>
+// <object class="«getEditPartQualifiedClassName()»" id="«getUniqueIdentifier()»"/>
+// «FOR n :topLevelNodes»
+// <object class="«n.getEditPartQualifiedClassName()»" id="«n.getUniqueIdentifier()»"/>
+// «ENDFOR»
+// «FOR n:childNodes»
+// <object class="«n.getEditPartQualifiedClassName()»" id="«n.getUniqueIdentifier()»"/>
+// «ENDFOR»
+// <context elements="«getUniqueIdentifier()»,«FOR n : topLevelNodes SEPARATOR ','»«n.getUniqueIdentifier()»«ENDFOR»,«FOR n : childNodes SEPARATOR ','»«n.getUniqueIdentifier()»«ENDFOR»"/>
+// </modelingAssistantProvider>
+// </extension>
+//
+//
+// '''
+
+ override def commaSeparatedVisualIDs(Iterable<? extends GenCommonBase> list) '''«FOR gcb : list SEPARATOR ','»«gcb.stringUniqueIdentifier»«ENDFOR»'''
+
+ override def dispatch elementType(MetamodelType it) '''
+ «tripleSpace(2)»<metamodel nsURI="«getMetaClass().genPackage.getEcorePackage.nsURI»">
+ «tripleSpace(3)»<metamodelType
+ «tripleSpace(5)»id="«uniqueIdentifier»"
+ «IF null != displayName»
+ «tripleSpace(5)»name="%metatype.name.«diagramElement.stringUniqueIdentifier»"
+ «ENDIF»
+ «tripleSpace(5)»kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ «tripleSpace(5)»eclass="«getMetaClass().ecoreClass.name»"
+ «tripleSpace(5)»edithelper="«editHelper.qualifiedClassName(it)»">
+ «tripleSpace(4)»<param name="semanticHint" value="«diagramElement.stringVisualID»"/>
+ «tripleSpace(3)»</metamodelType>
+ «tripleSpace(2)»</metamodel>
+ '''
+
+ override def specializationType(SpecializationType it) '''
+ «tripleSpace(3)»<specializationType
+ «tripleSpace(5)»id="«uniqueIdentifier»"
+ «IF null != displayName»
+ «tripleSpace(5)»name="%metatype.name.«diagramElement.stringUniqueIdentifier»"
+ «ENDIF»
+ «tripleSpace(5)»kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"«IF editHelperAdviceClassName != null»
+ «tripleSpace(5)»edithelperadvice="«editHelperAdvice.qualifiedClassName(it)»"«ENDIF»>
+ «tripleSpace(4)»<specializes id="«IF (null == metamodelType)»org.eclipse.gmf.runtime.emf.type.core.null«ELSE»«metamodelType.
+ uniqueIdentifier»«ENDIF»"/>
+ «tripleSpace(4)»<param name="semanticHint" value="«diagramElement.stringVisualID»"/>
+ «tripleSpace(3)»</specializationType>
+ '''
+
+ override def dispatch elementType(NotationType it) '''
+ «tripleSpace(2)»<specializationType
+ «tripleSpace(4)»id="«uniqueIdentifier»"
+ «IF null != displayName»
+ «tripleSpace(4)»name="%metatype.name.«diagramElement.stringUniqueIdentifier»"
+ «ENDIF»
+ «tripleSpace(4)»kind="org.eclipse.gmf.runtime.diagram.ui.util.INotationType">
+ «tripleSpace(3)»<specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
+ «tripleSpace(3)»<param name="semanticHint" value="«diagramElement.stringVisualID»"/>
+ «tripleSpace(2)»</specializationType>
+ '''
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/utils/EditHelperUtils_qvto.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/utils/EditHelperUtils_qvto.xtend
index 41cd5bb2084..803f5520deb 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/utils/EditHelperUtils_qvto.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/utils/EditHelperUtils_qvto.xtend
@@ -1,18 +1,18 @@
-
-package utils
-
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram
-import org.eclipse.papyrus.papyrusgmfgenextension.AdditionalEditPartCandies
-
-@Singleton class EditHelperUtils_qvto {
-
- def String getBaseEditHelperFullName(GenDiagram diagram) {
- if(!(diagram.eResource.allContents.filter(typeof(AdditionalEditPartCandies)).empty)) {
- return diagram.eResource.allContents.filter(typeof(AdditionalEditPartCandies)).head.baseEditHelperPackage + "." + diagram.baseEditHelperClassName
- } else {
- return diagram.getBaseEditHelperQualifiedClassName();
- }
-
- }
-}
+
+package utils
+
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenDiagram
+import org.eclipse.papyrus.papyrusgmfgenextension.AdditionalEditPartCandies
+
+@Singleton class EditHelperUtils_qvto {
+
+ def String getBaseEditHelperFullName(GenDiagram diagram) {
+ if(!(diagram.eResource.allContents.filter(typeof(AdditionalEditPartCandies)).empty)) {
+ return diagram.eResource.allContents.filter(typeof(AdditionalEditPartCandies)).head.baseEditHelperPackage + "." + diagram.baseEditHelperClassName
+ } else {
+ return diagram.getBaseEditHelperQualifiedClassName();
+ }
+
+ }
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/utils/EditPartsUtils_qvto.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/utils/EditPartsUtils_qvto.xtend
index 41c5a2bc2fe..7eaa6525c7f 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/utils/EditPartsUtils_qvto.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/utils/EditPartsUtils_qvto.xtend
@@ -1,45 +1,45 @@
-/*
- * 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
- *
- */
-package utils
-
-import com.google.inject.Singleton
-import java.util.List
-import org.eclipse.gmf.codegen.gmfgen.GenExternalNodeLabel
-import org.eclipse.gmf.codegen.gmfgen.GenNode
-import org.eclipse.papyrus.papyrusgmfgenextension.SpecificLocatorExternalLabel
-
-@Singleton class EditPartsUtils_qvto {
-
- def boolean hasSpecificLocator(GenExternalNodeLabel it) {
-
- return it.eResource.allContents.filter(typeof(SpecificLocatorExternalLabel)).filter[v|v.genExternalNodeLabel.contains(it)].size != 0
- }
-
- def String getSpecificLocator(GenExternalNodeLabel it) {
-
- if(hasSpecificLocator(it)) {
- return it.eResource.allContents.filter(typeof(SpecificLocatorExternalLabel)).filter[v|v.genExternalNodeLabel.contains(it)].head.classpath
- }
-
- return null;
- }
-
- def List<GenExternalNodeLabel> getExternalLabelsWithoutSpecificLocator(GenNode it) {
- return it.labels.filter(typeof(GenExternalNodeLabel)).filter[l|!hasSpecificLocator(l)].toList;
- }
-
- def List<GenExternalNodeLabel> getExternalLabelsWithSpecificLocator(GenNode it) {
- return it.labels.filter(typeof(GenExternalNodeLabel)).filter[l|hasSpecificLocator(l)].toList;
- }
-
-}
+/*
+ * 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
+ *
+ */
+package utils
+
+import com.google.inject.Singleton
+import java.util.List
+import org.eclipse.gmf.codegen.gmfgen.GenExternalNodeLabel
+import org.eclipse.gmf.codegen.gmfgen.GenNode
+import org.eclipse.papyrus.papyrusgmfgenextension.SpecificLocatorExternalLabel
+
+@Singleton class EditPartsUtils_qvto {
+
+ def boolean hasSpecificLocator(GenExternalNodeLabel it) {
+
+ return it.eResource.allContents.filter(typeof(SpecificLocatorExternalLabel)).filter[v|v.genExternalNodeLabel.contains(it)].size != 0
+ }
+
+ def String getSpecificLocator(GenExternalNodeLabel it) {
+
+ if(hasSpecificLocator(it)) {
+ return it.eResource.allContents.filter(typeof(SpecificLocatorExternalLabel)).filter[v|v.genExternalNodeLabel.contains(it)].head.classpath
+ }
+
+ return null;
+ }
+
+ def List<GenExternalNodeLabel> getExternalLabelsWithoutSpecificLocator(GenNode it) {
+ return it.labels.filter(typeof(GenExternalNodeLabel)).filter[l|!hasSpecificLocator(l)].toList;
+ }
+
+ def List<GenExternalNodeLabel> getExternalLabelsWithSpecificLocator(GenNode it) {
+ return it.labels.filter(typeof(GenExternalNodeLabel)).filter[l|hasSpecificLocator(l)].toList;
+ }
+
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/utils/NodeConstraintUtils_qvto.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/utils/NodeConstraintUtils_qvto.xtend
index bf343360052..963cc1120c5 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/utils/NodeConstraintUtils_qvto.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/utils/NodeConstraintUtils_qvto.xtend
@@ -9,45 +9,45 @@
* Contributors:
* Yann Tanguy (CEA LIST) - initial API and implementation
*
- */
-package utils
-
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenNode
-import org.eclipse.gmf.codegen.gmfgen.TypeModelFacet
-import org.eclipse.papyrus.papyrusgmfgenextension.GenNodeConstraint
-
-@Singleton class NodeConstraintUtils_qvto {
-
- def boolean hasNodeCreationConstraint(GenNode it) {
- return it.eResource.allContents.filter(typeof(GenNodeConstraint)).filter[v|
- v.genNode.contains(it) && v.genConstraint != null].size != 0
- }
-
- def GenNodeConstraint getNodeCreationConstraint(GenNode it) {
-
- if (hasNodeCreationConstraint(it)) {
- return it.eResource.allContents.filter(typeof(GenNodeConstraint)).filter[v|
- v.genNode.contains(it) && v.genConstraint != null].head
- } else {
- return null;
- }
- }
-
- def GenNode getOwningGenNode(TypeModelFacet it) {
-
- return it.eResource.allContents.filter(typeof(GenNode)).filter[v|v.modelFacet == it].head
- }
-
- def String getNodeCreationConstraintBody(GenNode it) {
- var nodeConstraint = getNodeCreationConstraint(it);
-
- if (hasNodeCreationConstraint(it)) {
- if ((nodeConstraint.genConstraint != null) && (nodeConstraint.genConstraint.body != null)) {
- return nodeConstraint.genConstraint.body;
- }
- }
- return "No GenNodeConstraint found.";
- }
-
-}
+ */
+package utils
+
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenNode
+import org.eclipse.gmf.codegen.gmfgen.TypeModelFacet
+import org.eclipse.papyrus.papyrusgmfgenextension.GenNodeConstraint
+
+@Singleton class NodeConstraintUtils_qvto {
+
+ def boolean hasNodeCreationConstraint(GenNode it) {
+ return it.eResource.allContents.filter(typeof(GenNodeConstraint)).filter[v|
+ v.genNode.contains(it) && v.genConstraint != null].size != 0
+ }
+
+ def GenNodeConstraint getNodeCreationConstraint(GenNode it) {
+
+ if (hasNodeCreationConstraint(it)) {
+ return it.eResource.allContents.filter(typeof(GenNodeConstraint)).filter[v|
+ v.genNode.contains(it) && v.genConstraint != null].head
+ } else {
+ return null;
+ }
+ }
+
+ def GenNode getOwningGenNode(TypeModelFacet it) {
+
+ return it.eResource.allContents.filter(typeof(GenNode)).filter[v|v.modelFacet == it].head
+ }
+
+ def String getNodeCreationConstraintBody(GenNode it) {
+ var nodeConstraint = getNodeCreationConstraint(it);
+
+ if (hasNodeCreationConstraint(it)) {
+ if ((nodeConstraint.genConstraint != null) && (nodeConstraint.genConstraint.body != null)) {
+ return nodeConstraint.genConstraint.body;
+ }
+ }
+ return "No GenNodeConstraint found.";
+ }
+
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/utils/PrefsConstant_qvto.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/utils/PrefsConstant_qvto.xtend
index f155e545af4..314a97776e8 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/utils/PrefsConstant_qvto.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/utils/PrefsConstant_qvto.xtend
@@ -9,83 +9,83 @@
* Contributors:
* Thibault Landre (Atos Origin) - initial API and implementation
* modified by Patrick Tessier(CEA LIST)
- */
-package utils
-
-import com.google.inject.Singleton
-
-@Singleton class PrefsConstant_qvto {
-
-
- def String getDiagramPreferencePageCategory() {
- return "org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams"
- }
-
- def String getPreferenceConstant() {
- return "_PREF_"
- }
-
- def String getPreferenceGradientPolicyConstant(String _element) {
- return _element + getPreferenceConstant() + "GRADIENT_POLICY"
- }
-
- def String getPreferenceGradientColorConstant(String _element) {
- return _element + getPreferenceConstant() + "GRADIENT_COLOR"
- }
-
- def String getPreferenceFillColorConstant(String _element) {
- return _element + getPreferenceConstant() + "FILL_COLOR"
- }
-
- def String getPreferenceFontColorConstant(String _element) {
- return _element + getPreferenceConstant() + "FONT_COLOR"
- }
-
- def String getPreferenceFontConstant(String _element) {
- return _element + getPreferenceConstant() + "FONT"
- }
-
- def String getPreferenceLineColorConstant(String _element) {
- return _element + getPreferenceConstant() + "LINE_COLOR"
- }
-
- def String getPreferenceJumpLinkConstant() {
- return getPreferenceConstant() + "JUMPLINK_"
- }
-
- def String getPreferenceJumpLinkReverseConstant(String _element) {
- return _element + getPreferenceJumpLinkConstant() + "REVERSE"
- }
-
- def String getPreferenceJumpLinkStatusConstant(String _element) {
- return _element + getPreferenceJumpLinkConstant() + "STATUS"
- }
-
- def String getPreferenceJumpLinkTypeConstant(String _element) {
- return _element + getPreferenceJumpLinkConstant() + "TYPE"
- }
-
- def String getPreferenceRoutingConstant() {
- return getPreferenceConstant() + "ROUTING_"
- }
-
- def String getPreferenceRoutingDistancePolicyConstant(String _element) {
- return _element + getPreferenceRoutingConstant() + "DISTANCE_POLICY"
- }
-
- def String getPreferenceRoutingObstructionPolicyConstant(String _element) {
- return _element + getPreferenceRoutingConstant() + "OBSTRUCTION_POLICY"
- }
-
- def String getPreferenceRoutingStyleConstant(String _element) {
- return _element + getPreferenceRoutingConstant() + "STYLE"
- }
-
- def String getPreferenceSmoothnessConstant(String _element) {
- return _element + getPreferenceConstant() + "SMOOTHNESS"
- }
-
- def String getPreferencePageSuffix() {
- return "PreferencePage"
- }
-}
+ */
+package utils
+
+import com.google.inject.Singleton
+
+@Singleton class PrefsConstant_qvto {
+
+
+ def String getDiagramPreferencePageCategory() {
+ return "org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams"
+ }
+
+ def String getPreferenceConstant() {
+ return "_PREF_"
+ }
+
+ def String getPreferenceGradientPolicyConstant(String _element) {
+ return _element + getPreferenceConstant() + "GRADIENT_POLICY"
+ }
+
+ def String getPreferenceGradientColorConstant(String _element) {
+ return _element + getPreferenceConstant() + "GRADIENT_COLOR"
+ }
+
+ def String getPreferenceFillColorConstant(String _element) {
+ return _element + getPreferenceConstant() + "FILL_COLOR"
+ }
+
+ def String getPreferenceFontColorConstant(String _element) {
+ return _element + getPreferenceConstant() + "FONT_COLOR"
+ }
+
+ def String getPreferenceFontConstant(String _element) {
+ return _element + getPreferenceConstant() + "FONT"
+ }
+
+ def String getPreferenceLineColorConstant(String _element) {
+ return _element + getPreferenceConstant() + "LINE_COLOR"
+ }
+
+ def String getPreferenceJumpLinkConstant() {
+ return getPreferenceConstant() + "JUMPLINK_"
+ }
+
+ def String getPreferenceJumpLinkReverseConstant(String _element) {
+ return _element + getPreferenceJumpLinkConstant() + "REVERSE"
+ }
+
+ def String getPreferenceJumpLinkStatusConstant(String _element) {
+ return _element + getPreferenceJumpLinkConstant() + "STATUS"
+ }
+
+ def String getPreferenceJumpLinkTypeConstant(String _element) {
+ return _element + getPreferenceJumpLinkConstant() + "TYPE"
+ }
+
+ def String getPreferenceRoutingConstant() {
+ return getPreferenceConstant() + "ROUTING_"
+ }
+
+ def String getPreferenceRoutingDistancePolicyConstant(String _element) {
+ return _element + getPreferenceRoutingConstant() + "DISTANCE_POLICY"
+ }
+
+ def String getPreferenceRoutingObstructionPolicyConstant(String _element) {
+ return _element + getPreferenceRoutingConstant() + "OBSTRUCTION_POLICY"
+ }
+
+ def String getPreferenceRoutingStyleConstant(String _element) {
+ return _element + getPreferenceRoutingConstant() + "STYLE"
+ }
+
+ def String getPreferenceSmoothnessConstant(String _element) {
+ return _element + getPreferenceConstant() + "SMOOTHNESS"
+ }
+
+ def String getPreferencePageSuffix() {
+ return "PreferencePage"
+ }
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/utils/UtilsItemSemanticEditPolicy.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/utils/UtilsItemSemanticEditPolicy.xtend
index 598cdecd873..0999d8861f8 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/utils/UtilsItemSemanticEditPolicy.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/utils/UtilsItemSemanticEditPolicy.xtend
@@ -1,54 +1,54 @@
-/*****************************************************************************
- * 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
- *
- *****************************************************************************/
-package utils
-
-import com.google.inject.Singleton
-import org.eclipse.gmf.codegen.gmfgen.GenNode
-import org.eclipse.gmf.codegen.gmfgen.TypeLinkModelFacet
-
-@Singleton class UtilsItemSemanticEditPolicy {
-
- //Command for the EditPart which use the Delete Service
- def getDestroyElementCommandByService(GenNode i) '''
- 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;
- }
- '''
-
- def getDestroyElementCommandByService(TypeLinkModelFacet it) '''
- 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;
- }
- '''
-}
+/*****************************************************************************
+ * 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
+ *
+ *****************************************************************************/
+package utils
+
+import com.google.inject.Singleton
+import org.eclipse.gmf.codegen.gmfgen.GenNode
+import org.eclipse.gmf.codegen.gmfgen.TypeLinkModelFacet
+
+@Singleton class UtilsItemSemanticEditPolicy {
+
+ //Command for the EditPart which use the Delete Service
+ def getDestroyElementCommandByService(GenNode i) '''
+ 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;
+ }
+ '''
+
+ def getDestroyElementCommandByService(TypeLinkModelFacet it) '''
+ 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;
+ }
+ '''
+}

Back to the top