EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.pcm.gmf.repository.helper]

COVERAGE SUMMARY FOR SOURCE FILE [VariableCharacterisationEditHelperAdvice.java]

nameclass, %method, %block, %line, %
VariableCharacterisationEditHelperAdvice.java0%   (0/1)0%   (0/2)0%   (0/47)0%   (0/15)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class VariableCharacterisationEditHelperAdvice0%   (0/1)0%   (0/2)0%   (0/47)0%   (0/15)
VariableCharacterisationEditHelperAdvice (): void 0%   (0/1)0%   (0/3)0%   (0/1)
getAfterConfigureCommand (ConfigureRequest): ICommand 0%   (0/1)0%   (0/44)0%   (0/14)

1package de.uka.ipd.sdq.pcm.gmf.repository.helper;
2 
3import org.eclipse.gmf.runtime.common.core.command.ICommand;
4import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
5import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
6import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
7import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
8import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
9import org.eclipse.jface.dialogs.Dialog;
10import org.eclipse.ui.PlatformUI;
11 
12import de.uka.ipd.sdq.pcm.core.CoreFactory;
13import de.uka.ipd.sdq.pcm.core.PCMRandomVariable;
14import de.uka.ipd.sdq.pcm.dialogs.stoex.StochasticExpressionEditDialog;
15import de.uka.ipd.sdq.pcm.parameter.ParameterPackage;
16import de.uka.ipd.sdq.stoex.analyser.visitors.TypeEnum;
17 
18public class VariableCharacterisationEditHelperAdvice extends
19                AbstractEditHelperAdvice implements IEditHelperAdvice {
20 
21        @Override
22        protected ICommand getAfterConfigureCommand(ConfigureRequest request) {
23                PCMRandomVariable rv = CoreFactory.eINSTANCE.createPCMRandomVariable();
24                rv.setSpecification("");
25                
26                StochasticExpressionEditDialog dialog = new StochasticExpressionEditDialog(
27                                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
28                                TypeEnum.ANY, rv);
29                dialog.open();
30 
31                if (dialog.getReturnCode() == Dialog.CANCEL)
32                        return new CanceledCommand();
33 
34                rv.setSpecification(dialog.getResultText());
35                
36                ICommand cmd = new SetValueCommand(
37                                new SetRequest(request.getElementToConfigure(),
38                                ParameterPackage.eINSTANCE.getVariableCharacterisation_Specification_VariableCharacterisation(),
39                                rv));
40                
41                return cmd;
42        }        
43}

[all classes][de.uka.ipd.sdq.pcm.gmf.repository.helper]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov