| 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.AssemblyInfrastructureConnector; |
| 12 | import de.uka.ipd.sdq.pcm.core.entity.EntityPackage; |
| 13 | |
| 14 | /** |
| 15 | * @generated |
| 16 | */ |
| 17 | public class AssemblyInfrastructureConnectorEditHelper extends |
| 18 | PalladioComponentModelBaseEditHelper { |
| 19 | /** |
| 20 | * Get the configuration command for an AssemblyConnector. |
| 21 | * |
| 22 | * This is modified manually to create the assumed name for the new connector. |
| 23 | * |
| 24 | * @generated not |
| 25 | */ |
| 26 | @Override |
| 27 | protected ICommand getConfigureCommand(ConfigureRequest req) { |
| 28 | AssemblyInfrastructureConnector con = (AssemblyInfrastructureConnector ) req.getElementToConfigure(); |
| 29 | String name = "InfrastructureConnector "; |
| 30 | name += con.getRequiringAssemblyContext__AssemblyInfrastructureConnector() == null ? "" |
| 31 | : con.getRequiringAssemblyContext__AssemblyInfrastructureConnector() |
| 32 | .getEntityName(); |
| 33 | name += " -> "; |
| 34 | name += con.getProvidingAssemblyContext__AssemblyInfrastructureConnector() == null ? "" |
| 35 | : con.getProvidingAssemblyContext__AssemblyInfrastructureConnector() |
| 36 | .getEntityName(); |
| 37 | |
| 38 | ICommand cmd2 = new SetValueCommand(new SetRequest(req |
| 39 | .getElementToConfigure(), EntityPackage.eINSTANCE |
| 40 | .getNamedElement_EntityName(), name)); |
| 41 | return cmd2; |
| 42 | } |
| 43 | } |