Skip to content

Package: SettingToSheetMappingItemProvider

SettingToSheetMappingItemProvider

nameinstructionbranchcomplexitylinemethod
SettingToSheetMappingItemProvider(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: 21 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 6 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: 20 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 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.edit.provider.IChildCreationExtender;
24: import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
25: import org.eclipse.emf.edit.provider.IItemLabelProvider;
26: import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
27: import org.eclipse.emf.edit.provider.IItemPropertySource;
28: import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
29: import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
30: import org.eclipse.emf.edit.provider.ItemProviderAdapter;
31: import org.eclipse.emf.edit.provider.ViewerNotification;
32: import org.eclipse.emfforms.spi.spreadsheet.core.error.model.ErrorFactory;
33: import org.eclipse.emfforms.spi.spreadsheet.core.error.model.ErrorPackage;
34: import org.eclipse.emfforms.spi.spreadsheet.core.error.model.SettingToSheetMapping;
35:
36: /**
37: * This is the item provider adapter for a
38: * {@link org.eclipse.emfforms.spi.spreadsheet.core.error.model.SettingToSheetMapping} object.
39: * <!-- begin-user-doc -->
40: * <!-- end-user-doc -->
41: *
42: * @generated
43: */
44: public class SettingToSheetMappingItemProvider
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 SettingToSheetMappingItemProvider(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.SETTING_TO_SHEET_MAPPING__SHEET_LOCATION);
93:                         childrenFeatures.add(ErrorPackage.Literals.SETTING_TO_SHEET_MAPPING__SETTING_LOCATION);
94:                 }
95:                 return childrenFeatures;
96:         }
97:
98:         /**
99:          * <!-- begin-user-doc -->
100:          * <!-- end-user-doc -->
101:          *
102:          * @generated
103:          */
104:         @Override
105:         protected EStructuralFeature getChildFeature(Object object, Object child) {
106:                 // Check the type of the specified child object and return the proper feature to use for
107:                 // adding (see {@link AddCommand}) it as a child.
108:
109:                 return super.getChildFeature(object, child);
110:         }
111:
112:         /**
113:          * This returns SettingToSheetMapping.gif.
114:          * <!-- begin-user-doc -->
115:          * <!-- end-user-doc -->
116:          *
117:          * @generated
118:          */
119:         @Override
120:         public Object getImage(Object object) {
121:                 return overlayImage(object, getResourceLocator().getImage("full/obj16/SettingToSheetMapping")); //$NON-NLS-1$
122:         }
123:
124:         /**
125:          * This returns the label text for the adapted class.
126:          * <!-- begin-user-doc -->
127:          * <!-- end-user-doc -->
128:          *
129:          * @generated
130:          */
131:         @Override
132:         public String getText(Object object) {
133:                 return getString("_UI_SettingToSheetMapping_type"); //$NON-NLS-1$
134:         }
135:
136:         /**
137:          * This handles model notifications by calling {@link #updateChildren} to update any cached
138:          * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
139:          * <!-- begin-user-doc -->
140:          * <!-- end-user-doc -->
141:          *
142:          * @generated
143:          */
144:         @Override
145:         public void notifyChanged(Notification notification) {
146:                 updateChildren(notification);
147:
148:•                switch (notification.getFeatureID(SettingToSheetMapping.class)) {
149:                 case ErrorPackage.SETTING_TO_SHEET_MAPPING__SHEET_LOCATION:
150:                 case ErrorPackage.SETTING_TO_SHEET_MAPPING__SETTING_LOCATION:
151:                         fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
152:                         return;
153:                 }
154:                 super.notifyChanged(notification);
155:         }
156:
157:         /**
158:          * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
159:          * that can be created under this object.
160:          * <!-- begin-user-doc -->
161:          * <!-- end-user-doc -->
162:          *
163:          * @generated
164:          */
165:         @Override
166:         protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
167:                 super.collectNewChildDescriptors(newChildDescriptors, object);
168:
169:                 newChildDescriptors.add(createChildParameter(ErrorPackage.Literals.SETTING_TO_SHEET_MAPPING__SHEET_LOCATION,
170:                         ErrorFactory.eINSTANCE.createSheetLocation()));
171:
172:                 newChildDescriptors.add(createChildParameter(ErrorPackage.Literals.SETTING_TO_SHEET_MAPPING__SETTING_LOCATION,
173:                         ErrorFactory.eINSTANCE.createSettingLocation()));
174:         }
175:
176:         /**
177:          * Return the resource locator for this item provider's resources.
178:          * <!-- begin-user-doc -->
179:          * <!-- end-user-doc -->
180:          *
181:          * @generated
182:          */
183:         @Override
184:         public ResourceLocator getResourceLocator() {
185:                 return ((IChildCreationExtender) adapterFactory).getResourceLocator();
186:         }
187:
188: }