Skip to content

Package: AttachmentItemProvider

AttachmentItemProvider

nameinstructionbranchcomplexitylinemethod
AttachmentItemProvider(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%
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-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.common.util.ResourceLocator;
22: import org.eclipse.emf.edit.provider.IChildCreationExtender;
23: import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
24: import org.eclipse.emf.edit.provider.IItemLabelProvider;
25: import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
26: import org.eclipse.emf.edit.provider.IItemPropertySource;
27: import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
28: import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
29: import org.eclipse.emf.edit.provider.ItemProviderAdapter;
30:
31: /**
32: * This is the item provider adapter for a {@link org.eclipse.emf.ecp.view.spi.model.VAttachment} object.
33: * <!-- begin-user-doc -->
34: *
35: * @since 1.2
36: * <!-- end-user-doc -->
37: * @generated
38: */
39: public class AttachmentItemProvider
40:         extends ItemProviderAdapter
41:         implements
42:         IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider,
43:         IItemPropertySource {
44:         /**
45:          * This constructs an instance from a factory and a notifier.
46:          * <!-- begin-user-doc -->
47:          * <!-- end-user-doc -->
48:          *
49:          * @generated
50:          */
51:         public AttachmentItemProvider(AdapterFactory adapterFactory) {
52:                 super(adapterFactory);
53:         }
54:
55:         /**
56:          * This returns the property descriptors for the adapted class.
57:          * <!-- begin-user-doc -->
58:          * <!-- end-user-doc -->
59:          *
60:          * @generated
61:          */
62:         @Override
63:         public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
64:•                if (itemPropertyDescriptors == null) {
65:                         super.getPropertyDescriptors(object);
66:
67:                 }
68:                 return itemPropertyDescriptors;
69:         }
70:
71:         /**
72:          * This returns the label text for the adapted class.
73:          * <!-- begin-user-doc -->
74:          * <!-- end-user-doc -->
75:          *
76:          * @generated
77:          */
78:         @Override
79:         public String getText(Object object) {
80:                 return getString("_UI_Attachment_type"); //$NON-NLS-1$
81:         }
82:
83:         /**
84:          * This handles model notifications by calling {@link #updateChildren} to update any cached
85:          * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
86:          * <!-- begin-user-doc -->
87:          * <!-- end-user-doc -->
88:          *
89:          * @generated
90:          */
91:         @Override
92:         public void notifyChanged(Notification notification) {
93:                 updateChildren(notification);
94:                 super.notifyChanged(notification);
95:         }
96:
97:         /**
98:          * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
99:          * that can be created under this object.
100:          * <!-- begin-user-doc -->
101:          * <!-- end-user-doc -->
102:          *
103:          * @generated
104:          */
105:         @Override
106:         protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
107:                 super.collectNewChildDescriptors(newChildDescriptors, object);
108:         }
109:
110:         /**
111:          * Return the resource locator for this item provider's resources.
112:          * <!-- begin-user-doc -->
113:          * <!-- end-user-doc -->
114:          *
115:          * @generated
116:          */
117:         @Override
118:         public ResourceLocator getResourceLocator() {
119:                 return ((IChildCreationExtender) adapterFactory).getResourceLocator();
120:         }
121:
122: }