Skip to content

Package: OrConditionItemProvider

OrConditionItemProvider

nameinstructionbranchcomplexitylinemethod
OrConditionItemProvider(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: 0 C: 69
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 18
100%
M: 0 C: 1
100%
getChildFeature(Object, Object)
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getChildrenFeatures(Object)
M: 0 C: 15
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
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: 10
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
getText(Object)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
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-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: * EclipseSource Munich GmbH - 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.OrCondition;
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.OrCondition} object.
30: * <!-- begin-user-doc -->
31: *
32: * @since 1.2
33: * <!-- end-user-doc -->
34: * @generated
35: */
36: public class OrConditionItemProvider extends ConditionItemProvider {
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 OrConditionItemProvider(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:                 }
61:                 return itemPropertyDescriptors;
62:         }
63:
64:         /**
65:          * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
66:          * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
67:          * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
68:          * <!-- begin-user-doc -->
69:          * <!-- end-user-doc -->
70:          *
71:          * @generated
72:          */
73:         @Override
74:         public Collection<? extends EStructuralFeature> getChildrenFeatures(
75:                 Object object) {
76:•                if (childrenFeatures == null) {
77:                         super.getChildrenFeatures(object);
78:                         childrenFeatures.add(RulePackage.Literals.OR_CONDITION__CONDITIONS);
79:                 }
80:                 return childrenFeatures;
81:         }
82:
83:         /**
84:          * <!-- begin-user-doc -->
85:          * <!-- end-user-doc -->
86:          *
87:          * @generated
88:          */
89:         @Override
90:         protected EStructuralFeature getChildFeature(Object object, Object child) {
91:                 // Check the type of the specified child object and return the proper feature to use for
92:                 // adding (see {@link AddCommand}) it as a child.
93:
94:                 return super.getChildFeature(object, child);
95:         }
96:
97:         /**
98:          * This returns OrCondition.gif.
99:          * <!-- begin-user-doc -->
100:          * <!-- end-user-doc -->
101:          *
102:          * @generated
103:          */
104:         @Override
105:         public Object getImage(Object object) {
106:                 return overlayImage(object, getResourceLocator().getImage("full/obj16/OrCondition")); //$NON-NLS-1$
107:         }
108:
109:         /**
110:          * This returns the label text for the adapted class.
111:          * <!-- begin-user-doc -->
112:          * <!-- end-user-doc -->
113:          *
114:          * @generated
115:          */
116:         @Override
117:         public String getText(Object object) {
118:                 return getString("_UI_OrCondition_type"); //$NON-NLS-1$
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:
133:•                switch (notification.getFeatureID(OrCondition.class)) {
134:                 case RulePackage.OR_CONDITION__CONDITIONS:
135:                         fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
136:                         return;
137:                 }
138:                 super.notifyChanged(notification);
139:         }
140:
141:         /**
142:          * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
143:          * that can be created under this object.
144:          * <!-- begin-user-doc -->
145:          * <!-- end-user-doc -->
146:          *
147:          * @generated
148:          */
149:         @Override
150:         protected void collectNewChildDescriptors(
151:                 Collection<Object> newChildDescriptors, Object object) {
152:                 super.collectNewChildDescriptors(newChildDescriptors, object);
153:
154:                 newChildDescriptors.add(createChildParameter(RulePackage.Literals.OR_CONDITION__CONDITIONS,
155:                         RuleFactory.eINSTANCE.createLeafCondition()));
156:
157:                 newChildDescriptors.add(createChildParameter(RulePackage.Literals.OR_CONDITION__CONDITIONS,
158:                         RuleFactory.eINSTANCE.createOrCondition()));
159:
160:                 newChildDescriptors.add(createChildParameter(RulePackage.Literals.OR_CONDITION__CONDITIONS,
161:                         RuleFactory.eINSTANCE.createAndCondition()));
162:
163:                 newChildDescriptors.add(createChildParameter(RulePackage.Literals.OR_CONDITION__CONDITIONS,
164:                         RuleFactory.eINSTANCE.createIterateCondition()));
165:
166:                 newChildDescriptors.add(createChildParameter(RulePackage.Literals.OR_CONDITION__CONDITIONS,
167:                         RuleFactory.eINSTANCE.createTrue()));
168:
169:                 newChildDescriptors.add(createChildParameter(RulePackage.Literals.OR_CONDITION__CONDITIONS,
170:                         RuleFactory.eINSTANCE.createFalse()));
171:
172:                 newChildDescriptors.add(createChildParameter(RulePackage.Literals.OR_CONDITION__CONDITIONS,
173:                         RuleFactory.eINSTANCE.createNotCondition()));
174:
175:                 newChildDescriptors.add(createChildParameter(RulePackage.Literals.OR_CONDITION__CONDITIONS,
176:                         RuleFactory.eINSTANCE.createIsProxyCondition()));
177:         }
178:
179: }