Skip to content

Package: IsProxyConditionItemProvider

IsProxyConditionItemProvider

nameinstructionbranchcomplexitylinemethod
IsProxyConditionItemProvider(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%
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%
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: 13 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 4 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: 11 C: 11
50%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 2 C: 4
67%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (c) 2018 Christian W. Damus 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: * Christian W. Damus - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.spi.rule.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.rule.model.IsProxyCondition;
22: import org.eclipse.emf.ecp.view.spi.rule.model.RulePackage;
23: import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
24: import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
25: import org.eclipse.emf.edit.provider.ViewerNotification;
26:
27: /**
28: * This is the item provider adapter for a {@link org.eclipse.emf.ecp.view.spi.rule.model.IsProxyCondition} object.
29: * <!-- begin-user-doc -->
30: * <!-- end-user-doc -->
31: *
32: * @generated
33: */
34: public class IsProxyConditionItemProvider extends ConditionItemProvider {
35:         /**
36:          * This constructs an instance from a factory and a notifier.
37:          * <!-- begin-user-doc -->
38:          * <!-- end-user-doc -->
39:          *
40:          * @generated
41:          */
42:         public IsProxyConditionItemProvider(AdapterFactory adapterFactory) {
43:                 super(adapterFactory);
44:         }
45:
46:         /**
47:          * This returns the property descriptors for the adapted class.
48:          * <!-- begin-user-doc -->
49:          * <!-- 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:                         addDomainModelReferencePropertyDescriptor(object);
59:                 }
60:                 return itemPropertyDescriptors;
61:         }
62:
63:         /**
64:          * This adds a property descriptor for the Domain Model Reference feature.
65:          * <!-- begin-user-doc -->
66:          *
67:          * @since 1.21
68:          * <!-- end-user-doc -->
69:          * @generated
70:          */
71:         protected void addDomainModelReferencePropertyDescriptor(Object object) {
72:                 itemPropertyDescriptors
73:                         .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
74:                                 getResourceLocator(),
75:                                 getString("_UI_IsProxyCondition_domainModelReference_feature"), //$NON-NLS-1$
76:                                 getString("_UI_PropertyDescriptor_description", "_UI_IsProxyCondition_domainModelReference_feature", //$NON-NLS-1$ //$NON-NLS-2$
77:                                         "_UI_IsProxyCondition_type"), //$NON-NLS-1$
78:                                 RulePackage.Literals.IS_PROXY_CONDITION__DOMAIN_MODEL_REFERENCE,
79:                                 true,
80:                                 false,
81:                                 false,
82:                                 null,
83:                                 null,
84:                                 null));
85:         }
86:
87:         /**
88:          * This returns IsProxyCondition.gif.
89:          * <!-- begin-user-doc -->
90:          * <!-- end-user-doc -->
91:          *
92:          * @generated
93:          */
94:         @Override
95:         public Object getImage(Object object) {
96:                 return overlayImage(object, getResourceLocator().getImage("full/obj16/IsProxyCondition")); //$NON-NLS-1$
97:         }
98:
99:         /**
100:          * This returns the label text for the adapted class.
101:          * <!-- begin-user-doc -->
102:          * <!-- end-user-doc -->
103:          *
104:          * @generated
105:          */
106:         @Override
107:         public String getText(Object object) {
108:                 return getString("_UI_IsProxyCondition_type"); //$NON-NLS-1$
109:         }
110:
111:         /**
112:          * This handles model notifications by calling {@link #updateChildren} to update any cached
113:          * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
114:          * <!-- begin-user-doc -->
115:          * <!-- end-user-doc -->
116:          *
117:          * @generated
118:          */
119:         @Override
120:         public void notifyChanged(Notification notification) {
121:                 updateChildren(notification);
122:
123:•                switch (notification.getFeatureID(IsProxyCondition.class)) {
124:                 case RulePackage.IS_PROXY_CONDITION__DOMAIN_MODEL_REFERENCE:
125:                         fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
126:                         return;
127:                 }
128:                 super.notifyChanged(notification);
129:         }
130:
131:         /**
132:          * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
133:          * that can be created under this object.
134:          * <!-- begin-user-doc -->
135:          * <!-- end-user-doc -->
136:          *
137:          * @generated
138:          */
139:         @Override
140:         protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
141:                 super.collectNewChildDescriptors(newChildDescriptors, object);
142:         }
143:
144: }