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

COVERAGE SUMMARY FOR SOURCE FILE [PalladioComponentModelSeffDiagramEditorPlugin.java]

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

COVERAGE BREAKDOWN BY CLASS AND METHOD

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

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

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