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

COVERAGE SUMMARY FOR SOURCE FILE [ForkedBehaviour2CreateCommand.java]

nameclass, %method, %block, %line, %
ForkedBehaviour2CreateCommand.java0%   (0/1)0%   (0/5)0%   (0/87)0%   (0/28)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ForkedBehaviour2CreateCommand0%   (0/1)0%   (0/5)0%   (0/87)0%   (0/28)
ForkedBehaviour2CreateCommand (CreateElementRequest): void 0%   (0/1)0%   (0/7)0%   (0/2)
canExecute (): boolean 0%   (0/1)0%   (0/2)0%   (0/1)
doConfigure (ForkedBehaviour, IProgressMonitor, IAdaptable): void 0%   (0/1)0%   (0/39)0%   (0/12)
doExecuteWithResult (IProgressMonitor, IAdaptable): CommandResult 0%   (0/1)0%   (0/25)0%   (0/8)
getElementToEdit (): EObject 0%   (0/1)0%   (0/14)0%   (0/5)

1/*
2 * Copyright 2006 SDQ Research Group, University of Karlsruhe (TH)
3 */
4package de.uka.ipd.sdq.pcm.gmf.seff.edit.commands;
5 
6import org.eclipse.core.commands.ExecutionException;
7import org.eclipse.core.runtime.IAdaptable;
8import org.eclipse.core.runtime.IProgressMonitor;
9import org.eclipse.emf.ecore.EObject;
10import org.eclipse.gmf.runtime.common.core.command.CommandResult;
11import org.eclipse.gmf.runtime.common.core.command.ICommand;
12import org.eclipse.gmf.runtime.emf.type.core.IElementType;
13import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
14import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
15import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
16import org.eclipse.gmf.runtime.notation.View;
17 
18import de.uka.ipd.sdq.pcm.seff.ForkedBehaviour;
19import de.uka.ipd.sdq.pcm.seff.SeffFactory;
20import de.uka.ipd.sdq.pcm.seff.SynchronisationPoint;
21 
22/**
23 * @generated
24 */
25public class ForkedBehaviour2CreateCommand extends EditElementCommand {
26 
27        /**
28         * @generated
29         */
30        public ForkedBehaviour2CreateCommand(CreateElementRequest req) {
31                super(req.getLabel(), null, req);
32        }
33 
34        /**
35         * FIXME: replace with setElementToEdit()
36         * @generated
37         */
38        protected EObject getElementToEdit() {
39                EObject container = ((CreateElementRequest) getRequest())
40                                .getContainer();
41                if (container instanceof View) {
42                        container = ((View) container).getElement();
43                }
44                return container;
45        }
46 
47        /**
48         * @generated
49         */
50        public boolean canExecute() {
51                return true;
52 
53        }
54 
55        /**
56         * @generated
57         */
58        protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
59                        IAdaptable info) throws ExecutionException {
60                ForkedBehaviour newElement = SeffFactory.eINSTANCE
61                                .createForkedBehaviour();
62 
63                SynchronisationPoint owner = (SynchronisationPoint) getElementToEdit();
64                owner.getSynchronousForkedBehaviours_SynchronisationPoint().add(
65                                newElement);
66 
67                doConfigure(newElement, monitor, info);
68 
69                ((CreateElementRequest) getRequest()).setNewElement(newElement);
70                return CommandResult.newOKCommandResult(newElement);
71        }
72 
73        /**
74         * @generated
75         */
76        protected void doConfigure(ForkedBehaviour newElement,
77                        IProgressMonitor monitor, IAdaptable info)
78                        throws ExecutionException {
79                IElementType elementType = ((CreateElementRequest) getRequest())
80                                .getElementType();
81                ConfigureRequest configureRequest = new ConfigureRequest(
82                                getEditingDomain(), newElement, elementType);
83                configureRequest.setClientContext(((CreateElementRequest) getRequest())
84                                .getClientContext());
85                configureRequest.addParameters(getRequest().getParameters());
86                ICommand configureCommand = elementType
87                                .getEditCommand(configureRequest);
88                if (configureCommand != null && configureCommand.canExecute()) {
89                        configureCommand.execute(monitor, info);
90                }
91        }
92 
93}

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