EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.pcm.gmf.repository.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, IPD, SDQ, University of Karlsruhe
3 */
4package de.uka.ipd.sdq.pcm.gmf.repository.part;
5 
6import org.eclipse.emf.edit.ui.action.LoadResourceAction;
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;
13 
14import de.uka.ipd.sdq.pcm.gmf.repository.edit.parts.RepositoryEditPart;
15 
16/**
17 * @generated
18 */
19public class PalladioComponentModelLoadResourceAction implements
20                IObjectActionDelegate {
21 
22        /**
23         * @generated
24         */
25        private RepositoryEditPart mySelectedElement;
26 
27        /**
28         * @generated
29         */
30        private Shell myShell;
31 
32        /**
33         * @generated
34         */
35        public void setActivePart(IAction action, IWorkbenchPart targetPart) {
36                myShell = targetPart.getSite().getShell();
37        }
38 
39        /**
40         * @generated
41         */
42        public void run(IAction action) {
43                LoadResourceAction.LoadResourceDialog loadResourceDialog = new LoadResourceAction.LoadResourceDialog(
44                                myShell, mySelectedElement.getEditingDomain());
45                loadResourceDialog.open();
46        }
47 
48        /**
49         * @generated
50         */
51        public void selectionChanged(IAction action, ISelection selection) {
52                mySelectedElement = null;
53                if (selection instanceof IStructuredSelection) {
54                        IStructuredSelection structuredSelection = (IStructuredSelection) selection;
55                        if (structuredSelection.size() == 1
56                                        && structuredSelection.getFirstElement() instanceof RepositoryEditPart) {
57                                mySelectedElement = (RepositoryEditPart) structuredSelection
58                                                .getFirstElement();
59                        }
60                }
61                action.setEnabled(isEnabled());
62        }
63 
64        /**
65         * @generated
66         */
67        private boolean isEnabled() {
68                return mySelectedElement != null;
69        }
70 
71}

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