Skip to content

Package: VerticalLayoutItemProvider

VerticalLayoutItemProvider

nameinstructionbranchcomplexitylinemethod
VerticalLayoutItemProvider(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: 15 C: 19
56%
M: 4 C: 2
33%
M: 3 C: 1
25%
M: 1 C: 4
80%
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-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.vertical.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.model.VElement;
22: import org.eclipse.emf.ecp.view.spi.model.VElementUtil;
23: import org.eclipse.emf.ecp.view.spi.model.VViewPackage;
24: import org.eclipse.emf.ecp.view.spi.model.provider.ContainedContainerItemProvider;
25: import org.eclipse.emf.ecp.view.spi.vertical.model.VVerticalFactory;
26: import org.eclipse.emf.ecp.view.spi.vertical.model.VVerticalLayout;
27: import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
28:
29: /**
30: * This is the item provider adapter for a {@link org.eclipse.emf.ecp.view.spi.vertical.model.VVerticalLayout} object.
31: * <!-- begin-user-doc -->
32: *
33: * @since 1.2
34: * <!-- end-user-doc -->
35: *
36: * @generated
37: */
38: public class VerticalLayoutItemProvider
39:         extends ContainedContainerItemProvider
40:
41: {
42:         /**
43:          * This constructs an instance from a factory and a notifier.
44:          * <!-- begin-user-doc -->
45:          * <!-- end-user-doc -->
46:          *
47:          * @generated
48:          */
49:         public VerticalLayoutItemProvider(AdapterFactory adapterFactory) {
50:                 super(adapterFactory);
51:         }
52:
53:         /**
54:          * This returns the property descriptors for the adapted class.
55:          * <!-- begin-user-doc -->
56:          * <!-- end-user-doc -->
57:          *
58:          * @generated
59:          */
60:         @Override
61:         public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
62:•                if (itemPropertyDescriptors == null) {
63:                         super.getPropertyDescriptors(object);
64:
65:                 }
66:                 return itemPropertyDescriptors;
67:         }
68:
69:         /**
70:          * This returns VerticalLayout.gif.
71:          * <!-- begin-user-doc -->
72:          * <!-- end-user-doc -->
73:          *
74:          * @generated
75:          */
76:         @Override
77:         public Object getImage(Object object) {
78:                 return overlayImage(object, getResourceLocator().getImage("full/obj16/VerticalLayout")); //$NON-NLS-1$
79:         }
80:
81:         /**
82:          * This returns the label text for the adapted class.
83:          * <!-- begin-user-doc -->
84:          * <!-- end-user-doc -->
85:          *
86:          * @generated NOT
87:          */
88:         @Override
89:         public String getText(Object object) {
90:                 String label = ((VVerticalLayout) object).getName();
91:•                if (label == null) {
92:                         label = VElementUtil.getCleanName(VElement.class.cast(object));
93:                 }
94:•                return label == null || label.length() == 0 ? getString("_UI_VerticalLayout_type") : //$NON-NLS-1$
95:                         getString("_UI_VerticalLayout_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
96:         }
97:
98:         /**
99:          * This handles model notifications by calling {@link #updateChildren} to update any cached
100:          * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
101:          * <!-- begin-user-doc -->
102:          * <!-- end-user-doc -->
103:          *
104:          * @generated
105:          */
106:         @Override
107:         public void notifyChanged(Notification notification) {
108:                 updateChildren(notification);
109:                 super.notifyChanged(notification);
110:         }
111:
112:         /**
113:          * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
114:          * that can be created under this object.
115:          * <!-- begin-user-doc -->
116:          * <!-- end-user-doc -->
117:          *
118:          * @generated
119:          */
120:         @Override
121:         protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
122:                 super.collectNewChildDescriptors(newChildDescriptors, object);
123:
124:                 newChildDescriptors.add(createChildParameter(VViewPackage.Literals.CONTAINER__CHILDREN,
125:                         VVerticalFactory.eINSTANCE.createVerticalLayout()));
126:         }
127:
128: }