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

COVERAGE SUMMARY FOR SOURCE FILE [PalladioComponentModelAllocationDiagramEditorPlugin.java]

nameclass, %method, %block, %line, %
PalladioComponentModelAllocationDiagramEditorPlugin.java0%   (0/1)0%   (0/19)0%   (0/334)0%   (0/90)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PalladioComponentModelAllocationDiagramEditorPlugin0%   (0/1)0%   (0/19)0%   (0/334)0%   (0/90)
<static initializer> 0%   (0/1)0%   (0/6)0%   (0/3)
PalladioComponentModelAllocationDiagramEditorPlugin (): void 0%   (0/1)0%   (0/3)0%   (0/2)
createAdapterFactory (): ComposedAdapterFactory 0%   (0/1)0%   (0/12)0%   (0/3)
debug (String, Throwable): void 0%   (0/1)0%   (0/14)0%   (0/7)
fillItemProviderFactories (List): void 0%   (0/1)0%   (0/121)0%   (0/21)
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 (): PalladioComponentModelAllocationDiagramEditorPlugin 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/12)0%   (0/5)

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

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