Skip to content

Package: TableValidationStylePropertyItemProvider

TableValidationStylePropertyItemProvider

nameinstructionbranchcomplexitylinemethod
TableValidationStylePropertyItemProvider(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%
addColumnNamePropertyDescriptor(Object)
M: 28 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 15 C: 0
0%
M: 1 C: 0
0%
addColumnWidthPropertyDescriptor(Object)
M: 28 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 15 C: 0
0%
M: 1 C: 0
0%
addImagePathPropertyDescriptor(Object)
M: 28 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 15 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: 19 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 6 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: 26 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 3 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-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 Munich - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.template.style.tableValidation.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.tableValidation.model.VTTableValidationPackage;
23: import org.eclipse.emf.ecp.view.template.style.tableValidation.model.VTTableValidationStyleProperty;
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.tableValidation.model.VTTableValidationStyleProperty} object.
39: * <!-- begin-user-doc -->
40: * <!-- end-user-doc -->
41: *
42: * @generated
43: */
44: public class TableValidationStylePropertyItemProvider
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 TableValidationStylePropertyItemProvider(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:                         addColumnWidthPropertyDescriptor(object);
76:                         addColumnNamePropertyDescriptor(object);
77:                         addImagePathPropertyDescriptor(object);
78:                 }
79:                 return itemPropertyDescriptors;
80:         }
81:
82:         /**
83:          * This adds a property descriptor for the Column Width feature.
84:          * <!-- begin-user-doc -->
85:          * <!-- end-user-doc -->
86:          *
87:          * @generated
88:          */
89:         protected void addColumnWidthPropertyDescriptor(Object object) {
90:                 itemPropertyDescriptors
91:                         .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
92:                                 getResourceLocator(),
93:                                 getString("_UI_TableValidationStyleProperty_columnWidth_feature"), //$NON-NLS-1$
94:                                 getString(
95:                                         "_UI_PropertyDescriptor_description", "_UI_TableValidationStyleProperty_columnWidth_feature", //$NON-NLS-1$ //$NON-NLS-2$
96:                                         "_UI_TableValidationStyleProperty_type"), //$NON-NLS-1$
97:                                 VTTableValidationPackage.Literals.TABLE_VALIDATION_STYLE_PROPERTY__COLUMN_WIDTH,
98:                                 true,
99:                                 false,
100:                                 false,
101:                                 ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
102:                                 null,
103:                                 null));
104:         }
105:
106:         /**
107:          * This adds a property descriptor for the Column Name feature.
108:          * <!-- begin-user-doc -->
109:          * <!-- end-user-doc -->
110:          *
111:          * @generated
112:          */
113:         protected void addColumnNamePropertyDescriptor(Object object) {
114:                 itemPropertyDescriptors
115:                         .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
116:                                 getResourceLocator(),
117:                                 getString("_UI_TableValidationStyleProperty_columnName_feature"), //$NON-NLS-1$
118:                                 getString(
119:                                         "_UI_PropertyDescriptor_description", "_UI_TableValidationStyleProperty_columnName_feature", //$NON-NLS-1$ //$NON-NLS-2$
120:                                         "_UI_TableValidationStyleProperty_type"), //$NON-NLS-1$
121:                                 VTTableValidationPackage.Literals.TABLE_VALIDATION_STYLE_PROPERTY__COLUMN_NAME,
122:                                 true,
123:                                 false,
124:                                 false,
125:                                 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
126:                                 null,
127:                                 null));
128:         }
129:
130:         /**
131:          * This adds a property descriptor for the Image Path feature.
132:          * <!-- begin-user-doc -->
133:          * <!-- end-user-doc -->
134:          *
135:          * @generated
136:          */
137:         protected void addImagePathPropertyDescriptor(Object object) {
138:                 itemPropertyDescriptors
139:                         .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
140:                                 getResourceLocator(),
141:                                 getString("_UI_TableValidationStyleProperty_imagePath_feature"), //$NON-NLS-1$
142:                                 getString(
143:                                         "_UI_PropertyDescriptor_description", "_UI_TableValidationStyleProperty_imagePath_feature", //$NON-NLS-1$ //$NON-NLS-2$
144:                                         "_UI_TableValidationStyleProperty_type"), //$NON-NLS-1$
145:                                 VTTableValidationPackage.Literals.TABLE_VALIDATION_STYLE_PROPERTY__IMAGE_PATH,
146:                                 true,
147:                                 false,
148:                                 false,
149:                                 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
150:                                 null,
151:                                 null));
152:         }
153:
154:         /**
155:          * This returns TableValidationStyleProperty.gif.
156:          * <!-- begin-user-doc -->
157:          * <!-- end-user-doc -->
158:          *
159:          * @generated
160:          */
161:         @Override
162:         public Object getImage(Object object) {
163:                 return overlayImage(object, getResourceLocator().getImage("full/obj16/TableValidationStyleProperty")); //$NON-NLS-1$
164:         }
165:
166:         /**
167:          * This returns the label text for the adapted class.
168:          * <!-- begin-user-doc -->
169:          * <!-- end-user-doc -->
170:          *
171:          * @generated
172:          */
173:         @Override
174:         public String getText(Object object) {
175:                 final String label = ((VTTableValidationStyleProperty) object).getColumnName();
176:•                return label == null || label.length() == 0 ? getString("_UI_TableValidationStyleProperty_type") : //$NON-NLS-1$
177:                         getString("_UI_TableValidationStyleProperty_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
178:         }
179:
180:         /**
181:          * This handles model notifications by calling {@link #updateChildren} to update any cached
182:          * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
183:          * <!-- begin-user-doc -->
184:          * <!-- end-user-doc -->
185:          *
186:          * @generated
187:          */
188:         @Override
189:         public void notifyChanged(Notification notification) {
190:                 updateChildren(notification);
191:
192:•                switch (notification.getFeatureID(VTTableValidationStyleProperty.class)) {
193:                 case VTTableValidationPackage.TABLE_VALIDATION_STYLE_PROPERTY__COLUMN_WIDTH:
194:                 case VTTableValidationPackage.TABLE_VALIDATION_STYLE_PROPERTY__COLUMN_NAME:
195:                 case VTTableValidationPackage.TABLE_VALIDATION_STYLE_PROPERTY__IMAGE_PATH:
196:                         fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
197:                         return;
198:                 }
199:                 super.notifyChanged(notification);
200:         }
201:
202:         /**
203:          * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
204:          * that can be created under this object.
205:          * <!-- begin-user-doc -->
206:          * <!-- end-user-doc -->
207:          *
208:          * @generated
209:          */
210:         @Override
211:         protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
212:                 super.collectNewChildDescriptors(newChildDescriptors, object);
213:         }
214:
215:         /**
216:          * Return the resource locator for this item provider's resources.
217:          * <!-- begin-user-doc -->
218:          * <!-- end-user-doc -->
219:          *
220:          * @generated
221:          */
222:         @Override
223:         public ResourceLocator getResourceLocator() {
224:                 return ((IChildCreationExtender) adapterFactory).getResourceLocator();
225:         }
226:
227: }