Skip to content

Package: SpanItemProvider

SpanItemProvider

nameinstructionbranchcomplexitylinemethod
SpanItemProvider(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%
addHorizontalSpanPropertyDescriptor(Object)
M: 28 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 13 C: 0
0%
M: 1 C: 0
0%
collectNewChildDescriptors(Collection, Object)
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
getImage(Object)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
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%
getText(Object)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
notifyChanged(Notification)
M: 22 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%

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: * Eugen Neufeld - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.spi.groupedgrid.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.spi.groupedgrid.model.VGroupedGridPackage;
22: import org.eclipse.emf.ecp.view.spi.groupedgrid.model.VSpan;
23: import org.eclipse.emf.ecp.view.spi.model.provider.AttachmentItemProvider;
24: import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
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.ItemPropertyDescriptor;
32: import org.eclipse.emf.edit.provider.ViewerNotification;
33:
34: /**
35: * This is the item provider adapter for a {@link org.eclipse.emf.ecp.view.spi.groupedgrid.model.VSpan} object.
36: * <!-- begin-user-doc -->
37: * <!-- end-user-doc -->
38: *
39: * @generated
40: * @since 1.2
41: */
42: public class SpanItemProvider
43:         extends AttachmentItemProvider implements IEditingDomainItemProvider, IStructuredItemContentProvider,
44:         ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
45:         /**
46:          * This constructs an instance from a factory and a notifier.
47:          * <!-- begin-user-doc -->
48:          * <!-- end-user-doc -->
49:          *
50:          * @generated
51:          */
52:         public SpanItemProvider(AdapterFactory adapterFactory) {
53:                 super(adapterFactory);
54:         }
55:
56:         /**
57:          * This returns the property descriptors for the adapted class.
58:          * <!-- begin-user-doc -->
59:          * <!-- end-user-doc -->
60:          *
61:          * @generated
62:          */
63:         @Override
64:         public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
65:•                if (itemPropertyDescriptors == null) {
66:                         super.getPropertyDescriptors(object);
67:
68:                         addHorizontalSpanPropertyDescriptor(object);
69:                 }
70:                 return itemPropertyDescriptors;
71:         }
72:
73:         /**
74:          * This adds a property descriptor for the Horizontal Span feature.
75:          * <!-- begin-user-doc -->
76:          * <!-- end-user-doc -->
77:          *
78:          * @generated
79:          */
80:         protected void addHorizontalSpanPropertyDescriptor(Object object) {
81:                 itemPropertyDescriptors
82:                         .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
83:                                 getResourceLocator(),
84:                                 getString("_UI_Span_horizontalSpan_feature"), //$NON-NLS-1$
85:                                 getString("_UI_PropertyDescriptor_description", "_UI_Span_horizontalSpan_feature", "_UI_Span_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
86:                                 VGroupedGridPackage.Literals.SPAN__HORIZONTAL_SPAN,
87:                                 true,
88:                                 false,
89:                                 false,
90:                                 ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
91:                                 null,
92:                                 null));
93:         }
94:
95:         /**
96:          * This returns Span.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/Span")); //$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:                 final VSpan span = (VSpan) object;
117:                 return getString("_UI_Span_type") + " " + span.getHorizontalSpan(); //$NON-NLS-1$ //$NON-NLS-2$
118:         }
119:
120:         /**
121:          * This handles model notifications by calling {@link #updateChildren} to update any cached
122:          * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
123:          * <!-- begin-user-doc -->
124:          * <!-- end-user-doc -->
125:          *
126:          * @generated
127:          */
128:         @Override
129:         public void notifyChanged(Notification notification) {
130:                 updateChildren(notification);
131:
132:•                switch (notification.getFeatureID(VSpan.class)) {
133:                 case VGroupedGridPackage.SPAN__HORIZONTAL_SPAN:
134:                         fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
135:                         return;
136:                 }
137:                 super.notifyChanged(notification);
138:         }
139:
140:         /**
141:          * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
142:          * that can be created under this object.
143:          * <!-- begin-user-doc -->
144:          * <!-- end-user-doc -->
145:          *
146:          * @generated
147:          */
148:         @Override
149:         protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
150:                 super.collectNewChildDescriptors(newChildDescriptors, object);
151:         }
152:
153: }