Skip to content

Package: CustomDomainModelReferenceItemProvider

CustomDomainModelReferenceItemProvider

nameinstructionbranchcomplexitylinemethod
CustomDomainModelReferenceItemProvider(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%
addBundleNamePropertyDescriptor(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%
addClassNamePropertyDescriptor(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%
addControlCheckedPropertyDescriptor(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: 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: 0 C: 19
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 6
100%
M: 0 C: 1
100%
getText(Object)
M: 0 C: 26
100%
M: 1 C: 3
75%
M: 1 C: 2
67%
M: 0 C: 3
100%
M: 0 C: 1
100%
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: * Eugen Neufeld - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.spi.custom.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.ecp.view.spi.custom.model.VCustomDomainModelReference;
22: import org.eclipse.emf.ecp.view.spi.custom.model.VCustomPackage;
23: import org.eclipse.emf.ecp.view.spi.model.provider.DomainModelReferenceItemProvider;
24: import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
25: import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
26: import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
27: import org.eclipse.emf.edit.provider.ViewerNotification;
28:
29: /**
30: * This is the item provider adapter for a {@link org.eclipse.emf.ecp.view.spi.custom.model.VCustomDomainModelReference}
31: * object.
32: * <!-- begin-user-doc -->
33: *
34: * @since 1.3
35: * <!-- end-user-doc -->
36: * @generated
37: */
38: public class CustomDomainModelReferenceItemProvider
39:         extends DomainModelReferenceItemProvider {
40:         /**
41:          * This constructs an instance from a factory and a notifier.
42:          * <!-- begin-user-doc -->
43:          * <!-- end-user-doc -->
44:          *
45:          * @generated
46:          */
47:         public CustomDomainModelReferenceItemProvider(AdapterFactory adapterFactory) {
48:                 super(adapterFactory);
49:         }
50:
51:         /**
52:          * This returns the property descriptors for the adapted class.
53:          * <!-- begin-user-doc -->
54:          * <!-- end-user-doc -->
55:          *
56:          * @generated
57:          */
58:         @Override
59:         public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
60:•                if (itemPropertyDescriptors == null) {
61:                         super.getPropertyDescriptors(object);
62:
63:                         addBundleNamePropertyDescriptor(object);
64:                         addClassNamePropertyDescriptor(object);
65:                         addControlCheckedPropertyDescriptor(object);
66:                 }
67:                 return itemPropertyDescriptors;
68:         }
69:
70:         /**
71:          * This adds a property descriptor for the Bundle Name feature.
72:          * <!-- begin-user-doc -->
73:          * <!-- end-user-doc -->
74:          *
75:          * @generated
76:          */
77:         protected void addBundleNamePropertyDescriptor(Object object) {
78:                 itemPropertyDescriptors
79:                         .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
80:                                 getResourceLocator(),
81:                                 getString("_UI_CustomDomainModelReference_bundleName_feature"), //$NON-NLS-1$
82:                                 getString("_UI_PropertyDescriptor_description", "_UI_CustomDomainModelReference_bundleName_feature", //$NON-NLS-1$ //$NON-NLS-2$
83:                                         "_UI_CustomDomainModelReference_type"), //$NON-NLS-1$
84:                                 VCustomPackage.Literals.CUSTOM_DOMAIN_MODEL_REFERENCE__BUNDLE_NAME,
85:                                 true,
86:                                 false,
87:                                 false,
88:                                 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
89:                                 null,
90:                                 null));
91:         }
92:
93:         /**
94:          * This adds a property descriptor for the Class Name feature.
95:          * <!-- begin-user-doc -->
96:          * <!-- end-user-doc -->
97:          *
98:          * @generated
99:          */
100:         protected void addClassNamePropertyDescriptor(Object object) {
101:                 itemPropertyDescriptors
102:                         .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
103:                                 getResourceLocator(),
104:                                 getString("_UI_CustomDomainModelReference_className_feature"), //$NON-NLS-1$
105:                                 getString("_UI_PropertyDescriptor_description", "_UI_CustomDomainModelReference_className_feature", //$NON-NLS-1$ //$NON-NLS-2$
106:                                         "_UI_CustomDomainModelReference_type"), //$NON-NLS-1$
107:                                 VCustomPackage.Literals.CUSTOM_DOMAIN_MODEL_REFERENCE__CLASS_NAME,
108:                                 true,
109:                                 false,
110:                                 false,
111:                                 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
112:                                 null,
113:                                 null));
114:         }
115:
116:         /**
117:          * This adds a property descriptor for the Control Checked feature.
118:          * <!-- begin-user-doc -->
119:          * <!-- end-user-doc -->
120:          *
121:          * @generated
122:          */
123:         protected void addControlCheckedPropertyDescriptor(Object object) {
124:                 itemPropertyDescriptors
125:                         .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
126:                                 getResourceLocator(),
127:                                 getString("_UI_CustomDomainModelReference_controlChecked_feature"), //$NON-NLS-1$
128:                                 getString("_UI_PropertyDescriptor_description", "_UI_CustomDomainModelReference_controlChecked_feature", //$NON-NLS-1$ //$NON-NLS-2$
129:                                         "_UI_CustomDomainModelReference_type"), //$NON-NLS-1$
130:                                 VCustomPackage.Literals.CUSTOM_DOMAIN_MODEL_REFERENCE__CONTROL_CHECKED,
131:                                 true,
132:                                 false,
133:                                 false,
134:                                 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
135:                                 null,
136:                                 null));
137:         }
138:
139:         /**
140:          * This returns CustomDomainModelReference.gif.
141:          * <!-- begin-user-doc -->
142:          * <!-- end-user-doc -->
143:          *
144:          * @generated
145:          */
146:         @Override
147:         public Object getImage(Object object) {
148:                 return overlayImage(object, getResourceLocator().getImage("full/obj16/CustomDomainModelReference")); //$NON-NLS-1$
149:         }
150:
151:         /**
152:          * This returns the label text for the adapted class.
153:          * <!-- begin-user-doc -->
154:          * <!-- end-user-doc -->
155:          *
156:          * @generated
157:          */
158:         @Override
159:         public String getText(Object object) {
160:                 final String label = ((VCustomDomainModelReference) object).getBundleName();
161:•                return label == null || label.length() == 0 ? getString("_UI_CustomDomainModelReference_type") : //$NON-NLS-1$
162:                         getString("_UI_CustomDomainModelReference_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
163:         }
164:
165:         /**
166:          * This handles model notifications by calling {@link #updateChildren} to update any cached
167:          * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
168:          * <!-- begin-user-doc -->
169:          * <!-- end-user-doc -->
170:          *
171:          * @generated
172:          */
173:         @Override
174:         public void notifyChanged(Notification notification) {
175:                 updateChildren(notification);
176:
177:•                switch (notification.getFeatureID(VCustomDomainModelReference.class)) {
178:                 case VCustomPackage.CUSTOM_DOMAIN_MODEL_REFERENCE__DOMAIN_MODEL_REFERENCES:
179:                 case VCustomPackage.CUSTOM_DOMAIN_MODEL_REFERENCE__BUNDLE_NAME:
180:                 case VCustomPackage.CUSTOM_DOMAIN_MODEL_REFERENCE__CLASS_NAME:
181:                 case VCustomPackage.CUSTOM_DOMAIN_MODEL_REFERENCE__CONTROL_CHECKED:
182:                         fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
183:                         return;
184:                 }
185:                 super.notifyChanged(notification);
186:         }
187:
188:         /**
189:          * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
190:          * that can be created under this object.
191:          * <!-- begin-user-doc -->
192:          * <!-- end-user-doc -->
193:          *
194:          * @generated
195:          */
196:         @Override
197:         protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
198:                 super.collectNewChildDescriptors(newChildDescriptors, object);
199:         }
200:
201: }