Skip to content

Package: NotConditionItemProvider

NotConditionItemProvider

nameinstructionbranchcomplexitylinemethod
NotConditionItemProvider(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%
collectNewChildDescriptors(Collection, Object)
M: 69 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 18 C: 0
0%
M: 1 C: 0
0%
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: 15 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 4 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: 10 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 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) 2017 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.ecore.EStructuralFeature;
22: import org.eclipse.emf.ecp.view.spi.rule.model.NotCondition;
23: import org.eclipse.emf.ecp.view.spi.rule.model.RuleFactory;
24: import org.eclipse.emf.ecp.view.spi.rule.model.RulePackage;
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 {@link org.eclipse.emf.ecp.view.spi.rule.model.NotCondition} object.
30: * <!-- begin-user-doc -->
31: * <!-- end-user-doc -->
32: *
33: * @generated
34: */
35: public class NotConditionItemProvider extends ConditionItemProvider {
36:         /**
37:          * This constructs an instance from a factory and a notifier.
38:          * <!-- begin-user-doc -->
39:          * <!-- end-user-doc -->
40:          *
41:          * @generated
42:          */
43:         public NotConditionItemProvider(AdapterFactory adapterFactory) {
44:                 super(adapterFactory);
45:         }
46:
47:         /**
48:          * This returns the property descriptors for the adapted class.
49:          * <!-- begin-user-doc -->
50:          * <!-- end-user-doc -->
51:          *
52:          * @generated
53:          */
54:         @Override
55:         public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
56:•                if (itemPropertyDescriptors == null) {
57:                         super.getPropertyDescriptors(object);
58:
59:                 }
60:                 return itemPropertyDescriptors;
61:         }
62:
63:         /**
64:          * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
65:          * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
66:          * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
67:          * <!-- begin-user-doc -->
68:          * <!-- end-user-doc -->
69:          *
70:          * @generated
71:          */
72:         @Override
73:         public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
74:•                if (childrenFeatures == null) {
75:                         super.getChildrenFeatures(object);
76:                         childrenFeatures.add(RulePackage.Literals.NOT_CONDITION__CONDITION);
77:                 }
78:                 return childrenFeatures;
79:         }
80:
81:         /**
82:          * <!-- begin-user-doc -->
83:          * <!-- end-user-doc -->
84:          *
85:          * @generated
86:          */
87:         @Override
88:         protected EStructuralFeature getChildFeature(Object object, Object child) {
89:                 // Check the type of the specified child object and return the proper feature to use for
90:                 // adding (see {@link AddCommand}) it as a child.
91:
92:                 return super.getChildFeature(object, child);
93:         }
94:
95:         /**
96:          * This returns NotCondition.gif.
97:          * <!-- begin-user-doc -->
98:          * <!-- end-user-doc -->
99:          *
100:          * @generated
101:          */
102:         @Override
103:         public Object getImage(Object object) {
104:                 return overlayImage(object, getResourceLocator().getImage("full/obj16/NotCondition")); //$NON-NLS-1$
105:         }
106:
107:         /**
108:          * This returns the label text for the adapted class.
109:          * <!-- begin-user-doc -->
110:          * <!-- end-user-doc -->
111:          *
112:          * @generated
113:          */
114:         @Override
115:         public String getText(Object object) {
116:                 return getString("_UI_NotCondition_type"); //$NON-NLS-1$
117:         }
118:
119:         /**
120:          * This handles model notifications by calling {@link #updateChildren} to update any cached
121:          * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
122:          * <!-- begin-user-doc -->
123:          * <!-- end-user-doc -->
124:          *
125:          * @generated
126:          */
127:         @Override
128:         public void notifyChanged(Notification notification) {
129:                 updateChildren(notification);
130:
131:•                switch (notification.getFeatureID(NotCondition.class)) {
132:                 case RulePackage.NOT_CONDITION__CONDITION:
133:                         fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
134:                         return;
135:                 }
136:                 super.notifyChanged(notification);
137:         }
138:
139:         /**
140:          * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
141:          * that can be created under this object.
142:          * <!-- begin-user-doc -->
143:          * <!-- end-user-doc -->
144:          *
145:          * @generated
146:          */
147:         @Override
148:         protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
149:                 super.collectNewChildDescriptors(newChildDescriptors, object);
150:
151:                 newChildDescriptors.add(createChildParameter(RulePackage.Literals.NOT_CONDITION__CONDITION,
152:                         RuleFactory.eINSTANCE.createLeafCondition()));
153:
154:                 newChildDescriptors.add(createChildParameter(RulePackage.Literals.NOT_CONDITION__CONDITION,
155:                         RuleFactory.eINSTANCE.createOrCondition()));
156:
157:                 newChildDescriptors.add(createChildParameter(RulePackage.Literals.NOT_CONDITION__CONDITION,
158:                         RuleFactory.eINSTANCE.createAndCondition()));
159:
160:                 newChildDescriptors.add(createChildParameter(RulePackage.Literals.NOT_CONDITION__CONDITION,
161:                         RuleFactory.eINSTANCE.createIterateCondition()));
162:
163:                 newChildDescriptors.add(createChildParameter(RulePackage.Literals.NOT_CONDITION__CONDITION,
164:                         RuleFactory.eINSTANCE.createTrue()));
165:
166:                 newChildDescriptors.add(createChildParameter(RulePackage.Literals.NOT_CONDITION__CONDITION,
167:                         RuleFactory.eINSTANCE.createFalse()));
168:
169:                 newChildDescriptors.add(createChildParameter(RulePackage.Literals.NOT_CONDITION__CONDITION,
170:                         RuleFactory.eINSTANCE.createNotCondition()));
171:
172:                 newChildDescriptors.add(createChildParameter(RulePackage.Literals.NOT_CONDITION__CONDITION,
173:                         RuleFactory.eINSTANCE.createIsProxyCondition()));
174:         }
175:
176: }