Skip to content

Package: FeaturePathDomainModelReferenceItemProvider

FeaturePathDomainModelReferenceItemProvider

nameinstructionbranchcomplexitylinemethod
FeaturePathDomainModelReferenceItemProvider(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%
addDomainModelEFeaturePropertyDescriptor(Object)
M: 0 C: 28
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 15
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: 13
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
getText(Object)
M: 0 C: 16
100%
M: 1 C: 3
75%
M: 1 C: 2
67%
M: 0 C: 4
100%
M: 0 C: 1
100%
notifyChanged(Notification)
M: 0 C: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (c) 2011-2013 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.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.model.VFeaturePathDomainModelReference;
22: import org.eclipse.emf.ecp.view.spi.model.VViewPackage;
23: import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
24: import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
25:
26: /**
27: * This is the item provider adapter for a {@link org.eclipse.emf.ecp.view.spi.model.VFeaturePathDomainModelReference}
28: * object.
29: * <!-- begin-user-doc -->
30: *
31: * @since 1.2
32: * <!-- end-user-doc -->
33: * @generated
34: */
35: public class FeaturePathDomainModelReferenceItemProvider
36:         extends DomainModelReferenceItemProvider {
37:         /**
38:          * This constructs an instance from a factory and a notifier.
39:          * <!-- begin-user-doc -->
40:          * <!-- end-user-doc -->
41:          *
42:          * @generated
43:          */
44:         public FeaturePathDomainModelReferenceItemProvider(AdapterFactory adapterFactory) {
45:                 super(adapterFactory);
46:         }
47:
48:         /**
49:          * This returns the property descriptors for the adapted class.
50:          * <!-- begin-user-doc -->
51:          * <!-- end-user-doc -->
52:          *
53:          * @generated
54:          */
55:         @Override
56:         public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
57:•                if (itemPropertyDescriptors == null) {
58:                         super.getPropertyDescriptors(object);
59:
60:                         addDomainModelEFeaturePropertyDescriptor(object);
61:                 }
62:                 return itemPropertyDescriptors;
63:         }
64:
65:         /**
66:          * This adds a property descriptor for the Domain Model EFeature feature.
67:          * <!-- begin-user-doc -->
68:          * <!-- end-user-doc -->
69:          *
70:          * @generated
71:          */
72:         protected void addDomainModelEFeaturePropertyDescriptor(Object object) {
73:                 itemPropertyDescriptors
74:                         .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
75:                                 getResourceLocator(),
76:                                 getString("_UI_FeaturePathDomainModelReference_domainModelEFeature_feature"), //$NON-NLS-1$
77:                                 getString("_UI_PropertyDescriptor_description", //$NON-NLS-1$
78:                                         "_UI_FeaturePathDomainModelReference_domainModelEFeature_feature", //$NON-NLS-1$
79:                                         "_UI_FeaturePathDomainModelReference_type"), //$NON-NLS-1$
80:                                 VViewPackage.Literals.FEATURE_PATH_DOMAIN_MODEL_REFERENCE__DOMAIN_MODEL_EFEATURE,
81:                                 true,
82:                                 false,
83:                                 true,
84:                                 null,
85:                                 null,
86:                                 null));
87:         }
88:
89:         /**
90:          * This returns FeaturePathDomainModelReference.gif.
91:          * <!-- begin-user-doc -->
92:          * <!-- end-user-doc -->
93:          *
94:          * @generated
95:          */
96:         @Override
97:         public Object getImage(Object object) {
98:                 return overlayImage(object, getResourceLocator().getImage("full/obj16/FeaturePathDomainModelReference")); //$NON-NLS-1$
99:         }
100:
101:         /**
102:          * This returns the label text for the adapted class.
103:          *
104:          * @param object the object instance for which the label is fetched
105:          *
106:          * @return the label
107:          * <!-- begin-user-doc -->
108:          * <!-- end-user-doc -->
109:          *
110:          * @generated NOT
111:          */
112:         @Override
113:         public String getText(Object object) {
114:                 final VFeaturePathDomainModelReference dmr = (VFeaturePathDomainModelReference) object;
115:•                if (dmr == null || dmr.getDomainModelEFeature() == null) {
116:                         return getString("_UI_FeaturePathDomainModelReference_type"); //$NON-NLS-1$
117:                 }
118:                 return dmr.getDomainModelEFeature().getName();
119:         }
120:
121:         /**
122:          * This handles model notifications by calling {@link #updateChildren} to update any cached
123:          * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
124:          * <!-- begin-user-doc -->
125:          * <!-- end-user-doc -->
126:          *
127:          * @generated
128:          */
129:         @Override
130:         public void notifyChanged(Notification notification) {
131:                 updateChildren(notification);
132:                 super.notifyChanged(notification);
133:         }
134:
135:         /**
136:          * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
137:          * that can be created under this object.
138:          * <!-- begin-user-doc -->
139:          * <!-- end-user-doc -->
140:          *
141:          * @generated
142:          */
143:         @Override
144:         protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
145:                 super.collectNewChildDescriptors(newChildDescriptors, object);
146:         }
147:
148: }