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

COVERAGE SUMMARY FOR SOURCE FILE [PalladioComponentModelCreateShortcutDecorationsCommand.java]

nameclass, %method, %block, %line, %
PalladioComponentModelCreateShortcutDecorationsCommand.java0%   (0/1)0%   (0/3)0%   (0/59)0%   (0/18)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PalladioComponentModelCreateShortcutDecorationsCommand0%   (0/1)0%   (0/3)0%   (0/59)0%   (0/18)
PalladioComponentModelCreateShortcutDecorationsCommand (TransactionalEditingD... 0%   (0/1)0%   (0/7)0%   (0/3)
PalladioComponentModelCreateShortcutDecorationsCommand (TransactionalEditingD... 0%   (0/1)0%   (0/10)0%   (0/3)
doExecuteWithResult (IProgressMonitor, IAdaptable): CommandResult 0%   (0/1)0%   (0/42)0%   (0/12)

1/*
2 * Copyright 2007, IPD, SDQ, University of Karlsruhe
3 */
4package de.uka.ipd.sdq.pcm.gmf.repository.edit.commands;
5 
6import java.util.Collections;
7import java.util.Iterator;
8import java.util.List;
9 
10import org.eclipse.core.commands.ExecutionException;
11import org.eclipse.core.runtime.IAdaptable;
12import org.eclipse.core.runtime.IProgressMonitor;
13import org.eclipse.emf.ecore.EAnnotation;
14import org.eclipse.emf.ecore.EcoreFactory;
15import org.eclipse.emf.transaction.TransactionalEditingDomain;
16import org.eclipse.gmf.runtime.common.core.command.CommandResult;
17import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
18import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
19import org.eclipse.gmf.runtime.notation.View;
20 
21import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.RepositoryEditPart;
22 
23/**
24 * @generated
25 */
26public class PalladioComponentModelCreateShortcutDecorationsCommand extends
27                AbstractTransactionalCommand {
28 
29        /**
30         * @generated
31         */
32        private List myDescriptors;
33 
34        /**
35         * @generated
36         */
37        public PalladioComponentModelCreateShortcutDecorationsCommand(
38                        TransactionalEditingDomain editingDomain, View parentView,
39                        List viewDescriptors) {
40                super(editingDomain, "Create Shortcuts", getWorkspaceFiles(parentView)); //$NON-NLS-1$
41                myDescriptors = viewDescriptors;
42        }
43 
44        /**
45         * @generated
46         */
47        public PalladioComponentModelCreateShortcutDecorationsCommand(
48                        TransactionalEditingDomain editingDomain, View parentView,
49                        CreateViewRequest.ViewDescriptor viewDescriptor) {
50                this(editingDomain, parentView, Collections
51                                .singletonList(viewDescriptor));
52        }
53 
54        /**
55         * @generated
56         */
57        protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
58                        IAdaptable info) throws ExecutionException {
59                for (Iterator it = myDescriptors.iterator(); it.hasNext();) {
60                        CreateViewRequest.ViewDescriptor nextDescriptor = (CreateViewRequest.ViewDescriptor) it
61                                        .next();
62                        View view = (View) nextDescriptor.getAdapter(View.class);
63                        if (view != null && view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
64                                EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE
65                                                .createEAnnotation();
66                                shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
67                                shortcutAnnotation.getDetails().put(
68                                                "modelID", RepositoryEditPart.MODEL_ID); //$NON-NLS-1$
69                                view.getEAnnotations().add(shortcutAnnotation);
70                        }
71                }
72                return CommandResult.newOKCommandResult();
73        }
74 
75}

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