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

COVERAGE SUMMARY FOR SOURCE FILE [PalladioComponentModelSheetLabelProvider.java]

nameclass, %method, %block, %line, %
PalladioComponentModelSheetLabelProvider.java0%   (0/1)0%   (0/6)0%   (0/78)0%   (0/19)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PalladioComponentModelSheetLabelProvider0%   (0/1)0%   (0/6)0%   (0/78)0%   (0/19)
PalladioComponentModelSheetLabelProvider (): void 0%   (0/1)0%   (0/9)0%   (0/3)
getImage (Object): Image 0%   (0/1)0%   (0/6)0%   (0/1)
getText (Object): String 0%   (0/1)0%   (0/8)0%   (0/2)
unwrap (Object): Object 0%   (0/1)0%   (0/34)0%   (0/9)
unwrapEditPart (EditPart): Object 0%   (0/1)0%   (0/13)0%   (0/3)
unwrapView (View): Object 0%   (0/1)0%   (0/8)0%   (0/1)

1/*
2 * Copyright 2007, SDQ, IPD, U KA
3 */
4package de.uka.ipd.sdq.pcm.gmf.allocation.sheet;
5 
6import org.eclipse.core.runtime.IAdaptable;
7import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
8import org.eclipse.gef.EditPart;
9import org.eclipse.gmf.runtime.notation.View;
10import org.eclipse.jface.viewers.DecoratingLabelProvider;
11import org.eclipse.jface.viewers.IStructuredSelection;
12import org.eclipse.swt.graphics.Image;
13 
14import de.uka.ipd.sdq.pcm.gmf.allocation.part.PalladioComponentModelAllocationDiagramEditorPlugin;
15 
16/**
17 * @generated
18 */
19public class PalladioComponentModelSheetLabelProvider extends
20                DecoratingLabelProvider {
21 
22        /**
23         * @generated
24         */
25        public PalladioComponentModelSheetLabelProvider() {
26                super(new AdapterFactoryLabelProvider(
27                                PalladioComponentModelAllocationDiagramEditorPlugin
28                                                .getInstance().getItemProvidersAdapterFactory()), null);
29        }
30 
31        /**
32         * @generated
33         */
34        public String getText(Object element) {
35                Object selected = unwrap(element);
36                return super.getText(selected);
37        }
38 
39        /**
40         * @generated
41         */
42        public Image getImage(Object element) {
43                return super.getImage(unwrap(element));
44        }
45 
46        /**
47         * @generated
48         */
49        private Object unwrap(Object element) {
50                if (element instanceof IStructuredSelection) {
51                        return unwrap(((IStructuredSelection) element).getFirstElement());
52                }
53                if (element instanceof EditPart) {
54                        return unwrapEditPart((EditPart) element);
55                }
56                if (element instanceof IAdaptable) {
57                        View view = (View) ((IAdaptable) element).getAdapter(View.class);
58                        if (view != null) {
59                                return unwrapView(view);
60                        }
61                }
62                return element;
63        }
64 
65        /**
66         * @generated
67         */
68        private Object unwrapEditPart(EditPart p) {
69                if (p.getModel() instanceof View) {
70                        return unwrapView((View) p.getModel());
71                }
72                return p.getModel();
73        }
74 
75        /**
76         * @generated
77         */
78        private Object unwrapView(View view) {
79                return view.getElement() == null ? view : view.getElement();
80        }
81 
82}

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