Skip to content

Package: LabelWrapStylePropertyItemProvider

LabelWrapStylePropertyItemProvider

nameinstructionbranchcomplexitylinemethod
LabelWrapStylePropertyItemProvider(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%
addWrapLabelPropertyDescriptor(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: 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: 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: 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: 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-2018 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: * Johannes Faltermeier - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.template.style.wrap.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.wrap.model.VTLabelWrapStyleProperty;
23: import org.eclipse.emf.ecp.view.template.style.wrap.model.VTWrapPackage;
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.wrap.model.VTLabelWrapStyleProperty} object.
39: * <!-- begin-user-doc -->
40: * <!-- end-user-doc -->
41: *
42: * @generated
43: */
44: public class LabelWrapStylePropertyItemProvider
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 LabelWrapStylePropertyItemProvider(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:                         addWrapLabelPropertyDescriptor(object);
76:                 }
77:                 return itemPropertyDescriptors;
78:         }
79:
80:         /**
81:          * This adds a property descriptor for the Wrap Label feature.
82:          * <!-- begin-user-doc -->
83:          * <!-- end-user-doc -->
84:          *
85:          * @generated
86:          */
87:         protected void addWrapLabelPropertyDescriptor(Object object) {
88:                 itemPropertyDescriptors
89:                         .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
90:                                 getResourceLocator(),
91:                                 getString("_UI_LabelWrapStyleProperty_wrapLabel_feature"), //$NON-NLS-1$
92:                                 getString("_UI_PropertyDescriptor_description", "_UI_LabelWrapStyleProperty_wrapLabel_feature", //$NON-NLS-1$ //$NON-NLS-2$
93:                                         "_UI_LabelWrapStyleProperty_type"), //$NON-NLS-1$
94:                                 VTWrapPackage.Literals.LABEL_WRAP_STYLE_PROPERTY__WRAP_LABEL,
95:                                 true,
96:                                 false,
97:                                 false,
98:                                 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
99:                                 null,
100:                                 null));
101:         }
102:
103:         /**
104:          * This returns LabelWrapStyleProperty.gif.
105:          * <!-- begin-user-doc -->
106:          * <!-- end-user-doc -->
107:          *
108:          * @generated NOT
109:          */
110:         @Override
111:         public Object getImage(Object object) {
112:                 return overlayImage(object, getResourceLocator().getImage("full/obj16/LabelWrapStyleProperty.png")); //$NON-NLS-1$
113:         }
114:
115:         /**
116:          * This returns the label text for the adapted class.
117:          * <!-- begin-user-doc -->
118:          * <!-- end-user-doc -->
119:          *
120:          * @generated
121:          */
122:         @Override
123:         public String getText(Object object) {
124:                 final VTLabelWrapStyleProperty labelWrapStyleProperty = (VTLabelWrapStyleProperty) object;
125:                 return getString("_UI_LabelWrapStyleProperty_type") + " " + labelWrapStyleProperty.isWrapLabel(); //$NON-NLS-1$ //$NON-NLS-2$
126:         }
127:
128:         /**
129:          * This handles model notifications by calling {@link #updateChildren} to update any cached
130:          * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
131:          * <!-- begin-user-doc -->
132:          * <!-- end-user-doc -->
133:          *
134:          * @generated
135:          */
136:         @Override
137:         public void notifyChanged(Notification notification) {
138:                 updateChildren(notification);
139:
140:•                switch (notification.getFeatureID(VTLabelWrapStyleProperty.class)) {
141:                 case VTWrapPackage.LABEL_WRAP_STYLE_PROPERTY__WRAP_LABEL:
142:                         fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
143:                         return;
144:                 }
145:                 super.notifyChanged(notification);
146:         }
147:
148:         /**
149:          * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
150:          * that can be created under this object.
151:          * <!-- begin-user-doc -->
152:          * <!-- end-user-doc -->
153:          *
154:          * @generated
155:          */
156:         @Override
157:         protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
158:                 super.collectNewChildDescriptors(newChildDescriptors, object);
159:         }
160:
161:         /**
162:          * Return the resource locator for this item provider's resources.
163:          * <!-- begin-user-doc -->
164:          * <!-- end-user-doc -->
165:          *
166:          * @generated
167:          */
168:         @Override
169:         public ResourceLocator getResourceLocator() {
170:                 return ((IChildCreationExtender) adapterFactory).getResourceLocator();
171:         }
172:
173: }