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

COVERAGE SUMMARY FOR SOURCE FILE [IdentifierItemProviderAdapterFactory.java]

nameclass, %method, %block, %line, %
IdentifierItemProviderAdapterFactory.java0%   (0/1)0%   (0/10)0%   (0/113)0%   (0/28)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class IdentifierItemProviderAdapterFactory0%   (0/1)0%   (0/10)0%   (0/113)0%   (0/28)
IdentifierItemProviderAdapterFactory (): void 0%   (0/1)0%   (0/38)0%   (0/9)
adapt (Notifier, Object): Adapter 0%   (0/1)0%   (0/5)0%   (0/1)
adapt (Object, Object): Object 0%   (0/1)0%   (0/21)0%   (0/5)
addListener (INotifyChangedListener): void 0%   (0/1)0%   (0/5)0%   (0/2)
dispose (): void 0%   (0/1)0%   (0/1)0%   (0/1)
fireNotifyChanged (Notification): void 0%   (0/1)0%   (0/12)0%   (0/4)
getRootAdapterFactory (): ComposeableAdapterFactory 0%   (0/1)0%   (0/9)0%   (0/1)
isFactoryForType (Object): boolean 0%   (0/1)0%   (0/13)0%   (0/1)
removeListener (INotifyChangedListener): void 0%   (0/1)0%   (0/5)0%   (0/2)
setParentAdapterFactory (ComposedAdapterFactory): void 0%   (0/1)0%   (0/4)0%   (0/2)

1/**
2 * <copyright>
3 * </copyright>
4 *
5 * $Id$
6 */
7package de.uka.ipd.sdq.identifier.provider;
8 
9import de.uka.ipd.sdq.identifier.util.IdentifierAdapterFactory;
10 
11import java.util.ArrayList;
12import java.util.Collection;
13 
14import org.eclipse.emf.common.notify.Adapter;
15import org.eclipse.emf.common.notify.Notification;
16import org.eclipse.emf.common.notify.Notifier;
17 
18import org.eclipse.emf.edit.provider.ChangeNotifier;
19import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
20import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
21import org.eclipse.emf.edit.provider.IChangeNotifier;
22import org.eclipse.emf.edit.provider.IDisposable;
23import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
24import org.eclipse.emf.edit.provider.IItemLabelProvider;
25import org.eclipse.emf.edit.provider.IItemPropertySource;
26import org.eclipse.emf.edit.provider.INotifyChangedListener;
27import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
28import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
29 
30/**
31 * This is the factory that is used to provide the interfaces needed to support Viewers.
32 * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}.
33 * The adapters also support Eclipse property sheets.
34 * Note that most of the adapters are shared among multiple instances.
35 * <!-- begin-user-doc -->
36 * <!-- end-user-doc -->
37 * @generated
38 */
39public class IdentifierItemProviderAdapterFactory extends IdentifierAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable {
40        /**
41         * <!-- begin-user-doc -->
42         * <!-- end-user-doc -->
43         * @generated
44         */
45        public static final String copyright = "Copyright 2007-2009, SDQ, IPD, U Karlsruhe";
46 
47        /**
48         * This keeps track of the root adapter factory that delegates to this adapter factory.
49         * <!-- begin-user-doc -->
50         * <!-- end-user-doc -->
51         * @generated
52         */
53        protected ComposedAdapterFactory parentAdapterFactory;
54 
55        /**
56         * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}.
57         * <!-- begin-user-doc -->
58         * <!-- end-user-doc -->
59         * @generated
60         */
61        protected IChangeNotifier changeNotifier = new ChangeNotifier();
62 
63        /**
64         * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}.
65         * <!-- begin-user-doc -->
66         * <!-- end-user-doc -->
67         * @generated
68         */
69        protected Collection<Object> supportedTypes = new ArrayList<Object>();
70 
71        /**
72         * This constructs an instance.
73         * <!-- begin-user-doc -->
74         * <!-- end-user-doc -->
75         * @generated
76         */
77        public IdentifierItemProviderAdapterFactory() {
78                supportedTypes.add(IEditingDomainItemProvider.class);
79                supportedTypes.add(IStructuredItemContentProvider.class);
80                supportedTypes.add(ITreeItemContentProvider.class);
81                supportedTypes.add(IItemLabelProvider.class);
82                supportedTypes.add(IItemPropertySource.class);
83        }
84 
85        /**
86         * This returns the root adapter factory that contains this factory.
87         * <!-- begin-user-doc -->
88         * <!-- end-user-doc -->
89         * @generated
90         */
91        public ComposeableAdapterFactory getRootAdapterFactory() {
92                return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory();
93        }
94 
95        /**
96         * This sets the composed adapter factory that contains this factory.
97         * <!-- begin-user-doc -->
98         * <!-- end-user-doc -->
99         * @generated
100         */
101        public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) {
102                this.parentAdapterFactory = parentAdapterFactory;
103        }
104 
105        /**
106         * <!-- begin-user-doc -->
107         * <!-- end-user-doc -->
108         * @generated
109         */
110        @Override
111        public boolean isFactoryForType(Object type) {
112                return supportedTypes.contains(type) || super.isFactoryForType(type);
113        }
114 
115        /**
116         * This implementation substitutes the factory itself as the key for the adapter.
117         * <!-- begin-user-doc -->
118         * <!-- end-user-doc -->
119         * @generated
120         */
121        @Override
122        public Adapter adapt(Notifier notifier, Object type) {
123                return super.adapt(notifier, this);
124        }
125 
126        /**
127         * <!-- begin-user-doc -->
128         * <!-- end-user-doc -->
129         * @generated
130         */
131        @Override
132        public Object adapt(Object object, Object type) {
133                if (isFactoryForType(type)) {
134                        Object adapter = super.adapt(object, type);
135                        if (!(type instanceof Class<?>) || (((Class<?>)type).isInstance(adapter))) {
136                                return adapter;
137                        }
138                }
139 
140                return null;
141        }
142 
143        /**
144         * This adds a listener.
145         * <!-- begin-user-doc -->
146         * <!-- end-user-doc -->
147         * @generated
148         */
149        public void addListener(INotifyChangedListener notifyChangedListener) {
150                changeNotifier.addListener(notifyChangedListener);
151        }
152 
153        /**
154         * This removes a listener.
155         * <!-- begin-user-doc -->
156         * <!-- end-user-doc -->
157         * @generated
158         */
159        public void removeListener(INotifyChangedListener notifyChangedListener) {
160                changeNotifier.removeListener(notifyChangedListener);
161        }
162 
163        /**
164         * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}.
165         * <!-- begin-user-doc -->
166         * <!-- end-user-doc -->
167         * @generated
168         */
169        public void fireNotifyChanged(Notification notification) {
170                changeNotifier.fireNotifyChanged(notification);
171 
172                if (parentAdapterFactory != null) {
173                        parentAdapterFactory.fireNotifyChanged(notification);
174                }
175        }
176 
177        /**
178         * This disposes all of the item providers created by this factory. 
179         * <!-- begin-user-doc -->
180         * <!-- end-user-doc -->
181         * @generated
182         */
183        public void dispose() {
184        }
185 
186}

[all classes][de.uka.ipd.sdq.identifier.provider]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov