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

COVERAGE SUMMARY FOR SOURCE FILE [AssemblyContextCreateCommand.java]

nameclass, %method, %block, %line, %
AssemblyContextCreateCommand.java0%   (0/1)0%   (0/5)0%   (0/83)0%   (0/27)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AssemblyContextCreateCommand0%   (0/1)0%   (0/5)0%   (0/83)0%   (0/27)
AssemblyContextCreateCommand (CreateElementRequest): void 0%   (0/1)0%   (0/7)0%   (0/2)
canExecute (): boolean 0%   (0/1)0%   (0/2)0%   (0/1)
doConfigure (AssemblyContext, IProgressMonitor, IAdaptable): void 0%   (0/1)0%   (0/39)0%   (0/12)
doExecuteWithResult (IProgressMonitor, IAdaptable): CommandResult 0%   (0/1)0%   (0/21)0%   (0/7)
getElementToEdit (): EObject 0%   (0/1)0%   (0/14)0%   (0/5)

1/*
2 *Copyright 2007, SDQ, IPD, Uni Karlsruhe (TH)
3 */
4package de.uka.ipd.sdq.pcm.gmf.composite.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.core.composition.AssemblyContext;
19import de.uka.ipd.sdq.pcm.core.composition.ComposedStructure;
20import de.uka.ipd.sdq.pcm.core.composition.CompositionFactory;
21import de.uka.ipd.sdq.pcm.core.entity.InterfaceProvidingEntity;
22 
23/**
24 * @generated
25 */
26public class AssemblyContextCreateCommand extends EditElementCommand {
27 
28        /**
29         * @generated
30         */
31        public AssemblyContextCreateCommand(CreateElementRequest req) {
32                super(req.getLabel(), null, req);
33        }
34 
35        /**
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 not
57         */
58        protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
59                        IAdaptable info) throws ExecutionException {
60                AssemblyContext newElement = CompositionFactory.eINSTANCE
61                                .createAssemblyContext();
62 
63                newElement
64                                .setParentStructure__AssemblyContext((ComposedStructure) getElementToEdit());
65 
66                doConfigure(newElement, monitor, info);
67 
68                ((CreateElementRequest) getRequest()).setNewElement(newElement);
69                return CommandResult.newOKCommandResult(newElement);
70        }
71 
72        /**
73         * @generated
74         */
75        protected void doConfigure(AssemblyContext newElement,
76                        IProgressMonitor monitor, IAdaptable info)
77                        throws ExecutionException {
78                IElementType elementType = ((CreateElementRequest) getRequest())
79                                .getElementType();
80                ConfigureRequest configureRequest = new ConfigureRequest(
81                                getEditingDomain(), newElement, elementType);
82                configureRequest.setClientContext(((CreateElementRequest) getRequest())
83                                .getClientContext());
84                configureRequest.addParameters(getRequest().getParameters());
85                ICommand configureCommand = elementType
86                                .getEditCommand(configureRequest);
87                if (configureCommand != null && configureCommand.canExecute()) {
88                        configureCommand.execute(monitor, info);
89                }
90        }
91 
92}

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