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.OpenWorkload; |
13 | import de.uka.ipd.sdq.pcm.usagemodel.UsagemodelPackage; |
14 | |
15 | /** |
16 | * @author Roman Andrej |
17 | */ |
18 | public class CreateArrivalRateEditHelperAdvice extends |
19 | AbstractEditHelperAdvice 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((OpenWorkload) request |
33 | .getElementToConfigure(), UsagemodelPackage.eINSTANCE |
34 | .getOpenWorkload_InterArrivalTime_OpenWorkload(), randomVariable); |
35 | |
36 | return new SetValueCommand(setRequest); |
37 | } |
38 | |
39 | } |