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

COVERAGE SUMMARY FOR SOURCE FILE [AdvancedPropertySection.java]

nameclass, %method, %block, %line, %
AdvancedPropertySection.java0%   (0/1)0%   (0/6)0%   (0/124)0%   (0/36)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AdvancedPropertySection0%   (0/1)0%   (0/6)0%   (0/124)0%   (0/36)
AdvancedPropertySection (): void 0%   (0/1)0%   (0/3)0%   (0/1)
createControls (Composite, TabbedPropertySheetPage): void 0%   (0/1)0%   (0/93)0%   (0/24)
dispose (): void 0%   (0/1)0%   (0/12)0%   (0/5)
refresh (): void 0%   (0/1)0%   (0/4)0%   (0/2)
setInput (IWorkbenchPart, ISelection): void 0%   (0/1)0%   (0/10)0%   (0/3)
shouldUseExtraSpace (): boolean 0%   (0/1)0%   (0/2)0%   (0/1)

1/**
2 * 
3 */
4package de.uka.ipd.sdq.pcmbench.tabs;
5 
6import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
7import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
8import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
9import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
10import org.eclipse.jface.viewers.ISelection;
11import org.eclipse.swt.layout.FormAttachment;
12import org.eclipse.swt.layout.FormData;
13import org.eclipse.swt.widgets.Composite;
14import org.eclipse.ui.IWorkbenchPart;
15import org.eclipse.ui.views.properties.PropertySheetPage;
16import org.eclipse.ui.views.properties.tabbed.AbstractPropertySection;
17import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
18 
19import de.uka.ipd.sdq.pcm.repository.provider.RepositoryItemProviderAdapterFactory;
20import de.uka.ipd.sdq.pcm.seff.provider.SeffItemProviderAdapterFactory;
21 
22/**
23 * @author Snowball
24 * "Advanced" Property Section showing the original generated EMF
25 * property sheet
26 */
27public class AdvancedPropertySection
28extends AbstractPropertySection {
29 
30        /**
31         * The Property Sheet Page used to display the standard properties
32         */
33        protected PropertySheetPage page;
34        private ComposedAdapterFactory adapterFactory;
35 
36        /**
37         * @see org.eclipse.ui.views.properties.tabbed.ISection#createControls(org.eclipse.swt.widgets.Composite,
38         *      org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage)
39         */
40        @Override
41        public void createControls(Composite parent,
42                        TabbedPropertySheetPage tabbedPropertySheetPage) {
43 
44                super.createControls(parent, tabbedPropertySheetPage);
45                Composite composite = getWidgetFactory()
46                        .createFlatFormComposite(parent);
47                page = new PropertySheetPage();
48 
49                page.createControl(composite);
50                FormData data = new FormData();
51                data.left = new FormAttachment(0, 0);
52                data.right = new FormAttachment(100, 0);
53                data.top = new FormAttachment(0, 0);
54                data.bottom = new FormAttachment(100, 0);
55                page.getControl().setLayoutData(data);
56                
57                adapterFactory = new ComposedAdapterFactory();
58                adapterFactory
59                        .addAdapterFactory(new RepositoryItemProviderAdapterFactory());
60                adapterFactory
61                        .addAdapterFactory(new SeffItemProviderAdapterFactory());
62                adapterFactory
63                        .addAdapterFactory(new ResourceItemProviderAdapterFactory());
64                adapterFactory
65                                .addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
66                
67                page
68                .setPropertySourceProvider(new AdapterFactoryContentProvider(
69                                adapterFactory));
70 
71        }
72 
73        /**
74         * @see org.eclipse.ui.views.properties.tabbed.ISection#setInput(org.eclipse.ui.IWorkbenchPart,
75         *      org.eclipse.jface.viewers.ISelection)
76         */
77        @Override
78        public void setInput(IWorkbenchPart part, ISelection selection) {
79                super.setInput(part, selection);
80                page.selectionChanged(part, selection);
81        }
82 
83        /**
84         * @see org.eclipse.ui.views.properties.tabbed.ISection#dispose()
85         */
86        @Override
87        public void dispose() {
88                super.dispose();
89 
90                if (page != null) {
91                        page.dispose();
92                        page = null;
93                }
94 
95        }
96 
97        /**
98         * @see org.eclipse.ui.views.properties.tabbed.ISection#refresh()
99         */
100        @Override
101        public void refresh() {
102                page.refresh();
103        }
104 
105        /**
106         * @see org.eclipse.ui.views.properties.tabbed.ISection#shouldUseExtraSpace()
107         */
108        @Override
109        public boolean shouldUseExtraSpace() {
110                return true;
111        }
112}

[all classes][de.uka.ipd.sdq.pcmbench.tabs]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov