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 [ThroughputEditHelperAdvice.java]

nameclass, %method, %block, %line, %
ThroughputEditHelperAdvice.java0%   (0/1)0%   (0/2)0%   (0/49)0%   (0/15)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ThroughputEditHelperAdvice0%   (0/1)0%   (0/2)0%   (0/49)0%   (0/15)
ThroughputEditHelperAdvice (): void 0%   (0/1)0%   (0/3)0%   (0/1)
getCommand (CommunicationLinkResourceSpecification): ICommand 0%   (0/1)0%   (0/46)0%   (0/14)

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 ThroughputEditHelperAdvice extends AbstractEditHelperAdvice
23                implements 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(), ResourceenvironmentPackage.eINSTANCE.getCommunicationLinkResourceSpecification_Throughput_CommunicationLinkResourceSpecification(),
42//                                rv));
43//
44//                return cmd;
45//        }
46        
47        protected ICommand getCommand(CommunicationLinkResourceSpecification communicationLinkResourceSpecification) {
48                PCMRandomVariable rv = CoreFactory.eINSTANCE.createPCMRandomVariable();
49                rv.setSpecification("");
50 
51                StochasticExpressionEditDialog dialog = new StochasticExpressionEditDialog(
52                                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
53                                TypeEnum.ANY, rv);
54                dialog.open();
55 
56                if (dialog.getReturnCode() == Dialog.CANCEL)
57                        return new CanceledCommand();
58 
59                rv.setSpecification(dialog.getResultText());
60 
61                ICommand cmd = new MySetValueCommand(new SetRequest(communicationLinkResourceSpecification,
62                                ResourceenvironmentPackage.eINSTANCE.getCommunicationLinkResourceSpecification_Throughput_CommunicationLinkResourceSpecification(),
63                                rv));
64                cmd.setLabel("Throughput");
65                return cmd;
66        }
67}

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