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

COVERAGE SUMMARY FOR SOURCE FILE [ProcessingResourceSpecificationItemSemanticEditPolicy.java]

nameclass, %method, %block, %line, %
ProcessingResourceSpecificationItemSemanticEditPolicy.java0%   (0/1)0%   (0/3)0%   (0/88)0%   (0/23)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ProcessingResourceSpecificationItemSemanticEditPolicy0%   (0/1)0%   (0/3)0%   (0/88)0%   (0/23)
ProcessingResourceSpecificationItemSemanticEditPolicy (): void 0%   (0/1)0%   (0/4)0%   (0/3)
addDestroyChildNodesCommand (ICompositeCommand): void 0%   (0/1)0%   (0/36)0%   (0/9)
getDestroyElementCommand (DestroyElementRequest): Command 0%   (0/1)0%   (0/48)0%   (0/11)

1/*
2 * Copyright 2009, SDQ, IPD, Uni Karlsruhe (TH)
3 */
4package de.uka.ipd.sdq.pcm.gmf.resource.edit.policies;
5 
6import java.util.Iterator;
7 
8import org.eclipse.emf.ecore.EAnnotation;
9import org.eclipse.gef.commands.Command;
10import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand;
11import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
12import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
13import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
14import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
15import org.eclipse.gmf.runtime.notation.Node;
16import org.eclipse.gmf.runtime.notation.View;
17 
18import de.uka.ipd.sdq.pcm.gmf.resource.edit.parts.ProcessingResourceSpecificationProcessingResourceSpecificationCompartmentEditPart;
19import de.uka.ipd.sdq.pcm.gmf.resource.part.PalladioComponentModelVisualIDRegistry;
20import de.uka.ipd.sdq.pcm.gmf.resource.providers.PalladioComponentModelElementTypes;
21 
22/**
23 * @generated
24 */
25public class ProcessingResourceSpecificationItemSemanticEditPolicy extends
26                PalladioComponentModelBaseItemSemanticEditPolicy {
27 
28        /**
29         * @generated
30         */
31        public ProcessingResourceSpecificationItemSemanticEditPolicy() {
32                super(
33                                PalladioComponentModelElementTypes.ProcessingResourceSpecification_3001);
34        }
35 
36        /**
37         * @generated
38         */
39        protected Command getDestroyElementCommand(DestroyElementRequest req) {
40                View view = (View) getHost().getModel();
41                CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(
42                                getEditingDomain(), null);
43                cmd.setTransactionNestingEnabled(false);
44                EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
45                if (annotation == null) {
46                        // there are indirectly referenced children, need extra commands: false
47                        addDestroyChildNodesCommand(cmd);
48                        addDestroyShortcutsCommand(cmd, view);
49                        // delete host element
50                        cmd.add(new DestroyElementCommand(req));
51                } else {
52                        cmd.add(new DeleteCommand(getEditingDomain(), view));
53                }
54                return getGEFWrapper(cmd.reduce());
55        }
56 
57        /**
58         * @generated
59         */
60        private void addDestroyChildNodesCommand(ICompositeCommand cmd) {
61                View view = (View) getHost().getModel();
62                for (Iterator nit = view.getChildren().iterator(); nit.hasNext();) {
63                        Node node = (Node) nit.next();
64                        switch (PalladioComponentModelVisualIDRegistry.getVisualID(node)) {
65                        case ProcessingResourceSpecificationProcessingResourceSpecificationCompartmentEditPart.VISUAL_ID:
66                                for (Iterator cit = node.getChildren().iterator(); cit
67                                                .hasNext();) {
68                                        Node cnode = (Node) cit.next();
69                                        switch (PalladioComponentModelVisualIDRegistry
70                                                        .getVisualID(cnode)) {
71                                        }
72                                }
73                                break;
74                        }
75                }
76        }
77 
78}

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