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

nameclass, %method, %block, %line, %
AbstractActionSuccessor_AbstractActionCreateCommand.java0%   (0/1)0%   (0/6)0%   (0/83)0%   (0/24)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AbstractActionSuccessor_AbstractActionCreateCommand0%   (0/1)0%   (0/6)0%   (0/83)0%   (0/24)
AbstractActionSuccessor_AbstractActionCreateCommand (CreateRelationshipReques... 0%   (0/1)0%   (0/13)0%   (0/4)
canExecute (): boolean 0%   (0/1)0%   (0/37)0%   (0/11)
doExecuteWithResult (IProgressMonitor, IAdaptable): CommandResult 0%   (0/1)0%   (0/21)0%   (0/6)
getSource (): AbstractAction 0%   (0/1)0%   (0/4)0%   (0/1)
getTarget (): AbstractAction 0%   (0/1)0%   (0/4)0%   (0/1)
setElementToEdit (EObject): void 0%   (0/1)0%   (0/4)0%   (0/1)

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.emf.type.core.commands.EditElementCommand;
12import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
13 
14import de.uka.ipd.sdq.pcm.gmf.seff.edit.policies.PalladioComponentModelBaseItemSemanticEditPolicy;
15import de.uka.ipd.sdq.pcm.seff.AbstractAction;
16 
17/**
18 * @generated
19 */
20public class AbstractActionSuccessor_AbstractActionCreateCommand extends
21                EditElementCommand {
22 
23        /**
24         * @generated
25         */
26        private final EObject source;
27 
28        /**
29         * @generated
30         */
31        private final EObject target;
32 
33        /**
34         * @generated
35         */
36        public AbstractActionSuccessor_AbstractActionCreateCommand(
37                        CreateRelationshipRequest request, EObject source, EObject target) {
38                super(request.getLabel(), null, request);
39                this.source = source;
40                this.target = target;
41        }
42 
43        /**
44         * @generated
45         */
46        public boolean canExecute() {
47                if (source == null && target == null) {
48                        return false;
49                }
50                if (source != null && false == source instanceof AbstractAction) {
51                        return false;
52                }
53                if (target != null && false == target instanceof AbstractAction) {
54                        return false;
55                }
56                if (getSource() == null) {
57                        return true; // link creation is in progress; source is not defined yet
58                }
59                // target may be null here but it's possible to check constraint
60                return PalladioComponentModelBaseItemSemanticEditPolicy.LinkConstraints
61                                .canCreateAbstractActionSuccessor_AbstractAction_4001(
62                                                getSource(), getTarget());
63        }
64 
65        /**
66         * @generated
67         */
68        protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
69                        IAdaptable info) throws ExecutionException {
70                if (!canExecute()) {
71                        throw new ExecutionException(
72                                        "Invalid arguments in create link command"); //$NON-NLS-1$
73                }
74 
75                if (getSource() != null && getTarget() != null) {
76                        getSource().setSuccessor_AbstractAction(getTarget());
77                }
78                return CommandResult.newOKCommandResult();
79 
80        }
81 
82        /**
83         * @generated
84         */
85        protected void setElementToEdit(EObject element) {
86                throw new UnsupportedOperationException();
87        }
88 
89        /**
90         * @generated
91         */
92        protected AbstractAction getSource() {
93                return (AbstractAction) source;
94        }
95 
96        /**
97         * @generated
98         */
99        protected AbstractAction getTarget() {
100                return (AbstractAction) target;
101        }
102}

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