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

nameclass, %method, %block, %line, %
RecoveryActionBehaviourCreateCommand.java0%   (0/1)0%   (0/5)0%   (0/87)0%   (0/27)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class RecoveryActionBehaviourCreateCommand0%   (0/1)0%   (0/5)0%   (0/87)0%   (0/27)
RecoveryActionBehaviourCreateCommand (CreateElementRequest): void 0%   (0/1)0%   (0/7)0%   (0/2)
canExecute (): boolean 0%   (0/1)0%   (0/2)0%   (0/1)
doConfigure (RecoveryActionBehaviour, IProgressMonitor, IAdaptable): void 0%   (0/1)0%   (0/39)0%   (0/12)
doExecuteWithResult (IProgressMonitor, IAdaptable): CommandResult 0%   (0/1)0%   (0/25)0%   (0/7)
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 
18/**
19 * @generated
20 */
21public class RecoveryActionBehaviourCreateCommand extends EditElementCommand {
22 
23        /**
24         * @generated
25         */
26        public RecoveryActionBehaviourCreateCommand(CreateElementRequest req) {
27                super(req.getLabel(), null, req);
28        }
29 
30        /**
31         * FIXME: replace with setElementToEdit()
32         * @generated
33         */
34        protected EObject getElementToEdit() {
35                EObject container = ((CreateElementRequest) getRequest())
36                                .getContainer();
37                if (container instanceof View) {
38                        container = ((View) container).getElement();
39                }
40                return container;
41        }
42 
43        /**
44         * @generated
45         */
46        public boolean canExecute() {
47                return true;
48 
49        }
50 
51        /**
52         * @generated
53         */
54        protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
55                        IAdaptable info) throws ExecutionException {
56                de.uka.ipd.sdq.pcm.seff.seff_reliability.RecoveryActionBehaviour newElement = de.uka.ipd.sdq.pcm.seff.seff_reliability.Seff_reliabilityFactory.eINSTANCE
57                                .createRecoveryActionBehaviour();
58 
59                de.uka.ipd.sdq.pcm.seff.seff_reliability.RecoveryAction owner = (de.uka.ipd.sdq.pcm.seff.seff_reliability.RecoveryAction) getElementToEdit();
60                owner.getRecoveryActionBehaviours__RecoveryAction().add(newElement);
61 
62                doConfigure(newElement, monitor, info);
63 
64                ((CreateElementRequest) getRequest()).setNewElement(newElement);
65                return CommandResult.newOKCommandResult(newElement);
66        }
67 
68        /**
69         * @generated
70         */
71        protected void doConfigure(
72                        de.uka.ipd.sdq.pcm.seff.seff_reliability.RecoveryActionBehaviour newElement,
73                        IProgressMonitor monitor, IAdaptable info)
74                        throws ExecutionException {
75                IElementType elementType = ((CreateElementRequest) getRequest())
76                                .getElementType();
77                ConfigureRequest configureRequest = new ConfigureRequest(
78                                getEditingDomain(), newElement, elementType);
79                configureRequest.setClientContext(((CreateElementRequest) getRequest())
80                                .getClientContext());
81                configureRequest.addParameters(getRequest().getParameters());
82                ICommand configureCommand = elementType
83                                .getEditCommand(configureRequest);
84                if (configureCommand != null && configureCommand.canExecute()) {
85                        configureCommand.execute(monitor, info);
86                }
87        }
88 
89}

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