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

COVERAGE SUMMARY FOR SOURCE FILE [ResourceContainerItemSemanticEditPolicy.java]

nameclass, %method, %block, %line, %
ResourceContainerItemSemanticEditPolicy.java0%   (0/1)0%   (0/3)0%   (0/83)0%   (0/22)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ResourceContainerItemSemanticEditPolicy0%   (0/1)0%   (0/3)0%   (0/83)0%   (0/22)
ResourceContainerItemSemanticEditPolicy (): void 0%   (0/1)0%   (0/3)0%   (0/1)
addDestroyChildNodesCommand (CompoundCommand): void 0%   (0/1)0%   (0/48)0%   (0/13)
getDestroyElementCommand (DestroyElementRequest): Command 0%   (0/1)0%   (0/32)0%   (0/8)

1/*
2 * Copyright 2007, SDQ, IPD, U KA
3 */
4package de.uka.ipd.sdq.pcm.gmf.allocation.edit.policies;
5 
6import java.util.ArrayList;
7import java.util.Collection;
8import java.util.Collections;
9import java.util.Iterator;
10 
11import org.eclipse.core.commands.ExecutionException;
12import org.eclipse.core.runtime.IAdaptable;
13import org.eclipse.core.runtime.IProgressMonitor;
14import org.eclipse.emf.ecore.EAnnotation;
15import org.eclipse.emf.ecore.EObject;
16import org.eclipse.emf.ecore.resource.Resource;
17import org.eclipse.gef.EditPart;
18import org.eclipse.gef.commands.Command;
19import org.eclipse.gef.commands.CompoundCommand;
20import org.eclipse.gmf.runtime.common.core.command.CommandResult;
21import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
22import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
23import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
24import org.eclipse.gmf.runtime.notation.Edge;
25import org.eclipse.gmf.runtime.notation.Node;
26import org.eclipse.gmf.runtime.notation.View;
27 
28import de.uka.ipd.sdq.pcm.gmf.allocation.edit.parts.AllocationContextEditPart;
29import de.uka.ipd.sdq.pcm.gmf.allocation.edit.parts.ResourceContainerAllocationCompartmentEditPart;
30import de.uka.ipd.sdq.pcm.gmf.allocation.edit.parts.ResourceContainerEditPart;
31import de.uka.ipd.sdq.pcm.gmf.allocation.part.PalladioComponentModelVisualIDRegistry;
32 
33/**
34 * @generated
35 */
36public class ResourceContainerItemSemanticEditPolicy extends
37                PalladioComponentModelBaseItemSemanticEditPolicy {
38 
39        /**
40         * @generated
41         */
42        protected Command getDestroyElementCommand(DestroyElementRequest req) {
43                CompoundCommand cc = getDestroyEdgesCommand();
44                addDestroyChildNodesCommand(cc);
45                addDestroyShortcutsCommand(cc);
46                View view = (View) getHost().getModel();
47                if (view.getEAnnotation("Shortcut") != null) { //$NON-NLS-1$
48                        req.setElementToDestroy(view);
49                }
50                cc.add(getGEFWrapper(new DestroyElementCommand(req)));
51                return cc.unwrap();
52        }
53 
54        /**
55         * @generated
56         */
57        protected void addDestroyChildNodesCommand(CompoundCommand cmd) {
58                View view = (View) getHost().getModel();
59                EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
60                if (annotation != null) {
61                        return;
62                }
63                for (Iterator it = view.getChildren().iterator(); it.hasNext();) {
64                        Node node = (Node) it.next();
65                        switch (PalladioComponentModelVisualIDRegistry.getVisualID(node)) {
66                        case ResourceContainerAllocationCompartmentEditPart.VISUAL_ID:
67                                for (Iterator cit = node.getChildren().iterator(); cit
68                                                .hasNext();) {
69                                        Node cnode = (Node) cit.next();
70                                        switch (PalladioComponentModelVisualIDRegistry
71                                                        .getVisualID(cnode)) {
72                                        case AllocationContextEditPart.VISUAL_ID:
73                                                cmd.add(getDestroyElementCommand(cnode));
74                                                break;
75                                        }
76                                }
77                                break;
78                        }
79                }
80        }
81 
82}

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