Skip to content

Package: KeyBindingsItemProvider

KeyBindingsItemProvider

nameinstructionbranchcomplexitylinemethod
KeyBindingsItemProvider(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%
addBindingsPropertyDescriptor(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%
getResourceLocator()
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%
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: 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.style.keybinding.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.common.util.ResourceLocator;
22: import org.eclipse.emf.ecp.view.template.style.keybinding.model.VTKeybindingPackage;
23: import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
24: import org.eclipse.emf.edit.provider.IChildCreationExtender;
25: import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
26: import org.eclipse.emf.edit.provider.IItemLabelProvider;
27: import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
28: import org.eclipse.emf.edit.provider.IItemPropertySource;
29: import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
30: import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
31: import org.eclipse.emf.edit.provider.ItemProviderAdapter;
32:
33: /**
34: * This is the item provider adapter for a
35: * {@link org.eclipse.emf.ecp.view.template.style.keybinding.model.VTKeyBindings} object.
36: * <!-- begin-user-doc -->
37: *
38: * @since 1.18
39: * <!-- end-user-doc -->
40: * @generated
41: */
42: public class KeyBindingsItemProvider
43:         extends ItemProviderAdapter
44:         implements
45:         IEditingDomainItemProvider,
46:         IStructuredItemContentProvider,
47:         ITreeItemContentProvider,
48:         IItemLabelProvider,
49:         IItemPropertySource {
50:         /**
51:          * This constructs an instance from a factory and a notifier.
52:          * <!-- begin-user-doc -->
53:          * <!-- end-user-doc -->
54:          *
55:          * @generated
56:          */
57:         public KeyBindingsItemProvider(AdapterFactory adapterFactory) {
58:                 super(adapterFactory);
59:         }
60:
61:         /**
62:          * This returns the property descriptors for the adapted class.
63:          * <!-- begin-user-doc -->
64:          * <!-- end-user-doc -->
65:          *
66:          * @generated
67:          */
68:         @Override
69:         public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
70:•                if (itemPropertyDescriptors == null) {
71:                         super.getPropertyDescriptors(object);
72:
73:                         addBindingsPropertyDescriptor(object);
74:                 }
75:                 return itemPropertyDescriptors;
76:         }
77:
78:         /**
79:          * This adds a property descriptor for the Bindings feature.
80:          * <!-- begin-user-doc -->
81:          * <!-- end-user-doc -->
82:          *
83:          * @generated
84:          */
85:         protected void addBindingsPropertyDescriptor(Object object) {
86:                 itemPropertyDescriptors
87:                         .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
88:                                 getResourceLocator(),
89:                                 getString("_UI_KeyBindings_bindings_feature"), //$NON-NLS-1$
90:                                 getString("_UI_PropertyDescriptor_description", "_UI_KeyBindings_bindings_feature", //$NON-NLS-1$ //$NON-NLS-2$
91:                                         "_UI_KeyBindings_type"), //$NON-NLS-1$
92:                                 VTKeybindingPackage.Literals.KEY_BINDINGS__BINDINGS,
93:                                 true,
94:                                 false,
95:                                 true,
96:                                 null,
97:                                 null,
98:                                 null));
99:         }
100:
101:         /**
102:          * This returns KeyBindings.gif.
103:          * <!-- begin-user-doc -->
104:          * <!-- end-user-doc -->
105:          *
106:          * @generated NOT
107:          */
108:         @Override
109:         public Object getImage(Object object) {
110:                 return overlayImage(object, getResourceLocator().getImage("full/obj16/KeyBindings.png")); //$NON-NLS-1$
111:         }
112:
113:         /**
114:          * This returns the label text for the adapted class.
115:          * <!-- begin-user-doc -->
116:          * <!-- end-user-doc -->
117:          *
118:          * @generated
119:          */
120:         @Override
121:         public String getText(Object object) {
122:                 return getString("_UI_KeyBindings_type"); //$NON-NLS-1$
123:         }
124:
125:         /**
126:          * This handles model notifications by calling {@link #updateChildren} to update any cached
127:          * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
128:          * <!-- begin-user-doc -->
129:          * <!-- end-user-doc -->
130:          *
131:          * @generated
132:          */
133:         @Override
134:         public void notifyChanged(Notification notification) {
135:                 updateChildren(notification);
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:
152:         /**
153:          * Return the resource locator for this item provider's resources.
154:          * <!-- begin-user-doc -->
155:          * <!-- end-user-doc -->
156:          *
157:          * @generated
158:          */
159:         @Override
160:         public ResourceLocator getResourceLocator() {
161:                 return ((IChildCreationExtender) adapterFactory).getResourceLocator();
162:         }
163:
164: }