Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.codegen.xtend/xtend/impl/diagram/editparts/ChildNodeLabelEditPart.xtend')
-rw-r--r--plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.codegen.xtend/xtend/impl/diagram/editparts/ChildNodeLabelEditPart.xtend41
1 files changed, 23 insertions, 18 deletions
diff --git a/plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.codegen.xtend/xtend/impl/diagram/editparts/ChildNodeLabelEditPart.xtend b/plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.codegen.xtend/xtend/impl/diagram/editparts/ChildNodeLabelEditPart.xtend
index 6c4852e0a56..7e05e18a6d0 100644
--- a/plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.codegen.xtend/xtend/impl/diagram/editparts/ChildNodeLabelEditPart.xtend
+++ b/plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.codegen.xtend/xtend/impl/diagram/editparts/ChildNodeLabelEditPart.xtend
@@ -1,18 +1,18 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2020 Borland Software Corporation, CEA LIST, Artal and others
+/*****************************************************************************
+ * Copyright (c) 2006, 2009, 2013 , 2021 Borland Software Corporation, CEA LIST, Artal and others
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
* SPDX-License-Identifier: EPL-2.0
*
- * Contributors:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Alexander Shatalin (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- * Aurelien Didier (ARTAL) - aurelien.didier51@gmail.com - Bug 569174
+ * Contributors:
+ * Dmitry Stadnik (Borland) - initial API and implementation
+ * Alexander Shatalin (Borland) - initial API and implementation
+ * Michael Golubev (Montages) - #386838 - migrate to Xtend2
+ * Etienne Allogo (ARTAL) - etienne.allogo@artal.fr - Bug 569174 : 1.4 Merge papyrus extension templates into codegen.xtend
*****************************************************************************/
package impl.diagram.editparts
@@ -20,7 +20,7 @@ import com.google.inject.Inject
import org.eclipse.papyrus.gmf.codegen.gmfgen.GenChildLabelNode
import xpt.Common
import xpt.QualifiedClassNameProvider
-import xpt.diagram.editpolicies.TextNonResizableEditPolicy import xpt.CodeStyle
+import xpt.CodeStyle
/**
* Revisit: [MG]: @Inject extension same-named-api-class -> template extends api-class?
@@ -29,9 +29,8 @@ import xpt.diagram.editpolicies.TextNonResizableEditPolicy import xpt.CodeStyle
@Inject extension Common;
@Inject extension QualifiedClassNameProvider
@Inject extension CodeStyle
-
+ @Inject extension xpt.diagram.editparts.Common;
@Inject xpt.diagram.editparts.Common xptEditpartsCommon;
- @Inject TextNonResizableEditPolicy xptTextNonResizable;
def className(GenChildLabelNode it) '''«editPartClassName»'''
@@ -54,19 +53,25 @@ import xpt.diagram.editpolicies.TextNonResizableEditPolicy import xpt.CodeStyle
def createDefaultEditPoliciesBody(GenChildLabelNode it) '''
super.createDefaultEditPolicies();
installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.SEMANTIC_ROLE, new «getItemSemanticEditPolicyQualifiedClassName(it)»());
- installEditPolicy(org.eclipse.gef.EditPolicy.PRIMARY_DRAG_ROLE, new «xptTextNonResizable.qualifiedClassName(getDiagram())»());
+ installEditPolicy(org.eclipse.gef.EditPolicy.PRIMARY_DRAG_ROLE, new org.eclipse.papyrus.uml.diagram.common.editpolicies.UMLTextNonResizableEditPolicy());
installEditPolicy(org.eclipse.gef.EditPolicy.COMPONENT_ROLE, new org.eclipse.gmf.runtime.diagram.ui.editpolicies.ListItemComponentEditPolicy());
installEditPolicy(org.eclipse.gef.EditPolicy.DIRECT_EDIT_ROLE, new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy());
«xptEditpartsCommon.behaviour(it)»
- «additionalEditPolicies(it)»
'''
- def additionalEditPolicies(GenChildLabelNode it) ''''''
def handleNotificationEventBody(GenChildLabelNode it) '''
- Object feature = event.getFeature();
- «xptEditpartsCommon.handleText(it)»
- super.handleNotificationEvent(event);
+ Object feature = event.getFeature();
+ «handleText(it)»
+ «IF labelElementIcon»
+ if(event.getNewValue() instanceof org.eclipse.emf.ecore.EAnnotation && org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((org.eclipse.emf.ecore.EAnnotation)event.getNewValue()).getSource())){
+ refreshLabel();
+ }
+ «ENDIF»
+ if (org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getFeature_IsStatic().equals(feature)) {
+ refreshUnderline();
+ }
+ super.handleNotificationEvent(event);
'''
def isSelectable(GenChildLabelNode it) '''

Back to the top