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

COVERAGE SUMMARY FOR SOURCE FILE [PalladioComponentModelRepositoryDiagramEditorPlugin.java]

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

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PalladioComponentModelRepositoryDiagramEditorPlugin0%   (0/1)0%   (0/20)0%   (0/380)0%   (0/102)
<static initializer> 0%   (0/1)0%   (0/6)0%   (0/3)
PalladioComponentModelRepositoryDiagramEditorPlugin (): void 0%   (0/1)0%   (0/3)0%   (0/2)
access$0 (PalladioComponentModelRepositoryDiagramEditorPlugin): 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 (): PalladioComponentModelRepositoryDiagramEditorPlugin 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 PalladioComponentModelRepositoryDiagramEditorPlugin$10%   (0/1)0%   (0/2)0%   (0/12)0%   (0/3)
PalladioComponentModelRepositoryDiagramEditorPlugin$1 (PalladioComponentModel... 0%   (0/1)0%   (0/7)0%   (0/2)
getRootAdapterFactory (): ComposeableAdapterFactory 0%   (0/1)0%   (0/5)0%   (0/1)

1/*
2 *Copyright 2007, IPD, SDQ, University of Karlsruhe
3 */
4package de.uka.ipd.sdq.pcm.gmf.repository.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.reliability.provider.ReliabilityItemProviderAdapterFactory;
39import de.uka.ipd.sdq.pcm.repository.provider.RepositoryItemProviderAdapterFactory;
40import de.uka.ipd.sdq.pcm.resourceenvironment.provider.ResourceenvironmentItemProviderAdapterFactory;
41import de.uka.ipd.sdq.pcm.resourcetype.provider.ResourcetypeItemProviderAdapterFactory;
42import de.uka.ipd.sdq.pcm.seff.provider.SeffItemProviderAdapterFactory;
43import de.uka.ipd.sdq.pcm.seff.seff_performance.provider.Seff_performanceItemProviderAdapterFactory;
44import de.uka.ipd.sdq.pcm.seff.seff_reliability.provider.Seff_reliabilityItemProviderAdapterFactory;
45import de.uka.ipd.sdq.pcm.subsystem.provider.SubsystemItemProviderAdapterFactory;
46import de.uka.ipd.sdq.pcm.system.provider.SystemItemProviderAdapterFactory;
47import de.uka.ipd.sdq.pcm.usagemodel.provider.UsagemodelItemProviderAdapterFactory;
48import de.uka.ipd.sdq.pcmbench.ui.provider.PalladioItemProviderAdapterFactory;
49import de.uka.ipd.sdq.probfunction.provider.ProbfunctionItemProviderAdapterFactory;
50import de.uka.ipd.sdq.stoex.provider.StoexItemProviderAdapterFactory;
51import de.uka.ipd.sdq.units.provider.UnitsItemProviderAdapterFactory;
52 
53/**
54 * @generated
55 */
56public class PalladioComponentModelRepositoryDiagramEditorPlugin extends
57                AbstractUIPlugin {
58 
59        /**
60         * @generated
61         */
62        public static final String ID = "de.uka.ipd.sdq.pcm.gmf.repository"; //$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 PalladioComponentModelRepositoryDiagramEditorPlugin 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 PalladioComponentModelRepositoryDiagramEditorPlugin() {
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 PalladioComponentModelRepositoryDiagramEditorPlugin 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                                return (PalladioItemProviderAdapterFactory) adapterFactory;
130                        }
131 
132                };
133                return new PalladioItemProviderAdapterFactory(caf);
134        }
135 
136        /**
137         * @generated
138         */
139        protected void fillItemProviderFactories(List factories) {
140                factories.add(new PcmItemProviderAdapterFactory());
141                factories.add(new CoreItemProviderAdapterFactory());
142                factories.add(new EntityItemProviderAdapterFactory());
143                factories.add(new CompositionItemProviderAdapterFactory());
144                factories.add(new UsagemodelItemProviderAdapterFactory());
145                factories.add(new RepositoryItemProviderAdapterFactory());
146                factories.add(new ResourcetypeItemProviderAdapterFactory());
147                factories.add(new ProtocolItemProviderAdapterFactory());
148                factories.add(new ParameterItemProviderAdapterFactory());
149                factories.add(new ReliabilityItemProviderAdapterFactory());
150                factories.add(new SeffItemProviderAdapterFactory());
151                factories
152                                .add(new de.uka.ipd.sdq.pcm.seff.seff_performance.provider.Seff_performanceItemProviderAdapterFactory());
153                factories
154                                .add(new de.uka.ipd.sdq.pcm.seff.seff_reliability.provider.Seff_reliabilityItemProviderAdapterFactory());
155                factories.add(new QosannotationsItemProviderAdapterFactory());
156                factories
157                                .add(new de.uka.ipd.sdq.pcm.qosannotations.qos_performance.provider.Qos_performanceItemProviderAdapterFactory());
158                factories
159                                .add(new de.uka.ipd.sdq.pcm.qosannotations.qos_reliability.provider.Qos_reliabilityItemProviderAdapterFactory());
160                factories.add(new SystemItemProviderAdapterFactory());
161                factories.add(new ResourceenvironmentItemProviderAdapterFactory());
162                factories.add(new AllocationItemProviderAdapterFactory());
163                factories.add(new SubsystemItemProviderAdapterFactory());
164                factories.add(new IdentifierItemProviderAdapterFactory());
165                factories.add(new ProbfunctionItemProviderAdapterFactory());
166                factories.add(new StoexItemProviderAdapterFactory());
167                factories.add(new UnitsItemProviderAdapterFactory());
168                factories.add(new ResourceItemProviderAdapterFactory());
169                factories.add(new ReflectiveItemProviderAdapterFactory());
170        }
171 
172        /**
173         * @generated
174         */
175        public AdapterFactory getItemProvidersAdapterFactory() {
176                return adapterFactory;
177        }
178 
179        /**
180         * @generated
181         */
182        public ImageDescriptor getItemImageDescriptor(Object item) {
183                IItemLabelProvider labelProvider = (IItemLabelProvider) adapterFactory
184                                .adapt(item, IItemLabelProvider.class);
185                if (labelProvider != null) {
186                        return ExtendedImageRegistry.getInstance().getImageDescriptor(
187                                        labelProvider.getImage(item));
188                }
189                return null;
190        }
191 
192        /**
193         * Returns an image descriptor for the image file at the given
194         * plug-in relative path.
195         *
196         * @generated
197         * @param path the path
198         * @return the image descriptor
199         */
200        public static ImageDescriptor getBundledImageDescriptor(String path) {
201                return AbstractUIPlugin.imageDescriptorFromPlugin(ID, path);
202        }
203 
204        /**
205         * Respects images residing in any plug-in. If path is relative,
206         * then this bundle is looked up for the image, otherwise, for absolute 
207         * path, first segment is taken as id of plug-in with image
208         *
209         * @generated
210         * @param path the path to image, either absolute (with plug-in id as first segment), or relative for bundled images
211         * @return the image descriptor
212         */
213        public static ImageDescriptor findImageDescriptor(String path) {
214                final IPath p = new Path(path);
215                if (p.isAbsolute() && p.segmentCount() > 1) {
216                        return AbstractUIPlugin.imageDescriptorFromPlugin(p.segment(0), p
217                                        .removeFirstSegments(1).makeAbsolute().toString());
218                } else {
219                        return getBundledImageDescriptor(p.makeAbsolute().toString());
220                }
221        }
222 
223        /**
224         * Returns string from plug-in's resource bundle
225         * @generated
226         */
227        public static String getString(String key) {
228                return Platform.getResourceString(getInstance().getBundle(), "%" + key); //$NON-NLS-1$
229        }
230 
231        /**
232         * Returns an image for the image file at the given plug-in relative path.
233         * Client do not need to dispose this image. Images will be disposed automatically.
234         *
235         * @generated
236         * @param path the path
237         * @return image instance
238         */
239        public Image getBundledImage(String path) {
240                Image image = getImageRegistry().get(path);
241                if (image == null) {
242                        getImageRegistry().put(path, getBundledImageDescriptor(path));
243                        image = getImageRegistry().get(path);
244                }
245                return image;
246        }
247 
248        /**
249         * @generated
250         */
251        public PalladioComponentModelDocumentProvider getDocumentProvider() {
252                if (documentProvider == null) {
253                        documentProvider = new PalladioComponentModelDocumentProvider();
254                }
255                return documentProvider;
256        }
257 
258        /**
259         * @generated
260         */
261        public void logError(String error) {
262                logError(error, null);
263        }
264 
265        /**
266         * @param throwable actual error or null could be passed
267         * @generated
268         */
269        public void logError(String error, Throwable throwable) {
270                if (error == null && throwable != null) {
271                        error = throwable.getMessage();
272                }
273                getLog().log(
274                                new Status(IStatus.ERROR,
275                                                PalladioComponentModelRepositoryDiagramEditorPlugin.ID,
276                                                IStatus.OK, error, throwable));
277                debug(error, throwable);
278        }
279 
280        /**
281         * @generated
282         */
283        public void logInfo(String message) {
284                logInfo(message, null);
285        }
286 
287        /**
288         * @param throwable actual error or null could be passed
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                                                PalladioComponentModelRepositoryDiagramEditorPlugin.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.repository.part]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov