| 1 | package de.uka.ipd.sdq.pcm.gmf.repository.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.repository.PassiveResource; |
| 13 | import de.uka.ipd.sdq.pcm.repository.RepositoryPackage; |
| 14 | |
| 15 | public class PassiveResourceEditHelperAdvice |
| 16 | extends AbstractEditHelperAdvice |
| 17 | implements IEditHelperAdvice { |
| 18 | |
| 19 | @Override |
| 20 | protected ICommand getAfterConfigureCommand(ConfigureRequest request) { |
| 21 | PCMRandomVariable rv = CoreFactory.eINSTANCE.createPCMRandomVariable(); |
| 22 | rv.setSpecification("1"); |
| 23 | |
| 24 | /* StochasticExpressionEditDialog dialog = new StochasticExpressionEditDialog( |
| 25 | PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), |
| 26 | TypeEnum.INT, rv); |
| 27 | dialog.open(); |
| 28 | |
| 29 | if (dialog.getReturnCode() == Dialog.CANCEL) |
| 30 | return new CanceledCommand(); |
| 31 | |
| 32 | rv.setSpecification(dialog.getResultText());*/ |
| 33 | |
| 34 | ICommand cmd = new SetValueCommand( |
| 35 | new SetRequest((PassiveResource)request |
| 36 | .getElementToConfigure(), |
| 37 | RepositoryPackage.eINSTANCE.getPassiveResource_Capacity_PassiveResource(), |
| 38 | rv)); |
| 39 | |
| 40 | return cmd; |
| 41 | } |
| 42 | |
| 43 | } |