Skip to content

Package: StyleSelectorContainerItemProvider

StyleSelectorContainerItemProvider

nameinstructionbranchcomplexitylinemethod
StyleSelectorContainerItemProvider(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%
addSelectorPropertyDescriptor(Object)
M: 0 C: 28
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 14
100%
M: 0 C: 1
100%
collectNewChildDescriptors(Collection, Object)
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
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: 0 C: 15
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
getPropertyDescriptors(Object)
M: 0 C: 13
100%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 0 C: 4
100%
M: 0 C: 1
100%
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: 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: 0 C: 22
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 6
100%
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.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.template.model.VTStyleSelectorContainer;
24: import org.eclipse.emf.ecp.view.template.model.VTTemplatePackage;
25: import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
26: import org.eclipse.emf.edit.provider.IChildCreationExtender;
27: import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
28: import org.eclipse.emf.edit.provider.IItemLabelProvider;
29: import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
30: import org.eclipse.emf.edit.provider.IItemPropertySource;
31: import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
32: import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
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 {@link org.eclipse.emf.ecp.view.template.model.VTStyleSelectorContainer}
38: * object.
39: * <!-- begin-user-doc -->
40: * <!-- end-user-doc -->
41: *
42: * @generated
43: */
44: public class StyleSelectorContainerItemProvider
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 StyleSelectorContainerItemProvider(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:                         addSelectorPropertyDescriptor(object);
76:                 }
77:                 return itemPropertyDescriptors;
78:         }
79:
80:         /**
81:          * This adds a property descriptor for the Selector feature.
82:          * <!-- begin-user-doc -->
83:          * <!-- end-user-doc -->
84:          *
85:          * @generated
86:          */
87:         protected void addSelectorPropertyDescriptor(Object object) {
88:                 itemPropertyDescriptors
89:                         .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
90:                                 getResourceLocator(),
91:                                 getString("_UI_StyleSelectorContainer_selector_feature"), //$NON-NLS-1$
92:                                 getString("_UI_PropertyDescriptor_description", "_UI_StyleSelectorContainer_selector_feature", //$NON-NLS-1$ //$NON-NLS-2$
93:                                         "_UI_StyleSelectorContainer_type"), //$NON-NLS-1$
94:                                 VTTemplatePackage.Literals.STYLE_SELECTOR_CONTAINER__SELECTOR,
95:                                 true,
96:                                 false,
97:                                 false,
98:                                 null,
99:                                 null,
100:                                 null));
101:         }
102:
103:         /**
104:          * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
105:          * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
106:          * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
107:          * <!-- begin-user-doc -->
108:          * <!-- end-user-doc -->
109:          *
110:          * @generated
111:          */
112:         @Override
113:         public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
114:•                if (childrenFeatures == null) {
115:                         super.getChildrenFeatures(object);
116:                         childrenFeatures.add(VTTemplatePackage.Literals.STYLE_SELECTOR_CONTAINER__SELECTOR);
117:                 }
118:                 return childrenFeatures;
119:         }
120:
121:         /**
122:          * <!-- begin-user-doc -->
123:          * <!-- end-user-doc -->
124:          *
125:          * @generated
126:          */
127:         @Override
128:         protected EStructuralFeature getChildFeature(Object object, Object child) {
129:                 // Check the type of the specified child object and return the proper feature to use for
130:                 // adding (see {@link AddCommand}) it as a child.
131:
132:                 return super.getChildFeature(object, child);
133:         }
134:
135:         /**
136:          * This returns the label text for the adapted class.
137:          * <!-- begin-user-doc -->
138:          * <!-- end-user-doc -->
139:          *
140:          * @generated
141:          */
142:         @Override
143:         public String getText(Object object) {
144:                 return getString("_UI_StyleSelectorContainer_type"); //$NON-NLS-1$
145:         }
146:
147:         /**
148:          * This handles model notifications by calling {@link #updateChildren} to update any cached
149:          * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
150:          * <!-- begin-user-doc -->
151:          * <!-- end-user-doc -->
152:          *
153:          * @generated
154:          */
155:         @Override
156:         public void notifyChanged(Notification notification) {
157:                 updateChildren(notification);
158:
159:•                switch (notification.getFeatureID(VTStyleSelectorContainer.class)) {
160:                 case VTTemplatePackage.STYLE_SELECTOR_CONTAINER__SELECTOR:
161:                         fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
162:                         return;
163:                 }
164:                 super.notifyChanged(notification);
165:         }
166:
167:         /**
168:          * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
169:          * that can be created under this object.
170:          * <!-- begin-user-doc -->
171:          * <!-- end-user-doc -->
172:          *
173:          * @generated
174:          */
175:         @Override
176:         protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
177:                 super.collectNewChildDescriptors(newChildDescriptors, object);
178:         }
179:
180:         /**
181:          * Return the resource locator for this item provider's resources.
182:          * <!-- begin-user-doc -->
183:          * <!-- end-user-doc -->
184:          *
185:          * @generated
186:          */
187:         @Override
188:         public ResourceLocator getResourceLocator() {
189:                 return ((IChildCreationExtender) adapterFactory).getResourceLocator();
190:         }
191:
192: }