Skip to content

Package: TableStylePropertyItemProvider

TableStylePropertyItemProvider

nameinstructionbranchcomplexitylinemethod
TableStylePropertyItemProvider(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%
addEnableSortingPropertyDescriptor(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%
addMaximumHeightPropertyDescriptor(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%
addMinimumHeightPropertyDescriptor(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%
addRenderModePropertyDescriptor(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%
addShowValidationSummaryTooltipPropertyDescriptor(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%
addVisibleLinesPropertyDescriptor(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%
getImage(Object)
M: 0 C: 8
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getPropertyDescriptors(Object)
M: 28 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 9 C: 0
0%
M: 1 C: 0
0%
getResourceLocator()
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getText(Object)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
notifyChanged(Notification)
M: 11 C: 11
50%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 2 C: 4
67%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (c) 2011-2016 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 Munich - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.template.style.tableStyleProperty.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.ecp.view.template.style.tableStyleProperty.model.VTTableStyleProperty;
23: import org.eclipse.emf.ecp.view.template.style.tableStyleProperty.model.VTTableStylePropertyPackage;
24: import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
25: import org.eclipse.emf.edit.provider.IChildCreationExtender;
26: import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
27: import org.eclipse.emf.edit.provider.IItemLabelProvider;
28: import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
29: import org.eclipse.emf.edit.provider.IItemPropertySource;
30: import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
31: import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
32: import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
33: import org.eclipse.emf.edit.provider.ItemProviderAdapter;
34: import org.eclipse.emf.edit.provider.ViewerNotification;
35:
36: /**
37: * This is the item provider adapter for a
38: * {@link org.eclipse.emf.ecp.view.template.style.tableStyleProperty.model.VTTableStyleProperty} object.
39: * <!-- begin-user-doc -->
40: * <!-- end-user-doc -->
41: *
42: * @generated
43: */
44: public class TableStylePropertyItemProvider
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 TableStylePropertyItemProvider(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:                         addMinimumHeightPropertyDescriptor(object);
76:                         addMaximumHeightPropertyDescriptor(object);
77:                         addShowValidationSummaryTooltipPropertyDescriptor(object);
78:                         addEnableSortingPropertyDescriptor(object);
79:                         addVisibleLinesPropertyDescriptor(object);
80:                         addRenderModePropertyDescriptor(object);
81:                 }
82:                 return itemPropertyDescriptors;
83:         }
84:
85:         /**
86:          * This adds a property descriptor for the Minimum Height feature.
87:          * <!-- begin-user-doc -->
88:          * <!-- end-user-doc -->
89:          *
90:          * @generated
91:          */
92:         protected void addMinimumHeightPropertyDescriptor(Object object) {
93:                 itemPropertyDescriptors
94:                         .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
95:                                 getResourceLocator(),
96:                                 getString("_UI_TableStyleProperty_minimumHeight_feature"), //$NON-NLS-1$
97:                                 getString("_UI_PropertyDescriptor_description", "_UI_TableStyleProperty_minimumHeight_feature", //$NON-NLS-1$ //$NON-NLS-2$
98:                                         "_UI_TableStyleProperty_type"), //$NON-NLS-1$
99:                                 VTTableStylePropertyPackage.Literals.TABLE_STYLE_PROPERTY__MINIMUM_HEIGHT,
100:                                 true,
101:                                 false,
102:                                 false,
103:                                 ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
104:                                 null,
105:                                 null));
106:         }
107:
108:         /**
109:          * This adds a property descriptor for the Maximum Height feature.
110:          * <!-- begin-user-doc -->
111:          * <!-- end-user-doc -->
112:          *
113:          * @generated
114:          */
115:         protected void addMaximumHeightPropertyDescriptor(Object object) {
116:                 itemPropertyDescriptors
117:                         .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
118:                                 getResourceLocator(),
119:                                 getString("_UI_TableStyleProperty_maximumHeight_feature"), //$NON-NLS-1$
120:                                 getString("_UI_PropertyDescriptor_description", "_UI_TableStyleProperty_maximumHeight_feature", //$NON-NLS-1$ //$NON-NLS-2$
121:                                         "_UI_TableStyleProperty_type"), //$NON-NLS-1$
122:                                 VTTableStylePropertyPackage.Literals.TABLE_STYLE_PROPERTY__MAXIMUM_HEIGHT,
123:                                 true,
124:                                 false,
125:                                 false,
126:                                 ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
127:                                 null,
128:                                 null));
129:         }
130:
131:         /**
132:          * This adds a property descriptor for the Show Validation Summary Tooltip feature.
133:          * <!-- begin-user-doc -->
134:          * <!-- end-user-doc -->
135:          *
136:          * @generated
137:          */
138:         protected void addShowValidationSummaryTooltipPropertyDescriptor(Object object) {
139:                 itemPropertyDescriptors
140:                         .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
141:                                 getResourceLocator(),
142:                                 getString("_UI_TableStyleProperty_showValidationSummaryTooltip_feature"), //$NON-NLS-1$
143:                                 getString("_UI_PropertyDescriptor_description", //$NON-NLS-1$
144:                                         "_UI_TableStyleProperty_showValidationSummaryTooltip_feature", "_UI_TableStyleProperty_type"), //$NON-NLS-1$ //$NON-NLS-2$
145:                                 VTTableStylePropertyPackage.Literals.TABLE_STYLE_PROPERTY__SHOW_VALIDATION_SUMMARY_TOOLTIP,
146:                                 true,
147:                                 false,
148:                                 false,
149:                                 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
150:                                 null,
151:                                 null));
152:         }
153:
154:         /**
155:          * This adds a property descriptor for the Enable Sorting feature.
156:          * <!-- begin-user-doc -->
157:          * <!-- end-user-doc -->
158:          *
159:          * @generated
160:          */
161:         protected void addEnableSortingPropertyDescriptor(Object object) {
162:                 itemPropertyDescriptors
163:                         .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
164:                                 getResourceLocator(),
165:                                 getString("_UI_TableStyleProperty_enableSorting_feature"), //$NON-NLS-1$
166:                                 getString("_UI_PropertyDescriptor_description", "_UI_TableStyleProperty_enableSorting_feature", //$NON-NLS-1$ //$NON-NLS-2$
167:                                         "_UI_TableStyleProperty_type"), //$NON-NLS-1$
168:                                 VTTableStylePropertyPackage.Literals.TABLE_STYLE_PROPERTY__ENABLE_SORTING,
169:                                 true,
170:                                 false,
171:                                 false,
172:                                 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
173:                                 null,
174:                                 null));
175:         }
176:
177:         /**
178:          * This adds a property descriptor for the Visible Lines feature.
179:          * <!-- begin-user-doc -->
180:          * <!-- end-user-doc -->
181:          *
182:          * @generated
183:          */
184:         protected void addVisibleLinesPropertyDescriptor(Object object) {
185:                 itemPropertyDescriptors
186:                         .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
187:                                 getResourceLocator(),
188:                                 getString("_UI_TableStyleProperty_visibleLines_feature"), //$NON-NLS-1$
189:                                 getString("_UI_PropertyDescriptor_description", "_UI_TableStyleProperty_visibleLines_feature", //$NON-NLS-1$ //$NON-NLS-2$
190:                                         "_UI_TableStyleProperty_type"), //$NON-NLS-1$
191:                                 VTTableStylePropertyPackage.Literals.TABLE_STYLE_PROPERTY__VISIBLE_LINES,
192:                                 true,
193:                                 false,
194:                                 false,
195:                                 ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
196:                                 null,
197:                                 null));
198:         }
199:
200:         /**
201:          * This adds a property descriptor for the Render Mode feature.
202:          * <!-- begin-user-doc -->
203:          * <!-- end-user-doc -->
204:          *
205:          * @generated
206:          */
207:         protected void addRenderModePropertyDescriptor(Object object) {
208:                 itemPropertyDescriptors
209:                         .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
210:                                 getResourceLocator(),
211:                                 getString("_UI_TableStyleProperty_renderMode_feature"), //$NON-NLS-1$
212:                                 getString("_UI_PropertyDescriptor_description", "_UI_TableStyleProperty_renderMode_feature", //$NON-NLS-1$ //$NON-NLS-2$
213:                                         "_UI_TableStyleProperty_type"), //$NON-NLS-1$
214:                                 VTTableStylePropertyPackage.Literals.TABLE_STYLE_PROPERTY__RENDER_MODE,
215:                                 true,
216:                                 false,
217:                                 false,
218:                                 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
219:                                 null,
220:                                 null));
221:         }
222:
223:         /**
224:          * This returns TableStyleProperty.gif.
225:          * <!-- begin-user-doc -->
226:          * <!-- end-user-doc -->
227:          *
228:          * @generated
229:          */
230:         @Override
231:         public Object getImage(Object object) {
232:                 return overlayImage(object, getResourceLocator().getImage("full/obj16/TableStyleProperty")); //$NON-NLS-1$
233:         }
234:
235:         /**
236:          * This returns the label text for the adapted class.
237:          * <!-- begin-user-doc -->
238:          * <!-- end-user-doc -->
239:          *
240:          * @generated
241:          */
242:         @Override
243:         public String getText(Object object) {
244:                 final VTTableStyleProperty tableStyleProperty = (VTTableStyleProperty) object;
245:                 return getString("_UI_TableStyleProperty_type") + " " + tableStyleProperty.getMinimumHeight(); //$NON-NLS-1$ //$NON-NLS-2$
246:         }
247:
248:         /**
249:          * This handles model notifications by calling {@link #updateChildren} to update any cached
250:          * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
251:          * <!-- begin-user-doc -->
252:          * <!-- end-user-doc -->
253:          *
254:          * @generated
255:          */
256:         @Override
257:         public void notifyChanged(Notification notification) {
258:                 updateChildren(notification);
259:
260:•                switch (notification.getFeatureID(VTTableStyleProperty.class)) {
261:                 case VTTableStylePropertyPackage.TABLE_STYLE_PROPERTY__MINIMUM_HEIGHT:
262:                 case VTTableStylePropertyPackage.TABLE_STYLE_PROPERTY__MAXIMUM_HEIGHT:
263:                 case VTTableStylePropertyPackage.TABLE_STYLE_PROPERTY__SHOW_VALIDATION_SUMMARY_TOOLTIP:
264:                 case VTTableStylePropertyPackage.TABLE_STYLE_PROPERTY__ENABLE_SORTING:
265:                 case VTTableStylePropertyPackage.TABLE_STYLE_PROPERTY__VISIBLE_LINES:
266:                 case VTTableStylePropertyPackage.TABLE_STYLE_PROPERTY__RENDER_MODE:
267:                         fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
268:                         return;
269:                 }
270:                 super.notifyChanged(notification);
271:         }
272:
273:         /**
274:          * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
275:          * that can be created under this object.
276:          * <!-- begin-user-doc -->
277:          * <!-- end-user-doc -->
278:          *
279:          * @generated
280:          */
281:         @Override
282:         protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
283:                 super.collectNewChildDescriptors(newChildDescriptors, object);
284:         }
285:
286:         /**
287:          * Return the resource locator for this item provider's resources.
288:          * <!-- begin-user-doc -->
289:          * <!-- end-user-doc -->
290:          *
291:          * @generated
292:          */
293:         @Override
294:         public ResourceLocator getResourceLocator() {
295:                 return ((IChildCreationExtender) adapterFactory).getResourceLocator();
296:         }
297:
298: }