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

COVERAGE SUMMARY FOR SOURCE FILE [LatencyEditHelperAdvice.java]

nameclass, %method, %block, %line, %
LatencyEditHelperAdvice.java0%   (0/1)0%   (0/2)0%   (0/46)0%   (0/17)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class LatencyEditHelperAdvice0%   (0/1)0%   (0/2)0%   (0/46)0%   (0/17)
LatencyEditHelperAdvice (): void 0%   (0/1)0%   (0/3)0%   (0/1)
getCommand (CommunicationLinkResourceSpecification): ICommand 0%   (0/1)0%   (0/43)0%   (0/16)

1package de.uka.ipd.sdq.pcm.gmf.resource.helper;
2 
3import org.eclipse.emf.ecore.EObject;
4import org.eclipse.gmf.runtime.common.core.command.ICommand;
5import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
6import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
7import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
8import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
9import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
10import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
11import org.eclipse.jface.dialogs.Dialog;
12import org.eclipse.ui.PlatformUI;
13 
14import de.uka.ipd.sdq.pcm.core.CoreFactory;
15import de.uka.ipd.sdq.pcm.core.PCMRandomVariable;
16import de.uka.ipd.sdq.pcm.dialogs.stoex.StochasticExpressionEditDialog;
17import de.uka.ipd.sdq.pcm.parameter.ParameterPackage;
18import de.uka.ipd.sdq.pcm.resourceenvironment.CommunicationLinkResourceSpecification;
19import de.uka.ipd.sdq.pcm.resourceenvironment.ResourceenvironmentPackage;
20import de.uka.ipd.sdq.stoex.analyser.visitors.TypeEnum;
21 
22public class LatencyEditHelperAdvice extends AbstractEditHelperAdvice implements
23                IEditHelperAdvice {
24 
25        // @Override
26        // protected ICommand getBeforeConfigureCommand(ConfigureRequest request) {
27        // PCMRandomVariable rv = CoreFactory.eINSTANCE.createPCMRandomVariable();
28        // rv.setSpecification("");
29        //
30        // StochasticExpressionEditDialog dialog = new StochasticExpressionEditDialog(
31        // PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
32        // TypeEnum.ANY, rv);
33        // dialog.open();
34        //
35        // if (dialog.getReturnCode() == Dialog.CANCEL)
36        // return new CanceledCommand();
37        //
38        // rv.setSpecification(dialog.getResultText());
39        //
40        // ICommand cmd = new SetValueCommand(new SetRequest(request
41        // .getElementToConfigure(),
42        // ResourceenvironmentPackage.eINSTANCE.getCommunicationLinkResourceSpecification_Latency_CommunicationLinkResourceSpecification(),
43        // rv));
44        //
45        // return cmd;
46        // }
47 
48        protected ICommand getCommand(
49                        CommunicationLinkResourceSpecification communicationLinkResourceSpecification) {
50                PCMRandomVariable rv = CoreFactory.eINSTANCE.createPCMRandomVariable();
51                rv.setSpecification("");
52 
53                StochasticExpressionEditDialog dialog = new StochasticExpressionEditDialog(
54                                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
55                                TypeEnum.ANY, rv);
56                dialog.open();
57 
58                if (dialog.getReturnCode() == Dialog.CANCEL)
59                        return new CanceledCommand();
60 
61                rv.setSpecification(dialog.getResultText());
62 
63                ICommand cmd = new SetValueCommand(
64                                new SetRequest(
65                                                communicationLinkResourceSpecification,
66                                                ResourceenvironmentPackage.eINSTANCE
67                                                                .getCommunicationLinkResourceSpecification_Latency_CommunicationLinkResourceSpecification(),
68                                                rv));
69 
70                return cmd;
71        }
72}

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