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

COVERAGE SUMMARY FOR SOURCE FILE [DeleteElementAction.java]

nameclass, %method, %block, %line, %
DeleteElementAction.java0%   (0/1)0%   (0/5)0%   (0/95)0%   (0/32)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DeleteElementAction0%   (0/1)0%   (0/5)0%   (0/95)0%   (0/32)
DeleteElementAction (IWorkbenchPage): void 0%   (0/1)0%   (0/4)0%   (0/2)
DeleteElementAction (IWorkbenchPart): void 0%   (0/1)0%   (0/4)0%   (0/2)
getCommand (Request): Command 0%   (0/1)0%   (0/55)0%   (0/14)
getCommandLabel (): String 0%   (0/1)0%   (0/2)0%   (0/1)
init (): void 0%   (0/1)0%   (0/30)0%   (0/13)

1/*
2 * Copyright 2007, SDQ, IPD, University of Karlsruhe
3 */
4package de.uka.ipd.sdq.pcm.gmf.usage.part;
5 
6import java.util.Iterator;
7import java.util.List;
8 
9import org.eclipse.gef.EditPart;
10import org.eclipse.gef.Request;
11import org.eclipse.gef.commands.Command;
12import org.eclipse.gef.commands.UnexecutableCommand;
13import org.eclipse.gmf.runtime.diagram.ui.actions.AbstractDeleteFromAction;
14import org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds;
15import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
16import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
17import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
18import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
19import org.eclipse.ui.ISharedImages;
20import org.eclipse.ui.IWorkbenchPage;
21import org.eclipse.ui.IWorkbenchPart;
22import org.eclipse.ui.PlatformUI;
23 
24/**
25 * @generated
26 */
27public class DeleteElementAction extends AbstractDeleteFromAction {
28 
29        /**
30         * @generated
31         */
32        public DeleteElementAction(IWorkbenchPart part) {
33                super(part);
34        }
35 
36        /**
37         * @generated
38         */
39        public DeleteElementAction(IWorkbenchPage workbenchPage) {
40                super(workbenchPage);
41        }
42 
43        /**
44         * @generated
45         */
46        public void init() {
47                super.init();
48                setId(ActionIds.ACTION_DELETE_FROM_MODEL);
49                setText(DiagramUIMessages.DiagramEditor_Delete_from_Model);
50                setToolTipText(DiagramUIMessages.DiagramEditor_Delete_from_ModelToolTip);
51                ISharedImages workbenchImages = PlatformUI.getWorkbench()
52                                .getSharedImages();
53                setHoverImageDescriptor(workbenchImages
54                                .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
55                setImageDescriptor(workbenchImages
56                                .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
57                setDisabledImageDescriptor(workbenchImages
58                                .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED));
59        }
60 
61        /**
62         * @generated
63         */
64        protected String getCommandLabel() {
65                return DiagramUIMessages.DiagramEditor_Delete_from_Model;
66        }
67 
68        /**
69         * @generated
70         */
71        protected Command getCommand(Request request) {
72                List operationSet = getOperationSet();
73                if (operationSet.isEmpty()) {
74                        return UnexecutableCommand.INSTANCE;
75                }
76                Iterator editParts = operationSet.iterator();
77                CompositeTransactionalCommand command = new CompositeTransactionalCommand(
78                                getEditingDomain(), getCommandLabel());
79                while (editParts.hasNext()) {
80                        EditPart editPart = (EditPart) editParts.next();
81                        Command curCommand = editPart.getCommand(request);
82                        if (curCommand != null) {
83                                command.compose(new CommandProxy(curCommand));
84                        }
85                }
86                if (command.isEmpty() || command.size() != operationSet.size()) {
87                        return UnexecutableCommand.INSTANCE;
88                }
89                return new ICommandProxy(command);
90        }
91}

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