1 | package de.uka.ipd.sdq.pcm.gmf.usage.helper; |
2 | |
3 | import org.eclipse.gmf.runtime.common.core.command.ICommand; |
4 | import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand; |
5 | import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice; |
6 | import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice; |
7 | import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; |
8 | import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest; |
9 | |
10 | import de.uka.ipd.sdq.pcm.core.CoreFactory; |
11 | import de.uka.ipd.sdq.pcm.core.PCMRandomVariable; |
12 | import de.uka.ipd.sdq.pcm.usagemodel.ClosedWorkload; |
13 | import de.uka.ipd.sdq.pcm.usagemodel.UsagemodelPackage; |
14 | |
15 | /** |
16 | * @author Roman Andrej |
17 | */ |
18 | public class CreateThinkTimeEditHelperAdvice extends AbstractEditHelperAdvice |
19 | implements IEditHelperAdvice { |
20 | |
21 | /* (non-Javadoc) |
22 | * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getAfterConfigureCommand(org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest) |
23 | */ |
24 | @Override |
25 | protected ICommand getAfterConfigureCommand(ConfigureRequest request) { |
26 | |
27 | PCMRandomVariable randomVariable = CoreFactory.eINSTANCE |
28 | .createPCMRandomVariable(); |
29 | |
30 | randomVariable.setSpecification("0.0"); |
31 | |
32 | SetRequest setRequest = new SetRequest( |
33 | (ClosedWorkload) request.getElementToConfigure(), |
34 | UsagemodelPackage.eINSTANCE.getClosedWorkload_ThinkTime_ClosedWorkload(), |
35 | randomVariable); |
36 | |
37 | return new SetValueCommand(setRequest); |
38 | } |
39 | |
40 | } |