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

COVERAGE SUMMARY FOR SOURCE FILE [PalladioComponentModelUsageDiagramEditorPlugin.java]

nameclass, %method, %block, %line, %
PalladioComponentModelUsageDiagramEditorPlugin.java0%   (0/2)0%   (0/22)0%   (0/392)0%   (0/100)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PalladioComponentModelUsageDiagramEditorPlugin0%   (0/1)0%   (0/20)0%   (0/380)0%   (0/98)
<static initializer> 0%   (0/1)0%   (0/6)0%   (0/3)
PalladioComponentModelUsageDiagramEditorPlugin (): void 0%   (0/1)0%   (0/3)0%   (0/2)
access$0 (PalladioComponentModelUsageDiagramEditorPlugin): 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/27)
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 (): PalladioComponentModelUsageDiagramEditorPlugin 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 PalladioComponentModelUsageDiagramEditorPlugin$10%   (0/1)0%   (0/2)0%   (0/12)0%   (0/3)
PalladioComponentModelUsageDiagramEditorPlugin$1 (PalladioComponentModelUsage... 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, University of Karlsruhe
3 */
4package de.uka.ipd.sdq.pcm.gmf.usage.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 PalladioComponentModelUsageDiagramEditorPlugin extends
58                AbstractUIPlugin {
59 
60        /**
61         * @generated
62         */
63        public static final String ID = "de.uka.ipd.sdq.pcm.gmf.usage"; //$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 PalladioComponentModelUsageDiagramEditorPlugin 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 PalladioComponentModelUsageDiagramEditorPlugin() {
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 PalladioComponentModelUsageDiagramEditorPlugin 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                
147                factories.add(new UsagemodelItemProviderAdapterFactory());
148                factories.add(new RepositoryItemProviderAdapterFactory());
149                factories.add(new ProtocolItemProviderAdapterFactory());
150                factories.add(new ReliabilityItemProviderAdapterFactory());
151                factories.add(new QosannotationsItemProviderAdapterFactory());
152                factories.add(new Qos_performanceItemProviderAdapterFactory());
153                factories.add(new Qos_reliabilityItemProviderAdapterFactory());
154                factories.add(new ParameterItemProviderAdapterFactory());
155                factories.add(new SeffItemProviderAdapterFactory());
156                factories.add(new Seff_performanceItemProviderAdapterFactory());
157                factories.add(new Seff_reliabilityItemProviderAdapterFactory());
158                factories.add(new ResourcetypeItemProviderAdapterFactory());
159                factories.add(new SystemItemProviderAdapterFactory());
160                factories.add(new ResourceenvironmentItemProviderAdapterFactory());
161                factories.add(new AllocationItemProviderAdapterFactory());
162                factories.add(new SubsystemItemProviderAdapterFactory());
163                factories.add(new IdentifierItemProviderAdapterFactory());
164                factories.add(new ProbfunctionItemProviderAdapterFactory());
165                factories.add(new StoexItemProviderAdapterFactory());
166                factories.add(new UnitsItemProviderAdapterFactory());
167                factories.add(new ResourceItemProviderAdapterFactory());
168                factories.add(new ReflectiveItemProviderAdapterFactory());
169        }
170 
171        /**
172         * @generated
173         */
174        public AdapterFactory getItemProvidersAdapterFactory() {
175                return adapterFactory;
176        }
177 
178        /**
179         * @generated
180         */
181        public ImageDescriptor getItemImageDescriptor(Object item) {
182                IItemLabelProvider labelProvider = (IItemLabelProvider) adapterFactory
183                                .adapt(item, IItemLabelProvider.class);
184                if (labelProvider != null) {
185                        return ExtendedImageRegistry.getInstance().getImageDescriptor(
186                                        labelProvider.getImage(item));
187                }
188                return null;
189        }
190 
191        /**
192         * Returns an image descriptor for the image file at the given
193         * plug-in relative path.
194         *
195         * @generated
196         * @param path the path
197         * @return the image descriptor
198         */
199        public static ImageDescriptor getBundledImageDescriptor(String path) {
200                return AbstractUIPlugin.imageDescriptorFromPlugin(ID, path);
201        }
202 
203        /**
204         * Respects images residing in any plug-in. If path is relative,
205         * then this bundle is looked up for the image, otherwise, for absolute 
206         * path, first segment is taken as id of plug-in with image
207         *
208         * @generated
209         * @param path the path to image, either absolute (with plug-in id as first segment), or relative for bundled images
210         * @return the image descriptor
211         */
212        public static ImageDescriptor findImageDescriptor(String path) {
213                final IPath p = new Path(path);
214                if (p.isAbsolute() && p.segmentCount() > 1) {
215                        return AbstractUIPlugin.imageDescriptorFromPlugin(p.segment(0), p
216                                        .removeFirstSegments(1).makeAbsolute().toString());
217                } else {
218                        return getBundledImageDescriptor(p.makeAbsolute().toString());
219                }
220        }
221 
222        /**
223         * Returns string from plug-in's resource bundle
224         * @generated
225         */
226        public static String getString(String key) {
227                return Platform.getResourceString(getInstance().getBundle(), "%" + key); //$NON-NLS-1$
228        }
229 
230        /**
231         * Returns an image for the image file at the given plug-in relative path.
232         * Client do not need to dispose this image. Images will be disposed automatically.
233         *
234         * @generated
235         * @param path the path
236         * @return image instance
237         */
238        public Image getBundledImage(String path) {
239                Image image = getImageRegistry().get(path);
240                if (image == null) {
241                        getImageRegistry().put(path, getBundledImageDescriptor(path));
242                        image = getImageRegistry().get(path);
243                }
244                return image;
245        }
246 
247        /**
248         * @generated
249         */
250        public PalladioComponentModelDocumentProvider getDocumentProvider() {
251                if (documentProvider == null) {
252                        documentProvider = new PalladioComponentModelDocumentProvider();
253                }
254                return documentProvider;
255        }
256 
257        /**
258         * @generated
259         */
260        public void logError(String error) {
261                logError(error, null);
262        }
263 
264        /**
265         * @param throwable actual error or null could be passed
266         * @generated
267         */
268        public void logError(String error, Throwable throwable) {
269                if (error == null && throwable != null) {
270                        error = throwable.getMessage();
271                }
272                getLog().log(
273                                new Status(IStatus.ERROR,
274                                                PalladioComponentModelUsageDiagramEditorPlugin.ID,
275                                                IStatus.OK, error, throwable));
276                debug(error, throwable);
277        }
278 
279        /**
280         * @generated
281         */
282        public void logInfo(String message) {
283                logInfo(message, null);
284        }
285 
286        /**
287         * @param throwable actual error or null could be passed
288         * @generated
289         */
290        public void logInfo(String message, Throwable throwable) {
291                if (message == null && throwable != null) {
292                        message = throwable.getMessage();
293                }
294                getLog().log(
295                                new Status(IStatus.INFO,
296                                                PalladioComponentModelUsageDiagramEditorPlugin.ID,
297                                                IStatus.OK, message, throwable));
298                debug(message, throwable);
299        }
300 
301        /**
302         * @generated
303         */
304        private void debug(String message, Throwable throwable) {
305                if (!isDebugging()) {
306                        return;
307                }
308                if (message != null) {
309                        System.err.println(message);
310                }
311                if (throwable != null) {
312                        throwable.printStackTrace();
313                }
314        }
315}

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