| 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.commands.SetValueCommand; |
| 8 | import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice; |
| 9 | import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; |
| 10 | import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest; |
| 11 | |
| 12 | import de.uka.ipd.sdq.pcm.core.CoreFactory; |
| 13 | import de.uka.ipd.sdq.pcm.core.PCMRandomVariable; |
| 14 | import de.uka.ipd.sdq.pcm.seff.LoopAction; |
| 15 | import de.uka.ipd.sdq.pcm.seff.SeffPackage; |
| 16 | |
| 17 | /** |
| 18 | * The Class define a edit helper to create a empty loop action. |
| 19 | * |
| 20 | * @author Roman Andrej |
| 21 | */ |
| 22 | public class CreateLoopActionEditHelperAdvice extends |
| 23 | AbstractCreateRandomVariableEditHelperAdvice implements 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 | PCMRandomVariable randomVariable = CoreFactory.eINSTANCE |
| 31 | .createPCMRandomVariable(); |
| 32 | |
| 33 | randomVariable.setSpecification("1"); |
| 34 | |
| 35 | SetRequest setRequest = new SetRequest( |
| 36 | (LoopAction) request.getElementToConfigure(), |
| 37 | SeffPackage.eINSTANCE.getLoopAction_IterationCount_LoopAction(), |
| 38 | randomVariable); |
| 39 | |
| 40 | return new SetValueCommand(setRequest); |
| 41 | } |
| 42 | } |