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

COVERAGE SUMMARY FOR SOURCE FILE [PalladioComponentModelPropertySection.java]

nameclass, %method, %block, %line, %
PalladioComponentModelPropertySection.java0%   (0/1)0%   (0/6)0%   (0/130)0%   (0/39)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PalladioComponentModelPropertySection0%   (0/1)0%   (0/6)0%   (0/130)0%   (0/39)
PalladioComponentModelPropertySection (): void 0%   (0/1)0%   (0/3)0%   (0/1)
getAdapterFactory (Object): AdapterFactory 0%   (0/1)0%   (0/3)0%   (0/2)
getPropertySource (Object): IPropertySource 0%   (0/1)0%   (0/37)0%   (0/12)
getPropertySourceProvider (): IPropertySourceProvider 0%   (0/1)0%   (0/2)0%   (0/1)
setInput (IWorkbenchPart, ISelection): void 0%   (0/1)0%   (0/46)0%   (0/13)
transformSelection (Object): Object 0%   (0/1)0%   (0/39)0%   (0/10)

1/*
2 * Copyright 2007, IPD, SDQ, University of Karlsruhe
3 */
4package de.uka.ipd.sdq.pcm.gmf.repository.sheet;
5 
6import java.util.ArrayList;
7import java.util.Iterator;
8 
9import org.eclipse.core.runtime.IAdaptable;
10import org.eclipse.emf.common.notify.AdapterFactory;
11import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
12import org.eclipse.emf.edit.provider.IItemPropertySource;
13import org.eclipse.emf.edit.ui.provider.PropertySource;
14import org.eclipse.emf.transaction.TransactionalEditingDomain;
15import org.eclipse.emf.transaction.util.TransactionUtil;
16import org.eclipse.gef.EditPart;
17import org.eclipse.gmf.runtime.diagram.ui.properties.sections.AdvancedPropertySection;
18import org.eclipse.gmf.runtime.notation.View;
19import org.eclipse.jface.viewers.ISelection;
20import org.eclipse.jface.viewers.StructuredSelection;
21import org.eclipse.ui.IWorkbenchPart;
22import org.eclipse.ui.views.properties.IPropertySource;
23import org.eclipse.ui.views.properties.IPropertySourceProvider;
24 
25import de.uka.ipd.sdq.pcm.gmf.repository.part.PalladioComponentModelRepositoryDiagramEditorPlugin;
26 
27/**
28 * @generated
29 */
30public class PalladioComponentModelPropertySection extends
31                AdvancedPropertySection implements IPropertySourceProvider {
32 
33        /**
34         * @generated
35         */
36        public IPropertySource getPropertySource(Object object) {
37                if (object instanceof IPropertySource) {
38                        return (IPropertySource) object;
39                }
40                AdapterFactory af = getAdapterFactory(object);
41                if (af != null) {
42                        IItemPropertySource ips = (IItemPropertySource) af.adapt(object,
43                                        IItemPropertySource.class);
44                        if (ips != null) {
45                                return new PropertySource(object, ips);
46                        }
47                }
48                if (object instanceof IAdaptable) {
49                        return (IPropertySource) ((IAdaptable) object)
50                                        .getAdapter(IPropertySource.class);
51                }
52                return null;
53        }
54 
55        /**
56         * @generated
57         */
58        protected IPropertySourceProvider getPropertySourceProvider() {
59                return this;
60        }
61 
62        /**
63         * Modify/unwrap selection.
64         * @generated
65         */
66        protected Object transformSelection(Object selected) {
67 
68                if (selected instanceof EditPart) {
69                        Object model = ((EditPart) selected).getModel();
70                        return model instanceof View ? ((View) model).getElement() : null;
71                }
72                if (selected instanceof View) {
73                        return ((View) selected).getElement();
74                }
75                if (selected instanceof IAdaptable) {
76                        View view = (View) ((IAdaptable) selected).getAdapter(View.class);
77                        if (view != null) {
78                                return view.getElement();
79                        }
80                }
81                return selected;
82        }
83 
84        /**
85         * @generated
86         */
87        public void setInput(IWorkbenchPart part, ISelection selection) {
88                if (selection.isEmpty()
89                                || false == selection instanceof StructuredSelection) {
90                        super.setInput(part, selection);
91                        return;
92                }
93                final StructuredSelection structuredSelection = ((StructuredSelection) selection);
94                ArrayList transformedSelection = new ArrayList(structuredSelection
95                                .size());
96                for (Iterator it = structuredSelection.iterator(); it.hasNext();) {
97                        Object r = transformSelection(it.next());
98                        if (r != null) {
99                                transformedSelection.add(r);
100                        }
101                }
102                super.setInput(part, new StructuredSelection(transformedSelection));
103        }
104 
105        /**
106         * @generated not
107         */
108        protected AdapterFactory getAdapterFactory(Object object) {
109                return PalladioComponentModelRepositoryDiagramEditorPlugin
110                                .getInstance().getItemProvidersAdapterFactory();
111        }
112 
113}

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