Skip to content

Package: StaffItemProvider

StaffItemProvider

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