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

COVERAGE SUMMARY FOR SOURCE FILE [PalladioComponentModelDiagramUpdateCommand.java]

nameclass, %method, %block, %line, %
PalladioComponentModelDiagramUpdateCommand.java0%   (0/1)0%   (0/7)0%   (0/62)0%   (0/25)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PalladioComponentModelDiagramUpdateCommand0%   (0/1)0%   (0/7)0%   (0/62)0%   (0/25)
PalladioComponentModelDiagramUpdateCommand (): void 0%   (0/1)0%   (0/3)0%   (0/1)
addHandlerListener (IHandlerListener): void 0%   (0/1)0%   (0/1)0%   (0/1)
dispose (): void 0%   (0/1)0%   (0/1)0%   (0/1)
execute (ExecutionEvent): Object 0%   (0/1)0%   (0/52)0%   (0/19)
isEnabled (): boolean 0%   (0/1)0%   (0/2)0%   (0/1)
isHandled (): boolean 0%   (0/1)0%   (0/2)0%   (0/1)
removeHandlerListener (IHandlerListener): void 0%   (0/1)0%   (0/1)0%   (0/1)

1/*
2 * Copyright 2007, SDQ, IPD, Uni Karlsruhe (TH)
3 */
4package de.uka.ipd.sdq.pcm.gmf.composite.part;
5 
6import java.util.Iterator;
7import java.util.List;
8 
9import org.eclipse.core.commands.ExecutionEvent;
10import org.eclipse.core.commands.ExecutionException;
11import org.eclipse.core.commands.IHandler;
12import org.eclipse.core.commands.IHandlerListener;
13import org.eclipse.emf.ecore.EObject;
14import org.eclipse.gef.EditPart;
15import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
16import org.eclipse.gmf.runtime.notation.View;
17import org.eclipse.jface.viewers.ISelection;
18import org.eclipse.jface.viewers.IStructuredSelection;
19import org.eclipse.ui.PlatformUI;
20 
21/**
22 * @generated
23 */
24public class PalladioComponentModelDiagramUpdateCommand implements IHandler {
25 
26        /**
27         * @generated
28         */
29        public void addHandlerListener(IHandlerListener handlerListener) {
30        }
31 
32        /**
33         * @generated
34         */
35        public void dispose() {
36        }
37 
38        /**
39         * @generated
40         */
41        public Object execute(ExecutionEvent event) throws ExecutionException {
42                ISelection selection = PlatformUI.getWorkbench()
43                                .getActiveWorkbenchWindow().getSelectionService()
44                                .getSelection();
45                if (selection instanceof IStructuredSelection) {
46                        IStructuredSelection structuredSelection = (IStructuredSelection) selection;
47                        if (structuredSelection.size() != 1) {
48                                return null;
49                        }
50                        if (structuredSelection.getFirstElement() instanceof EditPart
51                                        && ((EditPart) structuredSelection.getFirstElement())
52                                                        .getModel() instanceof View) {
53                                EObject modelElement = ((View) ((EditPart) structuredSelection
54                                                .getFirstElement()).getModel()).getElement();
55                                List editPolicies = CanonicalEditPolicy
56                                                .getRegisteredEditPolicies(modelElement);
57                                for (Iterator it = editPolicies.iterator(); it.hasNext();) {
58                                        CanonicalEditPolicy nextEditPolicy = (CanonicalEditPolicy) it
59                                                        .next();
60                                        nextEditPolicy.refresh();
61                                }
62 
63                        }
64                }
65                return null;
66        }
67 
68        /**
69         * @generated
70         */
71        public boolean isEnabled() {
72                return true;
73        }
74 
75        /**
76         * @generated
77         */
78        public boolean isHandled() {
79                return true;
80        }
81 
82        /**
83         * @generated
84         */
85        public void removeHandlerListener(IHandlerListener handlerListener) {
86        }
87 
88}

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