Skip to content

Package: KeyattributedmrItemProviderAdapterFactory

KeyattributedmrItemProviderAdapterFactory

nameinstructionbranchcomplexitylinemethod
KeyattributedmrItemProviderAdapterFactory()
M: 45 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 11 C: 0
0%
M: 1 C: 0
0%
adapt(Notifier, Object)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
adapt(Object, Object)
M: 21 C: 0
0%
M: 6 C: 0
0%
M: 4 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
addListener(INotifyChangedListener)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
createKeyAttributeDomainModelReferenceAdapter()
M: 12 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
dispose()
M: 7 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
fireNotifyChanged(Notification)
M: 12 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
getChildCreationExtenders()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getNewChildDescriptors(Object, EditingDomain)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getResourceLocator()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getRootAdapterFactory()
M: 9 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
isFactoryForType(Object)
M: 13 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
removeListener(INotifyChangedListener)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setParentAdapterFactory(ComposedAdapterFactory)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /**
2: * Copyright (c) 2011-2014 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Eugen Neufeld - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.spi.keyattributedmr.model.provider;
15:
16: import java.util.ArrayList;
17: import java.util.Collection;
18: import java.util.List;
19:
20: import org.eclipse.emf.common.notify.Adapter;
21: import org.eclipse.emf.common.notify.Notification;
22: import org.eclipse.emf.common.notify.Notifier;
23: import org.eclipse.emf.common.util.ResourceLocator;
24: import org.eclipse.emf.ecp.view.spi.keyattributedmr.model.VKeyattributedmrPackage;
25: import org.eclipse.emf.ecp.view.spi.keyattributedmr.model.util.KeyattributedmrAdapterFactory;
26: import org.eclipse.emf.edit.domain.EditingDomain;
27: import org.eclipse.emf.edit.provider.ChangeNotifier;
28: import org.eclipse.emf.edit.provider.ChildCreationExtenderManager;
29: import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
30: import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
31: import org.eclipse.emf.edit.provider.IChangeNotifier;
32: import org.eclipse.emf.edit.provider.IChildCreationExtender;
33: import org.eclipse.emf.edit.provider.IDisposable;
34: import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
35: import org.eclipse.emf.edit.provider.IItemLabelProvider;
36: import org.eclipse.emf.edit.provider.IItemPropertySource;
37: import org.eclipse.emf.edit.provider.INotifyChangedListener;
38: import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
39: import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
40:
41: /**
42: * This is the factory that is used to provide the interfaces needed to support Viewers.
43: * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged
44: * fireNotifyChanged}.
45: * The adapters also support Eclipse property sheets.
46: * Note that most of the adapters are shared among multiple instances.
47: * <!-- begin-user-doc --> <!--
48: * end-user-doc -->
49: *
50: * @generated
51: */
52: public class KeyattributedmrItemProviderAdapterFactory extends
53:         KeyattributedmrAdapterFactory implements ComposeableAdapterFactory,
54:         IChangeNotifier, IDisposable, IChildCreationExtender {
55:         /**
56:          * This keeps track of the root adapter factory that delegates to this adapter factory.
57:          * <!-- begin-user-doc --> <!-- end-user-doc -->
58:          *
59:          * @generated
60:          */
61:         protected ComposedAdapterFactory parentAdapterFactory;
62:
63:         /**
64:          * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. <!--
65:          * begin-user-doc --> <!-- end-user-doc -->
66:          *
67:          * @generated
68:          */
69:         protected IChangeNotifier changeNotifier = new ChangeNotifier();
70:
71:         /**
72:          * This helps manage the child creation extenders.
73:          * <!-- begin-user-doc -->
74:          * <!-- end-user-doc -->
75:          *
76:          * @generated
77:          */
78:         protected ChildCreationExtenderManager childCreationExtenderManager = new ChildCreationExtenderManager(
79:                 KeyattributedmrEditPlugin.INSTANCE, VKeyattributedmrPackage.eNS_URI);
80:
81:         /**
82:          * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}.
83:          * <!-- begin-user-doc --> <!--
84:          * end-user-doc -->
85:          *
86:          * @generated
87:          */
88:         protected Collection<Object> supportedTypes = new ArrayList<>();
89:
90:         /**
91:          * This constructs an instance. <!-- begin-user-doc --> <!-- end-user-doc
92:          * -->
93:          *
94:          * @generated
95:          */
96:         public KeyattributedmrItemProviderAdapterFactory() {
97:                 supportedTypes.add(IEditingDomainItemProvider.class);
98:                 supportedTypes.add(IStructuredItemContentProvider.class);
99:                 supportedTypes.add(ITreeItemContentProvider.class);
100:                 supportedTypes.add(IItemLabelProvider.class);
101:                 supportedTypes.add(IItemPropertySource.class);
102:         }
103:
104:         /**
105:          * This keeps track of the one adapter used for all
106:          * {@link org.eclipse.emf.ecp.view.spi.keyattributedmr.model.VKeyAttributeDomainModelReference} instances.
107:          * <!-- begin-user-doc --> <!-- end-user-doc -->
108:          *
109:          * @generated
110:          */
111:         protected KeyAttributeDomainModelReferenceItemProvider keyAttributeDomainModelReferenceItemProvider;
112:
113:         /**
114:          * This creates an adapter for a
115:          * {@link org.eclipse.emf.ecp.view.spi.keyattributedmr.model.VKeyAttributeDomainModelReference}.
116:          * <!-- begin-user-doc --> <!-- end-user-doc -->
117:          *
118:          * @generated
119:          */
120:         @Override
121:         public Adapter createKeyAttributeDomainModelReferenceAdapter() {
122:•                if (keyAttributeDomainModelReferenceItemProvider == null) {
123:                         keyAttributeDomainModelReferenceItemProvider = new KeyAttributeDomainModelReferenceItemProvider(this);
124:                 }
125:
126:                 return keyAttributeDomainModelReferenceItemProvider;
127:         }
128:
129:         /**
130:          * This returns the root adapter factory that contains this factory. <!--
131:          * begin-user-doc --> <!-- end-user-doc -->
132:          *
133:          * @generated
134:          */
135:         @Override
136:         public ComposeableAdapterFactory getRootAdapterFactory() {
137:•                return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory();
138:         }
139:
140:         /**
141:          * This sets the composed adapter factory that contains this factory. <!--
142:          * begin-user-doc --> <!-- end-user-doc -->
143:          *
144:          * @generated
145:          */
146:         @Override
147:         public void setParentAdapterFactory(
148:                 ComposedAdapterFactory parentAdapterFactory) {
149:                 this.parentAdapterFactory = parentAdapterFactory;
150:         }
151:
152:         /**
153:          * <!-- begin-user-doc --> <!-- end-user-doc -->
154:          *
155:          * @generated
156:          */
157:         @Override
158:         public boolean isFactoryForType(Object type) {
159:•                return supportedTypes.contains(type) || super.isFactoryForType(type);
160:         }
161:
162:         /**
163:          * This implementation substitutes the factory itself as the key for the adapter.
164:          * <!-- begin-user-doc --> <!-- end-user-doc -->
165:          *
166:          * @generated
167:          */
168:         @Override
169:         public Adapter adapt(Notifier notifier, Object type) {
170:                 return super.adapt(notifier, this);
171:         }
172:
173:         /**
174:          * <!-- begin-user-doc --> <!-- end-user-doc -->
175:          *
176:          * @generated
177:          */
178:         @Override
179:         public Object adapt(Object object, Object type) {
180:•                if (isFactoryForType(type)) {
181:                         final Object adapter = super.adapt(object, type);
182:•                        if (!(type instanceof Class<?>) || ((Class<?>) type).isInstance(adapter)) {
183:                                 return adapter;
184:                         }
185:                 }
186:
187:                 return null;
188:         }
189:
190:         /**
191:          * <!-- begin-user-doc --> <!-- end-user-doc -->
192:          *
193:          * @generated
194:          */
195:         public List<IChildCreationExtender> getChildCreationExtenders() {
196:                 return childCreationExtenderManager.getChildCreationExtenders();
197:         }
198:
199:         /**
200:          * <!-- begin-user-doc --> <!-- end-user-doc -->
201:          *
202:          * @generated
203:          */
204:         @Override
205:         public Collection<?> getNewChildDescriptors(Object object,
206:                 EditingDomain editingDomain) {
207:                 return childCreationExtenderManager.getNewChildDescriptors(object, editingDomain);
208:         }
209:
210:         /**
211:          * <!-- begin-user-doc --> <!-- end-user-doc -->
212:          *
213:          * @generated
214:          */
215:         @Override
216:         public ResourceLocator getResourceLocator() {
217:                 return childCreationExtenderManager;
218:         }
219:
220:         /**
221:          * This adds a listener.
222:          * <!-- begin-user-doc --> <!-- end-user-doc -->
223:          *
224:          * @generated
225:          */
226:         @Override
227:         public void addListener(INotifyChangedListener notifyChangedListener) {
228:                 changeNotifier.addListener(notifyChangedListener);
229:         }
230:
231:         /**
232:          * This removes a listener.
233:          * <!-- begin-user-doc --> <!-- end-user-doc -->
234:          *
235:          * @generated
236:          */
237:         @Override
238:         public void removeListener(INotifyChangedListener notifyChangedListener) {
239:                 changeNotifier.removeListener(notifyChangedListener);
240:         }
241:
242:         /**
243:          * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. <!-- begin-user-doc --> <!--
244:          * end-user-doc
245:          * -->
246:          *
247:          * @generated
248:          */
249:         @Override
250:         public void fireNotifyChanged(Notification notification) {
251:                 changeNotifier.fireNotifyChanged(notification);
252:
253:•                if (parentAdapterFactory != null) {
254:                         parentAdapterFactory.fireNotifyChanged(notification);
255:                 }
256:         }
257:
258:         /**
259:          * This disposes all of the item providers created by this factory. <!--
260:          * begin-user-doc --> <!-- end-user-doc -->
261:          *
262:          * @generated
263:          */
264:         @Override
265:         public void dispose() {
266:•                if (keyAttributeDomainModelReferenceItemProvider != null) {
267:                         keyAttributeDomainModelReferenceItemProvider.dispose();
268:                 }
269:         }
270:
271: }