Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 63d5ebeddfaddbbf8455b45ace538ea89f26493e (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/******************************************************************************
 * Copyright (c) 2006, 2020 Borland Software Corporation, CEA LIST, Artal
 * 
 * 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/ 
 * 
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors: 
 *    Alexander Shatalin (Borland) - initial API and implementation
 *    Aurelien Didier (ARTAL) - aurelien.didier51@gmail.com - Bug 569174
 *****************************************************************************/
«IMPORT 'http://www.eclipse.org/papyrus/gmf/2020/GenModel'»

«DEFINE DiagramItemSemanticEditPolicy FOR gmfgen::GenDiagram-»
	«EXPAND xpt::Common::copyright FOR getDiagram().editorGen-»
package «editPoliciesPackageName»;

	«EXPAND xpt::Common::generatedClassComment»
public class «itemSemanticEditPolicyClassName» extends «getBaseItemSemanticEditPolicyQualifiedClassName()» {

	«EXPAND xpt::diagram::editpolicies::BaseItemSemanticEditPolicy::defaultConstructor-»

	«EXPAND xpt::diagram::editpolicies::childContainerCreateCommand::childContainerCreateCommand FOR topLevelNodes->asSequence()-»
	
	«EXPAND getDuplicateCommand-»
	
	«EXPAND DuplicateAnythingCommand-»
	
	«EXPAND additions-»
}
«ENDDEFINE»

«DEFINE getDuplicateCommand FOR gmfgen::GenDiagram-»
	«EXPAND xpt::Common::generatedMemberComment»
protected org.eclipse.gef.commands.Command getDuplicateCommand(org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest req) {
	org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain = ((org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) getHost()).getEditingDomain();
	return getGEFWrapper(new DuplicateAnythingCommand(editingDomain, req));
}
«ENDDEFINE»

«DEFINE DuplicateAnythingCommand FOR gmfgen::GenDiagram-»
	«EXPAND xpt::Common::generatedClassComment»
private static class DuplicateAnythingCommand extends org.eclipse.gmf.runtime.emf.commands.core.commands.DuplicateEObjectsCommand {

	«EXPAND DAC_constructor-»

	«EXPAND DAC_additions-»
}
«ENDDEFINE»

«DEFINE DAC_constructor FOR gmfgen::GenDiagram-»
	«EXPAND xpt::Common::generatedMemberComment»
public DuplicateAnythingCommand(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain, org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest req) {
	super(editingDomain, req.getLabel(), req.getElementsToBeDuplicated(), req.getAllDuplicatedElementsMap());
}
«ENDDEFINE»

«DEFINE DAC_additions FOR gmfgen::GenDiagram-»
«ENDDEFINE»

«DEFINE additions FOR gmfgen::GenDiagram-»
«ENDDEFINE»

Back to the top