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

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

COVERAGE BREAKDOWN BY CLASS AND METHOD

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

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