1 | /** |
2 | * |
3 | */ |
4 | package de.uka.ipd.sdq.pcm.gmf.seff.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.edithelper.AbstractEditHelperAdvice; |
11 | import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice; |
12 | import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; |
13 | import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; |
14 | |
15 | import de.uka.ipd.sdq.pcm.parameter.ParameterPackage; |
16 | |
17 | /** |
18 | * @author Roman Andrej |
19 | * |
20 | */ |
21 | public class VariableCharacterisationEditHelperAdvice extends |
22 | AbstractEditHelperAdvice implements |
23 | IEditHelperAdvice { |
24 | |
25 | /* (non-Javadoc) |
26 | * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getAfterConfigureCommand(org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest) |
27 | */ |
28 | @Override |
29 | protected ICommand getAfterConfigureCommand(ConfigureRequest request) { |
30 | |
31 | IElementType elementType = ElementTypeRegistry.getInstance(). |
32 | getType("de.uka.ipd.sdq.pcm.gmf.seff.PCMRandomVariable_9000"); |
33 | |
34 | |
35 | CreateElementRequest createElementRequest = new CreateElementRequest( |
36 | request.getElementToConfigure(), elementType, ParameterPackage.eINSTANCE |
37 | .getVariableCharacterisation_Specification_VariableCharacterisation()); |
38 | return new CreateElementCommand(createElementRequest); |
39 | |
40 | |
41 | // PCMRandomVariable randomVariable = CoreFactory.eINSTANCE |
42 | // .createPCMRandomVariable(); |
43 | // |
44 | // randomVariable.setSpecification("1"); |
45 | // |
46 | // SetRequest setRequest = new SetRequest( |
47 | // (VariableCharacterisation) request.getElementToConfigure(), |
48 | // ParameterPackage.eINSTANCE |
49 | // .getVariableCharacterisation_Specification_VariableCharacterisation(), |
50 | // randomVariable); |
51 | // |
52 | // // TODO Auto-generated method stub |
53 | // return new SetValueCommand(setRequest); |
54 | } |
55 | |
56 | } |