Skip to content

Package: CourseCatalogItemProvider

CourseCatalogItemProvider

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