Skip to content

Package: AndSelectorItemProvider

AndSelectorItemProvider

nameinstructionbranchcomplexitylinemethod
AndSelectorItemProvider(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: 13
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 5
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: 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: 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: 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-2018 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: * Johannes Faltermeier - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.template.selector.bool.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.template.model.VTTemplatePackage;
22: import org.eclipse.emf.ecp.view.template.model.provider.MultiStyleSelectorContainerItemProvider;
23: import org.eclipse.emf.ecp.view.template.selector.bool.model.VTBoolFactory;
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.template.selector.bool.model.VTAndSelector}
28: * object.
29: * <!-- begin-user-doc -->
30: * <!-- end-user-doc -->
31: *
32: * @generated
33: */
34: public class AndSelectorItemProvider extends MultiStyleSelectorContainerItemProvider {
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 AndSelectorItemProvider(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:                 }
59:                 return itemPropertyDescriptors;
60:         }
61:
62:         /**
63:          * This returns AndSelector.gif.
64:          * <!-- begin-user-doc -->
65:          * <!-- end-user-doc -->
66:          *
67:          * @generated
68:          */
69:         @Override
70:         public Object getImage(Object object) {
71:                 return overlayImage(object, getResourceLocator().getImage("full/obj16/AndSelector")); //$NON-NLS-1$
72:         }
73:
74:         /**
75:          * This returns the label text for the adapted class.
76:          * <!-- begin-user-doc -->
77:          * <!-- end-user-doc -->
78:          *
79:          * @generated
80:          */
81:         @Override
82:         public String getText(Object object) {
83:                 return getString("_UI_AndSelector_type"); //$NON-NLS-1$
84:         }
85:
86:         /**
87:          * This handles model notifications by calling {@link #updateChildren} to update any cached
88:          * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
89:          * <!-- begin-user-doc -->
90:          * <!-- end-user-doc -->
91:          *
92:          * @generated
93:          */
94:         @Override
95:         public void notifyChanged(Notification notification) {
96:                 updateChildren(notification);
97:                 super.notifyChanged(notification);
98:         }
99:
100:         /**
101:          * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
102:          * that can be created under this object.
103:          * <!-- begin-user-doc -->
104:          * <!-- end-user-doc -->
105:          *
106:          * @generated
107:          */
108:         @Override
109:         protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
110:                 super.collectNewChildDescriptors(newChildDescriptors, object);
111:
112:                 newChildDescriptors
113:                         .add(createChildParameter(VTTemplatePackage.Literals.MULTI_STYLE_SELECTOR_CONTAINER__SELECTORS,
114:                                 VTBoolFactory.eINSTANCE.createAndSelector()));
115:         }
116:
117: }