blob: 5e0d1cb85248940d4a1d2eb53cadf6342c36a5e3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
/**
* 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
* 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
import xpt.diagram.editparts.Utils_qvto
import org.eclipse.gmf.codegen.gmfgen.GenDiagram
@Singleton class NodeLabelEditPart extends impl.diagram.editparts.NodeLabelEditPart {
@Inject extension Utils_qvto;
@Inject Common xptEditpartsCommon;
override def nodeLabelDragPolicyQualifiedClassName(GenDiagram it) '''org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.DefaultNodeLabelDragPolicy'''
override handleNotificationEventBody(GenNodeLabel it) '''
Object feature = event.getFeature();
«IF isStoringChildPositions(node)»
«xptEditpartsCommon.handleBounds(it)»
«ENDIF»
«xptEditpartsCommon.handleText(it)»
««« START Papyrus Code
«IF elementIcon»
if(event.getNewValue() instanceof org.eclipse.emf.ecore.EAnnotation && org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((org.eclipse.emf.ecore.EAnnotation)event.getNewValue()).getSource())){
refreshLabel();
}
«ENDIF»
««« End Papyrus Code
super.handleNotificationEvent(event);
'''
}
|