1 | /* |
2 | * Copyright 2007, SDQ, IPD, Uni Karlsruhe (TH) |
3 | */ |
4 | package de.uka.ipd.sdq.pcm.gmf.composite.edit.helpers; |
5 | |
6 | import org.eclipse.gmf.runtime.common.core.command.ICommand; |
7 | import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand; |
8 | import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; |
9 | import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest; |
10 | |
11 | import de.uka.ipd.sdq.pcm.core.composition.AssemblyEventConnector; |
12 | import de.uka.ipd.sdq.pcm.core.entity.EntityPackage; |
13 | |
14 | /** |
15 | * Edit helper to create the initial naming of the new Assembly Connector. |
16 | * @author Benjamin Klatt |
17 | * |
18 | * @generated |
19 | */ |
20 | public class AssemblyEventConnectorEditHelper extends |
21 | PalladioComponentModelBaseEditHelper { |
22 | |
23 | /** |
24 | * Get the configuration command for an AssemblyConnector. |
25 | * |
26 | * This is modified manually to create the assumed name for the new connector. |
27 | * |
28 | * @generated not |
29 | */ |
30 | @Override |
31 | protected ICommand getConfigureCommand(ConfigureRequest req) { |
32 | AssemblyEventConnector con = (AssemblyEventConnector) req |
33 | .getElementToConfigure(); |
34 | String name = "EventConnector "; |
35 | name += con.getSourceAssemblyContext__AssemblyEventConnector() == null ? "" |
36 | : con.getSourceAssemblyContext__AssemblyEventConnector() |
37 | .getEntityName(); |
38 | name += " -> "; |
39 | name += con.getSinkAssemblyContext__AssemblyEventConnector() == null ? "" |
40 | : con.getSinkAssemblyContext__AssemblyEventConnector() |
41 | .getEntityName(); |
42 | |
43 | ICommand cmd2 = new SetValueCommand(new SetRequest(req |
44 | .getElementToConfigure(), EntityPackage.eINSTANCE |
45 | .getNamedElement_EntityName(), name)); |
46 | return cmd2; |
47 | } |
48 | } |