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

nameclass, %method, %block, %line, %
PalladioComponentModelComposedStructureDiagramEditorPlugin.java0%   (0/2)0%   (0/22)0%   (0/392)0%   (0/108)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PalladioComponentModelComposedStructureDiagramEditorPlugin0%   (0/1)0%   (0/20)0%   (0/380)0%   (0/106)
<static initializer> 0%   (0/1)0%   (0/6)0%   (0/3)
PalladioComponentModelComposedStructureDiagramEditorPlugin (): void 0%   (0/1)0%   (0/3)0%   (0/2)
access$0 (PalladioComponentModelComposedStructureDiagramEditorPlugin): Adapte... 0%   (0/1)0%   (0/3)0%   (0/1)
createAdapterFactory (): AdapterFactory 0%   (0/1)0%   (0/18)0%   (0/4)
debug (String, Throwable): void 0%   (0/1)0%   (0/14)0%   (0/7)
fillItemProviderFactories (List): void 0%   (0/1)0%   (0/157)0%   (0/31)
findImageDescriptor (String): ImageDescriptor 0%   (0/1)0%   (0/27)0%   (0/5)
getBundledImage (String): Image 0%   (0/1)0%   (0/20)0%   (0/5)
getBundledImageDescriptor (String): ImageDescriptor 0%   (0/1)0%   (0/4)0%   (0/1)
getDocumentProvider (): PalladioComponentModelDocumentProvider 0%   (0/1)0%   (0/11)0%   (0/3)
getInstance (): PalladioComponentModelComposedStructureDiagramEditorPlugin 0%   (0/1)0%   (0/2)0%   (0/1)
getItemImageDescriptor (Object): ImageDescriptor 0%   (0/1)0%   (0/17)0%   (0/6)
getItemProvidersAdapterFactory (): AdapterFactory 0%   (0/1)0%   (0/3)0%   (0/1)
getString (String): String 0%   (0/1)0%   (0/11)0%   (0/1)
logError (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
logError (String, Throwable): void 0%   (0/1)0%   (0/23)0%   (0/10)
logInfo (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
logInfo (String, Throwable): void 0%   (0/1)0%   (0/23)0%   (0/10)
start (BundleContext): void 0%   (0/1)0%   (0/15)0%   (0/6)
stop (BundleContext): void 0%   (0/1)0%   (0/13)0%   (0/5)
     
class PalladioComponentModelComposedStructureDiagramEditorPlugin$10%   (0/1)0%   (0/2)0%   (0/12)0%   (0/3)
PalladioComponentModelComposedStructureDiagramEditorPlugin$1 (PalladioCompone... 0%   (0/1)0%   (0/7)0%   (0/2)
getRootAdapterFactory (): ComposeableAdapterFactory 0%   (0/1)0%   (0/5)0%   (0/1)

1/*
2 *Copyright 2007, SDQ, IPD, Uni Karlsruhe (TH)
3 */
4package de.uka.ipd.sdq.pcm.gmf.composite.part;
5 
6import java.util.ArrayList;
7import java.util.List;
8 
9import org.eclipse.core.runtime.IPath;
10import org.eclipse.core.runtime.IStatus;
11import org.eclipse.core.runtime.Path;
12import org.eclipse.core.runtime.Platform;
13import org.eclipse.core.runtime.Status;
14import org.eclipse.emf.common.notify.AdapterFactory;
15import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
16import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
17import org.eclipse.emf.edit.provider.IItemLabelProvider;
18import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
19import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
20import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
21import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
22import org.eclipse.jface.resource.ImageDescriptor;
23import org.eclipse.swt.graphics.Image;
24import org.eclipse.ui.plugin.AbstractUIPlugin;
25import org.osgi.framework.BundleContext;
26 
27import de.uka.ipd.sdq.identifier.provider.IdentifierItemProviderAdapterFactory;
28import de.uka.ipd.sdq.pcm.allocation.provider.AllocationItemProviderAdapterFactory;
29import de.uka.ipd.sdq.pcm.core.composition.provider.CompositionItemProviderAdapterFactory;
30 
31import de.uka.ipd.sdq.pcm.core.entity.provider.EntityItemProviderAdapterFactory;
32import de.uka.ipd.sdq.pcm.core.provider.CoreItemProviderAdapterFactory;
33import de.uka.ipd.sdq.pcm.parameter.provider.ParameterItemProviderAdapterFactory;
34import de.uka.ipd.sdq.pcm.protocol.provider.ProtocolItemProviderAdapterFactory;
35import de.uka.ipd.sdq.pcm.provider.PcmItemProviderAdapterFactory;
36import de.uka.ipd.sdq.pcm.qosannotations.provider.QosannotationsItemProviderAdapterFactory;
37import de.uka.ipd.sdq.pcm.qosannotations.qos_performance.provider.Qos_performanceItemProviderAdapterFactory;
38import de.uka.ipd.sdq.pcm.qosannotations.qos_reliability.provider.Qos_reliabilityItemProviderAdapterFactory;
39import de.uka.ipd.sdq.pcm.reliability.provider.ReliabilityItemProviderAdapterFactory;
40import de.uka.ipd.sdq.pcm.repository.provider.RepositoryItemProviderAdapterFactory;
41import de.uka.ipd.sdq.pcm.resourceenvironment.provider.ResourceenvironmentItemProviderAdapterFactory;
42import de.uka.ipd.sdq.pcm.resourcetype.provider.ResourcetypeItemProviderAdapterFactory;
43import de.uka.ipd.sdq.pcm.seff.provider.SeffItemProviderAdapterFactory;
44import de.uka.ipd.sdq.pcm.seff.seff_performance.provider.Seff_performanceItemProviderAdapterFactory;
45import de.uka.ipd.sdq.pcm.seff.seff_reliability.provider.Seff_reliabilityItemProviderAdapterFactory;
46import de.uka.ipd.sdq.pcm.subsystem.provider.SubsystemItemProviderAdapterFactory;
47import de.uka.ipd.sdq.pcm.system.provider.SystemItemProviderAdapterFactory;
48import de.uka.ipd.sdq.pcm.usagemodel.provider.UsagemodelItemProviderAdapterFactory;
49import de.uka.ipd.sdq.pcmbench.ui.provider.PalladioItemProviderAdapterFactory;
50import de.uka.ipd.sdq.probfunction.provider.ProbfunctionItemProviderAdapterFactory;
51import de.uka.ipd.sdq.stoex.provider.StoexItemProviderAdapterFactory;
52import de.uka.ipd.sdq.units.provider.UnitsItemProviderAdapterFactory;
53 
54/**
55 * @generated
56 */
57public class PalladioComponentModelComposedStructureDiagramEditorPlugin extends
58                AbstractUIPlugin {
59 
60        /**
61         * @generated
62         */
63        public static final String ID = "de.uka.ipd.sdq.pcm.gmf.composite"; //$NON-NLS-1$
64 
65        /**
66         * @generated
67         */
68        public static final PreferencesHint DIAGRAM_PREFERENCES_HINT = new PreferencesHint(
69                        ID);
70 
71        /**
72         * @generated
73         */
74        private static PalladioComponentModelComposedStructureDiagramEditorPlugin instance;
75 
76        /**
77         * @generated not
78         */
79        private AdapterFactory adapterFactory;
80 
81        /**
82         * @generated
83         */
84        private PalladioComponentModelDocumentProvider documentProvider;
85 
86        /**
87         * @generated
88         */
89        public PalladioComponentModelComposedStructureDiagramEditorPlugin() {
90        }
91 
92        /**
93         * @generated
94         */
95        public void start(BundleContext context) throws Exception {
96                super.start(context);
97                instance = this;
98                PreferencesHint.registerPreferenceStore(DIAGRAM_PREFERENCES_HINT,
99                                getPreferenceStore());
100                adapterFactory = createAdapterFactory();
101        }
102 
103        /**
104         * @generated not
105         */
106        public void stop(BundleContext context) throws Exception {
107                ((PalladioItemProviderAdapterFactory) adapterFactory).dispose();
108                adapterFactory = null;
109                instance = null;
110                super.stop(context);
111        }
112 
113        /**
114         * @generated
115         */
116        public static PalladioComponentModelComposedStructureDiagramEditorPlugin getInstance() {
117                return instance;
118        }
119 
120        /**
121         * @generated not
122         */
123        protected AdapterFactory createAdapterFactory() {
124                List factories = new ArrayList();
125                fillItemProviderFactories(factories);
126                ComposedAdapterFactory caf = new ComposedAdapterFactory(factories) {
127 
128                        @Override
129                        public ComposeableAdapterFactory getRootAdapterFactory() {
130                                // TODO Auto-generated method stub
131                                return (PalladioItemProviderAdapterFactory) adapterFactory;
132                        }
133 
134                };
135                return new PalladioItemProviderAdapterFactory(caf);
136        }
137 
138        /**
139         * @generated
140         */
141        protected void fillItemProviderFactories(List factories) {
142                factories.add(new PcmItemProviderAdapterFactory());
143                factories.add(new CoreItemProviderAdapterFactory());
144                factories.add(new EntityItemProviderAdapterFactory());
145                factories.add(new CompositionItemProviderAdapterFactory());
146                factories.add(new UsagemodelItemProviderAdapterFactory());
147                factories.add(new RepositoryItemProviderAdapterFactory());
148                factories.add(new ResourcetypeItemProviderAdapterFactory());
149                factories.add(new ProtocolItemProviderAdapterFactory());
150                factories.add(new ParameterItemProviderAdapterFactory());
151                factories.add(new ReliabilityItemProviderAdapterFactory());
152                factories.add(new SeffItemProviderAdapterFactory());
153                factories
154                                .add(new de.uka.ipd.sdq.pcm.seff.seff_performance.provider.Seff_performanceItemProviderAdapterFactory());
155                factories
156                                .add(new de.uka.ipd.sdq.pcm.seff.seff_reliability.provider.Seff_reliabilityItemProviderAdapterFactory());
157                factories.add(new QosannotationsItemProviderAdapterFactory());
158                factories
159                                .add(new de.uka.ipd.sdq.pcm.qosannotations.qos_performance.provider.Qos_performanceItemProviderAdapterFactory());
160                factories
161                                .add(new de.uka.ipd.sdq.pcm.qosannotations.qos_reliability.provider.Qos_reliabilityItemProviderAdapterFactory());
162                factories.add(new SystemItemProviderAdapterFactory());
163                factories.add(new ResourceenvironmentItemProviderAdapterFactory());
164                factories.add(new AllocationItemProviderAdapterFactory());
165                factories.add(new SubsystemItemProviderAdapterFactory());
166                factories.add(new IdentifierItemProviderAdapterFactory());
167                factories.add(new ProbfunctionItemProviderAdapterFactory());
168                factories.add(new StoexItemProviderAdapterFactory());
169                factories.add(new UnitsItemProviderAdapterFactory());
170                factories.add(new ResourceItemProviderAdapterFactory());
171                factories.add(new ReflectiveItemProviderAdapterFactory());
172        }
173 
174        /**
175         * @generated
176         */
177        public AdapterFactory getItemProvidersAdapterFactory() {
178                return adapterFactory;
179        }
180 
181        /**
182         * @generated
183         */
184        public ImageDescriptor getItemImageDescriptor(Object item) {
185                IItemLabelProvider labelProvider = (IItemLabelProvider) adapterFactory
186                                .adapt(item, IItemLabelProvider.class);
187                if (labelProvider != null) {
188                        return ExtendedImageRegistry.getInstance().getImageDescriptor(
189                                        labelProvider.getImage(item));
190                }
191                return null;
192        }
193 
194        /**
195         * Returns an image descriptor for the image file at the given
196         * plug-in relative path.
197         *
198         * @generated
199         * @param path the path
200         * @return the image descriptor
201         */
202        public static ImageDescriptor getBundledImageDescriptor(String path) {
203                return AbstractUIPlugin.imageDescriptorFromPlugin(ID, path);
204        }
205 
206        /**
207         * Respects images residing in any plug-in. If path is relative,
208         * then this bundle is looked up for the image, otherwise, for absolute 
209         * path, first segment is taken as id of plug-in with image
210         *
211         * @generated
212         * @param path the path to image, either absolute (with plug-in id as first segment), or relative for bundled images
213         * @return the image descriptor
214         */
215        public static ImageDescriptor findImageDescriptor(String path) {
216                final IPath p = new Path(path);
217                if (p.isAbsolute() && p.segmentCount() > 1) {
218                        return AbstractUIPlugin.imageDescriptorFromPlugin(p.segment(0), p
219                                        .removeFirstSegments(1).makeAbsolute().toString());
220                } else {
221                        return getBundledImageDescriptor(p.makeAbsolute().toString());
222                }
223        }
224 
225        /**
226         * Returns string from plug-in's resource bundle
227         * @generated
228         */
229        public static String getString(String key) {
230                return Platform.getResourceString(getInstance().getBundle(), "%" + key); //$NON-NLS-1$
231        }
232 
233        /**
234         * Returns an image for the image file at the given plug-in relative path.
235         * Client do not need to dispose this image. Images will be disposed automatically.
236         *
237         * @generated
238         * @param path the path
239         * @return image instance
240         */
241        public Image getBundledImage(String path) {
242                Image image = getImageRegistry().get(path);
243                if (image == null) {
244                        getImageRegistry().put(path, getBundledImageDescriptor(path));
245                        image = getImageRegistry().get(path);
246                }
247                return image;
248        }
249 
250        /**
251         * @generated
252         */
253        public PalladioComponentModelDocumentProvider getDocumentProvider() {
254                if (documentProvider == null) {
255                        documentProvider = new PalladioComponentModelDocumentProvider();
256                }
257                return documentProvider;
258        }
259 
260        /**
261         * @generated
262         */
263        public void logError(String error) {
264                logError(error, null);
265        }
266 
267        /**
268         * @param throwable actual error or null could be passed
269         * @generated
270         */
271        public void logError(String error, Throwable throwable) {
272                if (error == null && throwable != null) {
273                        error = throwable.getMessage();
274                }
275                getLog()
276                                .log(
277                                                new Status(
278                                                                IStatus.ERROR,
279                                                                PalladioComponentModelComposedStructureDiagramEditorPlugin.ID,
280                                                                IStatus.OK, error, throwable));
281                debug(error, throwable);
282        }
283 
284        /**
285         * @generated
286         */
287        public void logInfo(String message) {
288                logInfo(message, null);
289        }
290 
291        /**
292         * @param throwable actual error or null could be passed
293         * @generated
294         */
295        public void logInfo(String message, Throwable throwable) {
296                if (message == null && throwable != null) {
297                        message = throwable.getMessage();
298                }
299                getLog()
300                                .log(
301                                                new Status(
302                                                                IStatus.INFO,
303                                                                PalladioComponentModelComposedStructureDiagramEditorPlugin.ID,
304                                                                IStatus.OK, message, throwable));
305                debug(message, throwable);
306        }
307 
308        /**
309         * @generated
310         */
311        private void debug(String message, Throwable throwable) {
312                if (!isDebugging()) {
313                        return;
314                }
315                if (message != null) {
316                        System.err.println(message);
317                }
318                if (throwable != null) {
319                        throwable.printStackTrace();
320                }
321        }
322}

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