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

COVERAGE SUMMARY FOR SOURCE FILE [PalladioComponentModelDiagramEditorPlugin.java]

nameclass, %method, %block, %line, %
PalladioComponentModelDiagramEditorPlugin.java0%   (0/2)0%   (0/22)0%   (0/392)0%   (0/104)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PalladioComponentModelDiagramEditorPlugin0%   (0/1)0%   (0/20)0%   (0/380)0%   (0/102)
<static initializer> 0%   (0/1)0%   (0/6)0%   (0/3)
PalladioComponentModelDiagramEditorPlugin (): void 0%   (0/1)0%   (0/3)0%   (0/2)
access$0 (PalladioComponentModelDiagramEditorPlugin): AdapterFactory 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 (): PalladioComponentModelDiagramEditorPlugin 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/8)
logInfo (String): void 0%   (0/1)0%   (0/5)0%   (0/2)
logInfo (String, Throwable): void 0%   (0/1)0%   (0/23)0%   (0/8)
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 PalladioComponentModelDiagramEditorPlugin$10%   (0/1)0%   (0/2)0%   (0/12)0%   (0/3)
PalladioComponentModelDiagramEditorPlugin$1 (PalladioComponentModelDiagramEdi... 0%   (0/1)0%   (0/7)0%   (0/2)
getRootAdapterFactory (): ComposeableAdapterFactory 0%   (0/1)0%   (0/5)0%   (0/1)

1/*
2 * Copyright 2009, SDQ, IPD, Uni Karlsruhe (TH)
3 */
4package de.uka.ipd.sdq.pcm.gmf.resource.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 PalladioComponentModelDiagramEditorPlugin extends AbstractUIPlugin {
58 
59        /**
60         * @generated
61         */
62        public static final String ID = "de.uka.ipd.sdq.pcm.gmf.resource"; //$NON-NLS-1$
63 
64        /**
65         * @generated
66         */
67        public static final PreferencesHint DIAGRAM_PREFERENCES_HINT = new PreferencesHint(
68                        ID);
69 
70        /**
71         * @generated
72         */
73        private static PalladioComponentModelDiagramEditorPlugin instance;
74 
75        /**
76         * @generated not
77         */
78        private AdapterFactory adapterFactory;
79 
80        /**
81         * @generated
82         */
83        private PalladioComponentModelDocumentProvider documentProvider;
84 
85        /**
86         * @generated
87         */
88        public PalladioComponentModelDiagramEditorPlugin() {
89        }
90 
91        /**
92         * @generated
93         */
94        public void start(BundleContext context) throws Exception {
95                super.start(context);
96                instance = this;
97                PreferencesHint.registerPreferenceStore(DIAGRAM_PREFERENCES_HINT,
98                                getPreferenceStore());
99                adapterFactory = createAdapterFactory();
100        }
101 
102        /**
103         * @generated not
104         */
105        public void stop(BundleContext context) throws Exception {
106                ((PalladioItemProviderAdapterFactory) adapterFactory).dispose();
107                adapterFactory = null;
108                instance = null;
109                super.stop(context);
110        }
111 
112        /**
113         * @generated
114         */
115        public static PalladioComponentModelDiagramEditorPlugin getInstance() {
116                return instance;
117        }
118 
119        /**
120         * @generated not
121         */
122        protected AdapterFactory createAdapterFactory() {
123                List factories = new ArrayList();
124                fillItemProviderFactories(factories);
125                ComposedAdapterFactory caf = new ComposedAdapterFactory(factories) {
126 
127                        @Override
128                        public ComposeableAdapterFactory getRootAdapterFactory() {
129                                // TODO Auto-generated method stub
130                                return (PalladioItemProviderAdapterFactory) adapterFactory;
131                        }
132 
133                };
134                return new PalladioItemProviderAdapterFactory(caf);
135        }
136 
137        /**
138         * @generated
139         */
140        protected void fillItemProviderFactories(List factories) {
141                factories.add(new PcmItemProviderAdapterFactory());
142                factories.add(new CoreItemProviderAdapterFactory());
143                factories.add(new EntityItemProviderAdapterFactory());
144                factories.add(new CompositionItemProviderAdapterFactory());
145                factories.add(new UsagemodelItemProviderAdapterFactory());
146                factories.add(new RepositoryItemProviderAdapterFactory());
147                factories.add(new ResourcetypeItemProviderAdapterFactory());
148                factories.add(new ProtocolItemProviderAdapterFactory());
149                factories.add(new ParameterItemProviderAdapterFactory());
150                factories.add(new ReliabilityItemProviderAdapterFactory());
151                factories.add(new SeffItemProviderAdapterFactory());
152                factories
153                                .add(new de.uka.ipd.sdq.pcm.seff.seff_performance.provider.Seff_performanceItemProviderAdapterFactory());
154                factories
155                                .add(new de.uka.ipd.sdq.pcm.seff.seff_reliability.provider.Seff_reliabilityItemProviderAdapterFactory());
156                factories.add(new QosannotationsItemProviderAdapterFactory());
157                factories
158                                .add(new de.uka.ipd.sdq.pcm.qosannotations.qos_performance.provider.Qos_performanceItemProviderAdapterFactory());
159                factories
160                                .add(new de.uka.ipd.sdq.pcm.qosannotations.qos_reliability.provider.Qos_reliabilityItemProviderAdapterFactory());
161                factories.add(new SystemItemProviderAdapterFactory());
162                factories.add(new ResourceenvironmentItemProviderAdapterFactory());
163                factories.add(new AllocationItemProviderAdapterFactory());
164                factories.add(new SubsystemItemProviderAdapterFactory());
165                factories.add(new IdentifierItemProviderAdapterFactory());
166                factories.add(new ProbfunctionItemProviderAdapterFactory());
167                factories.add(new StoexItemProviderAdapterFactory());
168                factories.add(new UnitsItemProviderAdapterFactory());
169                factories.add(new ResourceItemProviderAdapterFactory());
170                factories.add(new ReflectiveItemProviderAdapterFactory());
171        }
172 
173        /**
174         * @generated
175         */
176        public AdapterFactory getItemProvidersAdapterFactory() {
177                return adapterFactory;
178        }
179 
180        /**
181         * @generated
182         */
183        public ImageDescriptor getItemImageDescriptor(Object item) {
184                IItemLabelProvider labelProvider = (IItemLabelProvider) adapterFactory
185                                .adapt(item, IItemLabelProvider.class);
186                if (labelProvider != null) {
187                        return ExtendedImageRegistry.getInstance().getImageDescriptor(
188                                        labelProvider.getImage(item));
189                }
190                return null;
191        }
192 
193        /**
194         * Returns an image descriptor for the image file at the given
195         * plug-in relative path.
196         *
197         * @generated
198         * @param path the path
199         * @return the image descriptor
200         */
201        public static ImageDescriptor getBundledImageDescriptor(String path) {
202                return AbstractUIPlugin.imageDescriptorFromPlugin(ID, path);
203        }
204 
205        /**
206         * Respects images residing in any plug-in. If path is relative,
207         * then this bundle is looked up for the image, otherwise, for absolute 
208         * path, first segment is taken as id of plug-in with image
209         *
210         * @generated
211         * @param path the path to image, either absolute (with plug-in id as first segment), or relative for bundled images
212         * @return the image descriptor
213         */
214        public static ImageDescriptor findImageDescriptor(String path) {
215                final IPath p = new Path(path);
216                if (p.isAbsolute() && p.segmentCount() > 1) {
217                        return AbstractUIPlugin.imageDescriptorFromPlugin(p.segment(0), p
218                                        .removeFirstSegments(1).makeAbsolute().toString());
219                } else {
220                        return getBundledImageDescriptor(p.makeAbsolute().toString());
221                }
222        }
223 
224        /**
225         * Returns an image for the image file at the given plug-in relative path.
226         * Client do not need to dispose this image. Images will be disposed automatically.
227         *
228         * @generated
229         * @param path the path
230         * @return image instance
231         */
232        public Image getBundledImage(String path) {
233                Image image = getImageRegistry().get(path);
234                if (image == null) {
235                        getImageRegistry().put(path, getBundledImageDescriptor(path));
236                        image = getImageRegistry().get(path);
237                }
238                return image;
239        }
240 
241        /**
242         * Returns string from plug-in's resource bundle
243         *
244         * @generated
245         */
246        public static String getString(String key) {
247                return Platform.getResourceString(getInstance().getBundle(), "%" + key); //$NON-NLS-1$
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         * @generated
269         */
270        public void logError(String error, Throwable throwable) {
271                if (error == null && throwable != null) {
272                        error = throwable.getMessage();
273                }
274                getLog().log(
275                                new Status(IStatus.ERROR,
276                                                PalladioComponentModelDiagramEditorPlugin.ID,
277                                                IStatus.OK, error, throwable));
278                debug(error, throwable);
279        }
280 
281        /**
282         * @generated
283         */
284        public void logInfo(String message) {
285                logInfo(message, null);
286        }
287 
288        /**
289         * @generated
290         */
291        public void logInfo(String message, Throwable throwable) {
292                if (message == null && throwable != null) {
293                        message = throwable.getMessage();
294                }
295                getLog().log(
296                                new Status(IStatus.INFO,
297                                                PalladioComponentModelDiagramEditorPlugin.ID,
298                                                IStatus.OK, message, throwable));
299                debug(message, throwable);
300        }
301 
302        /**
303         * @generated
304         */
305        private void debug(String message, Throwable throwable) {
306                if (!isDebugging()) {
307                        return;
308                }
309                if (message != null) {
310                        System.err.println(message);
311                }
312                if (throwable != null) {
313                        throwable.printStackTrace();
314                }
315        }
316}

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