Skip to content

Package: RowItemProvider

RowItemProvider

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