1 | /** |
2 | * |
3 | */ |
4 | package de.uka.ipd.sdq.pcm.gmf.usage.helper; |
5 | |
6 | import org.eclipse.gmf.runtime.common.core.command.ICommand; |
7 | import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry; |
8 | import org.eclipse.gmf.runtime.emf.type.core.IElementType; |
9 | import org.eclipse.gmf.runtime.emf.type.core.commands.CreateElementCommand; |
10 | import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand; |
11 | import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice; |
12 | import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice; |
13 | import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; |
14 | import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; |
15 | import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest; |
16 | |
17 | import de.uka.ipd.sdq.pcm.core.CoreFactory; |
18 | import de.uka.ipd.sdq.pcm.core.PCMRandomVariable; |
19 | import de.uka.ipd.sdq.pcm.parameter.ParameterPackage; |
20 | import de.uka.ipd.sdq.pcm.parameter.VariableCharacterisation; |
21 | import de.uka.ipd.sdq.pcm.seff.LoopAction; |
22 | import de.uka.ipd.sdq.pcm.seff.SeffPackage; |
23 | |
24 | /** |
25 | * @author Roman Andrej |
26 | * |
27 | */ |
28 | public class VariableCharacterisationEditHelperAdvice extends |
29 | AbstractEditHelperAdvice implements |
30 | IEditHelperAdvice { |
31 | |
32 | /* (non-Javadoc) |
33 | * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getAfterConfigureCommand(org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest) |
34 | */ |
35 | @Override |
36 | protected ICommand getAfterConfigureCommand(ConfigureRequest request) { |
37 | |
38 | IElementType elementType = ElementTypeRegistry.getInstance(). |
39 | getType("de.uka.ipd.sdq.pcm.gmf.seff.PCMRandomVariable_9000"); |
40 | |
41 | |
42 | CreateElementRequest createElementRequest = new CreateElementRequest( |
43 | request.getElementToConfigure(), elementType, ParameterPackage.eINSTANCE |
44 | .getVariableCharacterisation_Specification_VariableCharacterisation()); |
45 | return new CreateElementCommand(createElementRequest); |
46 | |
47 | } |
48 | |
49 | } |