Skip to content

Package: TextControlEnablementStylePropertyItemProvider

TextControlEnablementStylePropertyItemProvider

nameinstructionbranchcomplexitylinemethod
TextControlEnablementStylePropertyItemProvider(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%
addRenderDisableAsEditablePropertyDescriptor(Object)
M: 28 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 16 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: 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: 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: 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.textControlEnablement.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.textControlEnablement.model.VTTextControlEnablementPackage;
23: import org.eclipse.emf.ecp.view.template.style.textControlEnablement.model.VTTextControlEnablementStyleProperty;
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.textControlEnablement.model.VTTextControlEnablementStyleProperty}
39: * object.
40: * <!-- begin-user-doc -->
41: * <!-- end-user-doc -->
42: *
43: * @generated
44: */
45: public class TextControlEnablementStylePropertyItemProvider
46:         extends ItemProviderAdapter
47:         implements
48:         IEditingDomainItemProvider,
49:         IStructuredItemContentProvider,
50:         ITreeItemContentProvider,
51:         IItemLabelProvider,
52:         IItemPropertySource {
53:         /**
54:          * This constructs an instance from a factory and a notifier.
55:          * <!-- begin-user-doc -->
56:          * <!-- end-user-doc -->
57:          *
58:          * @generated
59:          */
60:         public TextControlEnablementStylePropertyItemProvider(AdapterFactory adapterFactory) {
61:                 super(adapterFactory);
62:         }
63:
64:         /**
65:          * This returns the property descriptors for the adapted class.
66:          * <!-- begin-user-doc -->
67:          * <!-- end-user-doc -->
68:          *
69:          * @generated
70:          */
71:         @Override
72:         public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
73:•                if (itemPropertyDescriptors == null) {
74:                         super.getPropertyDescriptors(object);
75:
76:                         addRenderDisableAsEditablePropertyDescriptor(object);
77:                 }
78:                 return itemPropertyDescriptors;
79:         }
80:
81:         /**
82:          * This adds a property descriptor for the Render Disable As Editable feature.
83:          * <!-- begin-user-doc -->
84:          * <!-- end-user-doc -->
85:          *
86:          * @generated
87:          */
88:         protected void addRenderDisableAsEditablePropertyDescriptor(Object object) {
89:                 itemPropertyDescriptors
90:                         .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
91:                                 getResourceLocator(),
92:                                 getString("_UI_TextControlEnablementStyleProperty_RenderDisableAsEditable_feature"), //$NON-NLS-1$
93:                                 getString(
94:                                         "_UI_PropertyDescriptor_description", //$NON-NLS-1$
95:                                         "_UI_TextControlEnablementStyleProperty_RenderDisableAsEditable_feature", //$NON-NLS-1$
96:                                         "_UI_TextControlEnablementStyleProperty_type"), //$NON-NLS-1$
97:                                 VTTextControlEnablementPackage.Literals.TEXT_CONTROL_ENABLEMENT_STYLE_PROPERTY__RENDER_DISABLE_AS_EDITABLE,
98:                                 true,
99:                                 false,
100:                                 false,
101:                                 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
102:                                 null,
103:                                 null));
104:         }
105:
106:         /**
107:          * This returns TextControlEnablementStyleProperty.gif.
108:          * <!-- begin-user-doc -->
109:          * <!-- end-user-doc -->
110:          *
111:          * @generated
112:          */
113:         @Override
114:         public Object getImage(Object object) {
115:                 return overlayImage(object, getResourceLocator().getImage("full/obj16/TextControlEnablementStyleProperty")); //$NON-NLS-1$
116:         }
117:
118:         /**
119:          * This returns the label text for the adapted class.
120:          * <!-- begin-user-doc -->
121:          * <!-- end-user-doc -->
122:          *
123:          * @generated
124:          */
125:         @Override
126:         public String getText(Object object) {
127:                 final VTTextControlEnablementStyleProperty textControlEnablementStyleProperty = (VTTextControlEnablementStyleProperty) object;
128:                 return getString("_UI_TextControlEnablementStyleProperty_type") + " " //$NON-NLS-1$ //$NON-NLS-2$
129:                         + textControlEnablementStyleProperty.isRenderDisableAsEditable();
130:         }
131:
132:         /**
133:          * This handles model notifications by calling {@link #updateChildren} to update any cached
134:          * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
135:          * <!-- begin-user-doc -->
136:          * <!-- end-user-doc -->
137:          *
138:          * @generated
139:          */
140:         @Override
141:         public void notifyChanged(Notification notification) {
142:                 updateChildren(notification);
143:
144:•                switch (notification.getFeatureID(VTTextControlEnablementStyleProperty.class)) {
145:                 case VTTextControlEnablementPackage.TEXT_CONTROL_ENABLEMENT_STYLE_PROPERTY__RENDER_DISABLE_AS_EDITABLE:
146:                         fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
147:                         return;
148:                 }
149:                 super.notifyChanged(notification);
150:         }
151:
152:         /**
153:          * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
154:          * that can be created under this object.
155:          * <!-- begin-user-doc -->
156:          * <!-- end-user-doc -->
157:          *
158:          * @generated
159:          */
160:         @Override
161:         protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
162:                 super.collectNewChildDescriptors(newChildDescriptors, object);
163:         }
164:
165:         /**
166:          * Return the resource locator for this item provider's resources.
167:          * <!-- begin-user-doc -->
168:          * <!-- end-user-doc -->
169:          *
170:          * @generated
171:          */
172:         @Override
173:         public ResourceLocator getResourceLocator() {
174:                 return ((IChildCreationExtender) adapterFactory).getResourceLocator();
175:         }
176:
177: }