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

nameclass, %method, %block, %line, %
AddCommunicationLinkResourceSpecificationEditHelperAdvice.java0%   (0/1)0%   (0/2)0%   (0/49)0%   (0/13)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AddCommunicationLinkResourceSpecificationEditHelperAdvice0%   (0/1)0%   (0/2)0%   (0/49)0%   (0/13)
AddCommunicationLinkResourceSpecificationEditHelperAdvice (): void 0%   (0/1)0%   (0/3)0%   (0/1)
getBeforeConfigureCommand (ConfigureRequest): ICommand 0%   (0/1)0%   (0/46)0%   (0/12)

1package de.uka.ipd.sdq.pcm.gmf.resource.helper;
2 
3import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
4import org.eclipse.gmf.runtime.common.core.command.ICommand;
5import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
6import org.eclipse.gmf.runtime.emf.type.core.IElementType;
7import org.eclipse.gmf.runtime.emf.type.core.commands.CreateElementCommand;
8import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
9import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
10import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
11import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
12 
13import de.uka.ipd.sdq.pcm.resourceenvironment.ResourceenvironmentPackage;
14 
15public class AddCommunicationLinkResourceSpecificationEditHelperAdvice extends AbstractEditHelperAdvice implements
16                IEditHelperAdvice {
17 
18        private static final String RESOURCE_COMMUNICATION_LINK_RESOURCE_SPECIFICATION = "de.uka.ipd.sdq.pcm.gmf.resource.CommunicationLinkResourceSpecification_3002";
19 
20        @Override
21        public ICommand getBeforeConfigureCommand(ConfigureRequest request) {
22                IElementType elementType = ElementTypeRegistry.getInstance().getType(
23                                RESOURCE_COMMUNICATION_LINK_RESOURCE_SPECIFICATION);
24 
25                CreateElementRequest createElementRequest = new CreateElementRequest(request.getElementToConfigure(), elementType);
26                createElementRequest.setContainmentFeature(ResourceenvironmentPackage.eINSTANCE
27                                .getLinkingResource_CommunicationLinkResourceSpecifications_LinkingResource());
28                CreateElementCommand createElementCommand = new CreateElementCommand(createElementRequest);
29 
30                // edited object should be a single element
31                if (request.getElementsToEdit().size() != 1) {
32                        throw new RuntimeException("Did not expect more than one element in request.");
33                }
34 
35                CompositeCommand compositeCommand = new CompositeCommand("");
36                compositeCommand.add(createElementCommand);
37                compositeCommand.add(new SetLatencyThroughputAndLanTypeCommand(request));
38 
39                return compositeCommand;
40        }
41 
42}

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