Skip to content

Package: HierarchySelectorItemProvider

HierarchySelectorItemProvider

nameinstructionbranchcomplexitylinemethod
HierarchySelectorItemProvider(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: 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: 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.hierarchy.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.StyleSelectorContainerItemProvider;
23: import org.eclipse.emf.ecp.view.template.selector.hierarchy.model.VTHierarchyFactory;
24: import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
25:
26: /**
27: * This is the item provider adapter for a
28: * {@link org.eclipse.emf.ecp.view.template.selector.hierarchy.model.VTHierarchySelector} object.
29: * <!-- begin-user-doc -->
30: * <!-- end-user-doc -->
31: *
32: * @generated
33: */
34: public class HierarchySelectorItemProvider
35:         extends StyleSelectorContainerItemProvider {
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 HierarchySelectorItemProvider(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 returns HierarchySelector.gif.
65:          * <!-- begin-user-doc -->
66:          * <!-- end-user-doc -->
67:          *
68:          * @generated NOT
69:          */
70:         @Override
71:         public Object getImage(Object object) {
72:                 return overlayImage(object, getResourceLocator().getImage("full/obj16/HierarchySelector.png")); //$NON-NLS-1$
73:         }
74:
75:         /**
76:          * This returns the label text for the adapted class.
77:          * <!-- begin-user-doc -->
78:          * <!-- end-user-doc -->
79:          *
80:          * @generated
81:          */
82:         @Override
83:         public String getText(Object object) {
84:                 return getString("_UI_HierarchySelector_type"); //$NON-NLS-1$
85:         }
86:
87:         /**
88:          * This handles model notifications by calling {@link #updateChildren} to update any cached
89:          * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
90:          * <!-- begin-user-doc -->
91:          * <!-- end-user-doc -->
92:          *
93:          * @generated
94:          */
95:         @Override
96:         public void notifyChanged(Notification notification) {
97:                 updateChildren(notification);
98:                 super.notifyChanged(notification);
99:         }
100:
101:         /**
102:          * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
103:          * that can be created under this object.
104:          * <!-- begin-user-doc -->
105:          * <!-- end-user-doc -->
106:          *
107:          * @generated
108:          */
109:         @Override
110:         protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
111:                 super.collectNewChildDescriptors(newChildDescriptors, object);
112:
113:                 newChildDescriptors.add(createChildParameter(VTTemplatePackage.Literals.STYLE_SELECTOR_CONTAINER__SELECTOR,
114:                         VTHierarchyFactory.eINSTANCE.createHierarchySelector()));
115:         }
116:
117: }