Skip to content

Package: MappingDomainModelReferenceItemProvider

MappingDomainModelReferenceItemProvider

nameinstructionbranchcomplexitylinemethod
MappingDomainModelReferenceItemProvider(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%
addDomainModelReferencePropertyDescriptor(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%
addMappedClassPropertyDescriptor(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: 16 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
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: 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-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.mappingdmr.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.mappingdmr.model.VMappingDomainModelReference;
22: import org.eclipse.emf.ecp.view.spi.mappingdmr.model.VMappingdmrPackage;
23: import org.eclipse.emf.ecp.view.spi.model.provider.FeaturePathDomainModelReferenceItemProvider;
24: import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
25: import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
26: import org.eclipse.emf.edit.provider.ViewerNotification;
27:
28: /**
29: * This is the item provider adapter for a
30: * {@link org.eclipse.emf.ecp.view.spi.mappingdmr.model.VMappingDomainModelReference} object.
31: * <!-- begin-user-doc --> <!-- end-user-doc -->
32: *
33: * @generated
34: */
35: public class MappingDomainModelReferenceItemProvider extends
36:         FeaturePathDomainModelReferenceItemProvider {
37:         /**
38:          * This constructs an instance from a factory and a notifier. <!--
39:          * begin-user-doc --> <!-- end-user-doc -->
40:          *
41:          * @generated
42:          */
43:         public MappingDomainModelReferenceItemProvider(AdapterFactory adapterFactory) {
44:                 super(adapterFactory);
45:         }
46:
47:         /**
48:          * This returns the property descriptors for the adapted class. <!--
49:          * begin-user-doc --> <!-- end-user-doc -->
50:          *
51:          * @generated
52:          */
53:         @Override
54:         public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
55:•                if (itemPropertyDescriptors == null) {
56:                         super.getPropertyDescriptors(object);
57:
58:                         addMappedClassPropertyDescriptor(object);
59:                         addDomainModelReferencePropertyDescriptor(object);
60:                 }
61:                 return itemPropertyDescriptors;
62:         }
63:
64:         /**
65:          * This adds a property descriptor for the Mapped Class feature. <!--
66:          * begin-user-doc --> <!-- end-user-doc -->
67:          *
68:          * @generated
69:          */
70:         protected void addMappedClassPropertyDescriptor(Object object) {
71:                 itemPropertyDescriptors
72:                         .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
73:                                 getResourceLocator(),
74:                                 getString("_UI_MappingDomainModelReference_mappedClass_feature"), //$NON-NLS-1$
75:                                 getString("_UI_PropertyDescriptor_description", "_UI_MappingDomainModelReference_mappedClass_feature", //$NON-NLS-1$ //$NON-NLS-2$
76:                                         "_UI_MappingDomainModelReference_type"), //$NON-NLS-1$
77:                                 VMappingdmrPackage.Literals.MAPPING_DOMAIN_MODEL_REFERENCE__MAPPED_CLASS,
78:                                 true,
79:                                 false,
80:                                 true,
81:                                 null,
82:                                 null,
83:                                 null));
84:         }
85:
86:         /**
87:          * This adds a property descriptor for the Domain Model Reference feature.
88:          * <!-- begin-user-doc -->
89:          * <!-- end-user-doc -->
90:          *
91:          * @generated
92:          */
93:         protected void addDomainModelReferencePropertyDescriptor(Object object) {
94:                 itemPropertyDescriptors.add(createItemPropertyDescriptor(
95:                         ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
96:                         getResourceLocator(),
97:                         getString("_UI_MappingDomainModelReference_domainModelReference_feature"), //$NON-NLS-1$
98:                         getString("_UI_PropertyDescriptor_description", //$NON-NLS-1$
99:                                 "_UI_MappingDomainModelReference_domainModelReference_feature", "_UI_MappingDomainModelReference_type"), //$NON-NLS-1$ //$NON-NLS-2$
100:                         VMappingdmrPackage.Literals.MAPPING_DOMAIN_MODEL_REFERENCE__DOMAIN_MODEL_REFERENCE,
101:                         true,
102:                         false,
103:                         false,
104:                         null,
105:                         null,
106:                         null));
107:         }
108:
109:         /**
110:          * This returns MappingDomainModelReference.gif.
111:          * <!-- begin-user-doc -->
112:          * <!-- end-user-doc -->
113:          *
114:          * @generated
115:          */
116:         @Override
117:         public Object getImage(Object object) {
118:                 return overlayImage(object, getResourceLocator().getImage("full/obj16/MappingDomainModelReference")); //$NON-NLS-1$
119:         }
120:
121:         /**
122:          * This returns the label text for the adapted class.
123:          * <!-- begin-user-doc
124:          * --> <!-- end-user-doc -->
125:          *
126:          * @generated
127:          */
128:         @Override
129:         public String getText(Object object) {
130:                 return getString("_UI_MappingDomainModelReference_type"); //$NON-NLS-1$
131:         }
132:
133:         /**
134:          * This handles model notifications by calling {@link #updateChildren} to update any cached
135:          * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
136:          * <!-- begin-user-doc --> <!--
137:          * end-user-doc -->
138:          *
139:          * @generated
140:          */
141:         @Override
142:         public void notifyChanged(Notification notification) {
143:                 updateChildren(notification);
144:
145:•                switch (notification.getFeatureID(VMappingDomainModelReference.class)) {
146:                 case VMappingdmrPackage.MAPPING_DOMAIN_MODEL_REFERENCE__DOMAIN_MODEL_REFERENCE:
147:                         fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
148:                         return;
149:                 }
150:                 super.notifyChanged(notification);
151:         }
152:
153:         /**
154:          * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
155:          * describing the children that can be created under this object. <!--
156:          * begin-user-doc --> <!-- end-user-doc -->
157:          *
158:          * @generated
159:          */
160:         @Override
161:         protected void collectNewChildDescriptors(
162:                 Collection<Object> newChildDescriptors, Object object) {
163:                 super.collectNewChildDescriptors(newChildDescriptors, object);
164:         }
165:
166: }