Skip to content

Package: ContainedElementItemProvider

ContainedElementItemProvider

nameinstructionbranchcomplexitylinemethod
ContainedElementItemProvider(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: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
getPropertyDescriptors(Object)
M: 0 C: 10
100%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 0 C: 3
100%
M: 0 C: 1
100%
getText(Object)
M: 26 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 3 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-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.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.VContainedElement;
22: import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
23:
24: /**
25: * This is the item provider adapter for a {@link org.eclipse.emf.ecp.view.spi.model.VContainedElement} object.
26: * <!-- begin-user-doc -->
27: * <!-- end-user-doc -->
28: *
29: * @generated
30: */
31: public class ContainedElementItemProvider
32:         extends ElementItemProvider {
33:         /**
34:          * This constructs an instance from a factory and a notifier.
35:          * <!-- begin-user-doc -->
36:          * <!-- end-user-doc -->
37:          *
38:          * @generated
39:          */
40:         public ContainedElementItemProvider(AdapterFactory adapterFactory) {
41:                 super(adapterFactory);
42:         }
43:
44:         /**
45:          * This returns the property descriptors for the adapted class.
46:          * <!-- begin-user-doc -->
47:          * <!-- end-user-doc -->
48:          *
49:          * @generated
50:          */
51:         @Override
52:         public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
53:•                if (itemPropertyDescriptors == null) {
54:                         super.getPropertyDescriptors(object);
55:
56:                 }
57:                 return itemPropertyDescriptors;
58:         }
59:
60:         /**
61:          * This returns the label text for the adapted class.
62:          * <!-- begin-user-doc -->
63:          * <!-- end-user-doc -->
64:          *
65:          * @generated
66:          */
67:         @Override
68:         public String getText(Object object) {
69:                 final String label = ((VContainedElement) object).getName();
70:•                return label == null || label.length() == 0 ? getString("_UI_ContainedElement_type") : //$NON-NLS-1$
71:                         getString("_UI_ContainedElement_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
72:         }
73:
74:         /**
75:          * This handles model notifications by calling {@link #updateChildren} to update any cached
76:          * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
77:          * <!-- begin-user-doc -->
78:          * <!-- end-user-doc -->
79:          *
80:          * @generated
81:          */
82:         @Override
83:         public void notifyChanged(Notification notification) {
84:                 updateChildren(notification);
85:                 super.notifyChanged(notification);
86:         }
87:
88:         /**
89:          * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
90:          * that can be created under this object.
91:          * <!-- begin-user-doc -->
92:          * <!-- end-user-doc -->
93:          *
94:          * @generated
95:          */
96:         @Override
97:         protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
98:                 super.collectNewChildDescriptors(newChildDescriptors, object);
99:         }
100:
101: }