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

COVERAGE SUMMARY FOR SOURCE FILE [RequiredRoleItemSemanticEditPolicy.java]

nameclass, %method, %block, %line, %
RequiredRoleItemSemanticEditPolicy.java0%   (0/3)0%   (0/7)0%   (0/181)0%   (0/51)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class RequiredRoleItemSemanticEditPolicy0%   (0/1)0%   (0/5)0%   (0/169)0%   (0/50)
RequiredRoleItemSemanticEditPolicy (): void 0%   (0/1)0%   (0/4)0%   (0/2)
getCreateRelationshipCommand (CreateRelationshipRequest): Command 0%   (0/1)0%   (0/30)0%   (0/9)
getCreateStartOutgoingAssemblyConnector_4001Command (CreateRelationshipReques... 0%   (0/1)0%   (0/45)0%   (0/14)
getCreateStartOutgoingRequiredDelegationConnector_4002Command (CreateRelation... 0%   (0/1)0%   (0/45)0%   (0/15)
getDestroyElementCommand (DestroyElementRequest): Command 0%   (0/1)0%   (0/45)0%   (0/10)
     
class RequiredRoleItemSemanticEditPolicy$10%   (0/1)0%   (0/1)0%   (0/6)0%   (0/2)
RequiredRoleItemSemanticEditPolicy$1 (RequiredRoleItemSemanticEditPolicy): void 0%   (0/1)0%   (0/6)0%   (0/2)
     
class RequiredRoleItemSemanticEditPolicy$20%   (0/1)0%   (0/1)0%   (0/6)0%   (0/2)
RequiredRoleItemSemanticEditPolicy$2 (RequiredRoleItemSemanticEditPolicy): void 0%   (0/1)0%   (0/6)0%   (0/2)

1/*
2 * Copyright 2007, SDQ, IPD, Uni Karlsruhe (TH)
3 */
4package de.uka.ipd.sdq.pcm.gmf.composite.edit.policies;
5 
6import org.eclipse.emf.ecore.EAnnotation;
7import org.eclipse.emf.ecore.EObject;
8import org.eclipse.gef.commands.Command;
9import org.eclipse.gef.commands.UnexecutableCommand;
10import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
11import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
12import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
13import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
14import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
15import org.eclipse.gmf.runtime.notation.View;
16 
17import de.uka.ipd.sdq.pcm.core.composition.ComposedStructure;
18import de.uka.ipd.sdq.pcm.core.composition.CompositionPackage;
19import de.uka.ipd.sdq.pcm.gmf.composite.providers.PalladioComponentModelElementTypes;
20import de.uka.ipd.sdq.pcm.repository.OperationRequiredRole;
21 
22/**
23 * @generated
24 */
25public class RequiredRoleItemSemanticEditPolicy extends
26                PalladioComponentModelBaseItemSemanticEditPolicy {
27 
28        /**
29         * @generated
30         */
31        public RequiredRoleItemSemanticEditPolicy() {
32// TODO: Model changed
33//                super(PalladioComponentModelElementTypes.RequiredRole_3010);
34                super(PalladioComponentModelElementTypes.OperationProvidedRole_3011);
35                
36        }
37 
38        /**
39         * @generated
40         */
41        protected Command getDestroyElementCommand(DestroyElementRequest req) {
42                View view = (View) getHost().getModel();
43                CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(
44                                getEditingDomain(), null);
45                cmd.setTransactionNestingEnabled(false);
46                EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
47                if (annotation == null) {
48                        // there are indirectly referenced children, need extra commands: false
49                        addDestroyShortcutsCommand(cmd, view);
50                        // delete host element
51                        cmd.add(new DestroyElementCommand(req));
52                } else {
53                        cmd.add(new DeleteCommand(getEditingDomain(), view));
54                }
55                return getGEFWrapper(cmd.reduce());
56        }
57 
58        // TODO: write javadoc and annotations
59        /**
60         * @generated not
61         */
62        protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
63                if (PalladioComponentModelElementTypes.AssemblyConnector_4004 == req
64                                .getElementType()) {
65                        return req.getTarget() == null ? getCreateStartOutgoingAssemblyConnector_4001Command(req)
66                                        : null;
67                }
68                if (PalladioComponentModelElementTypes.RequiredDelegationConnector_4005 == req
69                                .getElementType()) {
70                        return req.getTarget() == null ? getCreateStartOutgoingRequiredDelegationConnector_4002Command(req)
71                                        : null;
72                }
73                return super.getCreateRelationshipCommand(req);
74        }
75 
76        // TODO: write javadoc and annotations
77        /**
78         * @generated not
79         */
80        protected Command getCreateStartOutgoingAssemblyConnector_4001Command(
81                        CreateRelationshipRequest req) {
82                EObject sourceEObject = req.getSource();
83                if (false == sourceEObject instanceof OperationRequiredRole) {
84                        return UnexecutableCommand.INSTANCE;
85                }
86                OperationRequiredRole source = (OperationRequiredRole) sourceEObject;
87                ComposedStructure container = (ComposedStructure) getRelationshipContainer(
88                                source, CompositionPackage.eINSTANCE.getComposedStructure(),
89                                req.getElementType());
90                if (container == null) {
91                        return UnexecutableCommand.INSTANCE;
92                }
93                if (!PalladioComponentModelBaseItemSemanticEditPolicy.LinkConstraints
94                                .canCreateAssemblyConnector_4004(container, source, null)) {
95                        return UnexecutableCommand.INSTANCE;
96                }
97                req.setParameter("REQ_CHILD_CONTEXT", ((View) getHost().getParent()
98                                .getModel()).getElement());
99                return new Command() {
100                };
101        }
102 
103        // TODO: write javadoc and annotations
104        /**
105         * @generated not
106         */
107        protected Command getCreateStartOutgoingRequiredDelegationConnector_4002Command(
108                        CreateRelationshipRequest req) {
109                EObject sourceEObject = req.getSource();
110                if (false == sourceEObject instanceof OperationRequiredRole) {
111                        return UnexecutableCommand.INSTANCE;
112                }
113                OperationRequiredRole source = (OperationRequiredRole) sourceEObject;
114                ComposedStructure container = (ComposedStructure) getRelationshipContainer(
115                                source, CompositionPackage.eINSTANCE.getComposedStructure(),
116                                req.getElementType());
117                if (container == null) {
118                        return UnexecutableCommand.INSTANCE;
119                }
120                req.setParameter("CHILD_CONTEXT", ((View) getHost().getParent()
121                                .getModel()).getElement());
122                if (!PalladioComponentModelBaseItemSemanticEditPolicy.LinkConstraints
123                                .canCreateRequiredDelegationConnector_4005(container, source,
124                                                null)) {
125                        return UnexecutableCommand.INSTANCE;
126                }
127                return new Command() {
128                };
129        }
130 
131}

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