Skip to content

Package: DMRLocationItemProvider

DMRLocationItemProvider

nameinstructionbranchcomplexitylinemethod
DMRLocationItemProvider(AdapterFactory)
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%
collectNewChildDescriptors(Collection, Object)
M: 13 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
getChildFeature(Object, 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%
getChildrenFeatures(Object)
M: 15 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
getImage(Object)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getPropertyDescriptors(Object)
M: 10 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
getResourceLocator()
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%
getText(Object)
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%
notifyChanged(Notification)
M: 22 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /**
2: * Copyright (c) 2011-2015 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: * Johannes Faltermeier - initial API and implementation
13: */
14: package org.eclipse.emfforms.spi.spreadsheet.core.error.model.provider;
15:
16: import java.util.Collection;
17: import java.util.List;
18:
19: import org.eclipse.emf.common.notify.AdapterFactory;
20: import org.eclipse.emf.common.notify.Notification;
21: import org.eclipse.emf.common.util.ResourceLocator;
22: import org.eclipse.emf.ecore.EStructuralFeature;
23: import org.eclipse.emf.ecp.view.spi.model.VViewFactory;
24: import org.eclipse.emf.edit.provider.IChildCreationExtender;
25: import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
26: import org.eclipse.emf.edit.provider.IItemLabelProvider;
27: import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
28: import org.eclipse.emf.edit.provider.IItemPropertySource;
29: import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
30: import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
31: import org.eclipse.emf.edit.provider.ItemProviderAdapter;
32: import org.eclipse.emf.edit.provider.ViewerNotification;
33: import org.eclipse.emfforms.spi.spreadsheet.core.error.model.DMRLocation;
34: import org.eclipse.emfforms.spi.spreadsheet.core.error.model.ErrorPackage;
35:
36: /**
37: * This is the item provider adapter for a {@link org.eclipse.emfforms.spi.spreadsheet.core.error.model.DMRLocation}
38: * object.
39: * <!-- begin-user-doc -->
40: * <!-- end-user-doc -->
41: *
42: * @generated
43: */
44: public class DMRLocationItemProvider
45:         extends ItemProviderAdapter
46:         implements
47:         IEditingDomainItemProvider,
48:         IStructuredItemContentProvider,
49:         ITreeItemContentProvider,
50:         IItemLabelProvider,
51:         IItemPropertySource {
52:         /**
53:          * This constructs an instance from a factory and a notifier.
54:          * <!-- begin-user-doc -->
55:          * <!-- end-user-doc -->
56:          *
57:          * @generated
58:          */
59:         public DMRLocationItemProvider(AdapterFactory adapterFactory) {
60:                 super(adapterFactory);
61:         }
62:
63:         /**
64:          * This returns the property descriptors for the adapted class.
65:          * <!-- begin-user-doc -->
66:          * <!-- end-user-doc -->
67:          *
68:          * @generated
69:          */
70:         @Override
71:         public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
72:•                if (itemPropertyDescriptors == null) {
73:                         super.getPropertyDescriptors(object);
74:
75:                 }
76:                 return itemPropertyDescriptors;
77:         }
78:
79:         /**
80:          * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
81:          * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
82:          * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
83:          * <!-- begin-user-doc -->
84:          * <!-- end-user-doc -->
85:          *
86:          * @generated
87:          */
88:         @Override
89:         public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
90:•                if (childrenFeatures == null) {
91:                         super.getChildrenFeatures(object);
92:                         childrenFeatures.add(ErrorPackage.Literals.DMR_LOCATION__DOMAIN_MODEL_REFERENCE);
93:                 }
94:                 return childrenFeatures;
95:         }
96:
97:         /**
98:          * <!-- begin-user-doc -->
99:          * <!-- end-user-doc -->
100:          *
101:          * @generated
102:          */
103:         @Override
104:         protected EStructuralFeature getChildFeature(Object object, Object child) {
105:                 // Check the type of the specified child object and return the proper feature to use for
106:                 // adding (see {@link AddCommand}) it as a child.
107:
108:                 return super.getChildFeature(object, child);
109:         }
110:
111:         /**
112:          * This returns DMRLocation.gif.
113:          * <!-- begin-user-doc -->
114:          * <!-- end-user-doc -->
115:          *
116:          * @generated
117:          */
118:         @Override
119:         public Object getImage(Object object) {
120:                 return overlayImage(object, getResourceLocator().getImage("full/obj16/DMRLocation")); //$NON-NLS-1$
121:         }
122:
123:         /**
124:          * This returns the label text for the adapted class.
125:          * <!-- begin-user-doc -->
126:          * <!-- end-user-doc -->
127:          *
128:          * @generated
129:          */
130:         @Override
131:         public String getText(Object object) {
132:                 return getString("_UI_DMRLocation_type"); //$NON-NLS-1$
133:         }
134:
135:         /**
136:          * This handles model notifications by calling {@link #updateChildren} to update any cached
137:          * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
138:          * <!-- begin-user-doc -->
139:          * <!-- end-user-doc -->
140:          *
141:          * @generated
142:          */
143:         @Override
144:         public void notifyChanged(Notification notification) {
145:                 updateChildren(notification);
146:
147:•                switch (notification.getFeatureID(DMRLocation.class)) {
148:                 case ErrorPackage.DMR_LOCATION__DOMAIN_MODEL_REFERENCE:
149:                         fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
150:                         return;
151:                 }
152:                 super.notifyChanged(notification);
153:         }
154:
155:         /**
156:          * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
157:          * that can be created under this object.
158:          * <!-- begin-user-doc -->
159:          * <!-- end-user-doc -->
160:          *
161:          * @generated
162:          */
163:         @Override
164:         protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
165:                 super.collectNewChildDescriptors(newChildDescriptors, object);
166:
167:                 newChildDescriptors.add(createChildParameter(ErrorPackage.Literals.DMR_LOCATION__DOMAIN_MODEL_REFERENCE,
168:                         VViewFactory.eINSTANCE.createFeaturePathDomainModelReference()));
169:         }
170:
171:         /**
172:          * Return the resource locator for this item provider's resources.
173:          * <!-- begin-user-doc -->
174:          * <!-- end-user-doc -->
175:          *
176:          * @generated
177:          */
178:         @Override
179:         public ResourceLocator getResourceLocator() {
180:                 return ((IChildCreationExtender) adapterFactory).getResourceLocator();
181:         }
182:
183: }