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 [PalladioComponentModelLoadResourceAction.java]

nameclass, %method, %block, %line, %
PalladioComponentModelLoadResourceAction.java0%   (0/1)0%   (0/5)0%   (0/56)0%   (0/17)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PalladioComponentModelLoadResourceAction0%   (0/1)0%   (0/5)0%   (0/56)0%   (0/17)
PalladioComponentModelLoadResourceAction (): void 0%   (0/1)0%   (0/3)0%   (0/1)
isEnabled (): boolean 0%   (0/1)0%   (0/7)0%   (0/1)
run (IAction): void 0%   (0/1)0%   (0/13)0%   (0/4)
selectionChanged (IAction, ISelection): void 0%   (0/1)0%   (0/27)0%   (0/9)
setActivePart (IAction, IWorkbenchPart): void 0%   (0/1)0%   (0/6)0%   (0/2)

1/*
2 *Copyright 2007, SDQ, IPD, Uni Karlsruhe (TH)
3 */
4package de.uka.ipd.sdq.pcm.gmf.composite.part;
5 
6import org.eclipse.emf.edit.ui.action.LoadResourceAction.LoadResourceDialog;
7import org.eclipse.jface.action.IAction;
8import org.eclipse.jface.viewers.ISelection;
9import org.eclipse.jface.viewers.IStructuredSelection;
10import org.eclipse.swt.widgets.Shell;
11import org.eclipse.ui.IObjectActionDelegate;
12import org.eclipse.ui.IWorkbenchPart;
13import de.uka.ipd.sdq.pcm.gmf.composite.edit.parts.ComposedProvidingRequiringEntityEditPart;
14 
15/**
16 * @generated
17 */
18public class PalladioComponentModelLoadResourceAction implements
19                IObjectActionDelegate {
20 
21        /**
22         * @generated
23         */
24        private ComposedProvidingRequiringEntityEditPart mySelectedElement;
25 
26        /**
27         * @generated
28         */
29        private Shell myShell;
30 
31        /**
32         * @generated
33         */
34        public void setActivePart(IAction action, IWorkbenchPart targetPart) {
35                myShell = targetPart.getSite().getShell();
36        }
37 
38        /**
39         * @generated
40         */
41        public void run(IAction action) {
42                LoadResourceDialog loadResourceDialog = new LoadResourceDialog(myShell,
43                                mySelectedElement.getEditingDomain());
44                loadResourceDialog.open();
45        }
46 
47        /**
48         * @generated
49         */
50        public void selectionChanged(IAction action, ISelection selection) {
51                mySelectedElement = null;
52                if (selection instanceof IStructuredSelection) {
53                        IStructuredSelection structuredSelection = (IStructuredSelection) selection;
54                        if (structuredSelection.size() == 1
55                                        && structuredSelection.getFirstElement() instanceof ComposedProvidingRequiringEntityEditPart) {
56                                mySelectedElement = (ComposedProvidingRequiringEntityEditPart) structuredSelection
57                                                .getFirstElement();
58                        }
59                }
60                action.setEnabled(isEnabled());
61        }
62 
63        /**
64         * @generated
65         */
66        private boolean isEnabled() {
67                return mySelectedElement != null;
68        }
69 
70}

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