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.Delay; |
13 | import de.uka.ipd.sdq.pcm.usagemodel.UsagemodelPackage; |
14 | |
15 | |
16 | /** |
17 | * @author christophrathfelder |
18 | */ |
19 | |
20 | public class CreateDelaySpecificationEditHelperAdvice extends |
21 | AbstractEditHelperAdvice implements IEditHelperAdvice { |
22 | /* (non-Javadoc) |
23 | * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getAfterConfigureCommand(org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest) |
24 | */ |
25 | @Override |
26 | protected ICommand getAfterConfigureCommand(ConfigureRequest request) { |
27 | |
28 | PCMRandomVariable randomVariable = CoreFactory.eINSTANCE |
29 | .createPCMRandomVariable(); |
30 | |
31 | randomVariable.setSpecification("0.0"); |
32 | |
33 | SetRequest setRequest = new SetRequest((Delay) request |
34 | .getElementToConfigure(), UsagemodelPackage.eINSTANCE |
35 | .getDelay_TimeSpecification_Delay(), randomVariable); |
36 | |
37 | return new SetValueCommand(setRequest); |
38 | } |
39 | } |