EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.featuremodel.provider]

COVERAGE SUMMARY FOR SOURCE FILE [NamedElementItemProvider.java]

nameclass, %method, %block, %line, %
NamedElementItemProvider.java0%   (0/1)0%   (0/7)0%   (0/100)0%   (0/33)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class NamedElementItemProvider0%   (0/1)0%   (0/7)0%   (0/100)0%   (0/33)
NamedElementItemProvider (AdapterFactory): void 0%   (0/1)0%   (0/4)0%   (0/2)
addNamePropertyDescriptor (Object): void 0%   (0/1)0%   (0/28)0%   (0/14)
collectNewChildDescriptors (Collection, Object): void 0%   (0/1)0%   (0/5)0%   (0/2)
getPropertyDescriptors (Object): List 0%   (0/1)0%   (0/13)0%   (0/4)
getResourceLocator (): ResourceLocator 0%   (0/1)0%   (0/2)0%   (0/1)
getText (Object): String 0%   (0/1)0%   (0/26)0%   (0/4)
notifyChanged (Notification): void 0%   (0/1)0%   (0/22)0%   (0/6)

1/**
2 * <copyright>
3 * </copyright>
4 *
5 * $Id$
6 */
7package de.uka.ipd.sdq.featuremodel.provider;
8 
9 
10import java.util.Collection;
11import java.util.List;
12 
13import org.eclipse.emf.common.notify.AdapterFactory;
14import org.eclipse.emf.common.notify.Notification;
15import org.eclipse.emf.common.util.ResourceLocator;
16import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
17import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
18import org.eclipse.emf.edit.provider.IItemLabelProvider;
19import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
20import org.eclipse.emf.edit.provider.IItemPropertySource;
21import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
22import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
23import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
24import org.eclipse.emf.edit.provider.ViewerNotification;
25 
26import de.uka.ipd.sdq.featuremodel.NamedElement;
27import de.uka.ipd.sdq.featuremodel.featuremodelPackage;
28import de.uka.ipd.sdq.identifier.provider.IdentifierItemProvider;
29 
30/**
31 * This is the item provider adapter for a {@link de.uka.ipd.sdq.featuremodel.NamedElement} object.
32 * <!-- begin-user-doc -->
33 * <!-- end-user-doc -->
34 * @generated
35 */
36public class NamedElementItemProvider
37        extends IdentifierItemProvider
38        implements
39                IEditingDomainItemProvider,
40                IStructuredItemContentProvider,
41                ITreeItemContentProvider,
42                IItemLabelProvider,
43                IItemPropertySource {
44        /**
45         * This constructs an instance from a factory and a notifier.
46         * <!-- begin-user-doc -->
47         * <!-- end-user-doc -->
48         * @generated
49         */
50        public NamedElementItemProvider(AdapterFactory adapterFactory) {
51                super(adapterFactory);
52        }
53 
54        /**
55         * This returns the property descriptors for the adapted class.
56         * <!-- begin-user-doc -->
57         * <!-- end-user-doc -->
58         * @generated
59         */
60        @Override
61        public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
62                if (itemPropertyDescriptors == null) {
63                        super.getPropertyDescriptors(object);
64 
65                        addNamePropertyDescriptor(object);
66                }
67                return itemPropertyDescriptors;
68        }
69 
70        /**
71         * This adds a property descriptor for the Name feature.
72         * <!-- begin-user-doc -->
73         * <!-- end-user-doc -->
74         * @generated
75         */
76        protected void addNamePropertyDescriptor(Object object) {
77                itemPropertyDescriptors.add
78                        (createItemPropertyDescriptor
79                                (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
80                                 getResourceLocator(),
81                                 getString("_UI_NamedElement_name_feature"),
82                                 getString("_UI_PropertyDescriptor_description", "_UI_NamedElement_name_feature", "_UI_NamedElement_type"),
83                                 featuremodelPackage.Literals.NAMED_ELEMENT__NAME,
84                                 true,
85                                 false,
86                                 false,
87                                 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
88                                 null,
89                                 null));
90        }
91 
92        /**
93         * This returns the label text for the adapted class.
94         * <!-- begin-user-doc -->
95         * <!-- end-user-doc -->
96         * @generated
97         */
98        @Override
99        public String getText(Object object) {
100                String label = ((NamedElement)object).getName();
101                return label == null || label.length() == 0 ?
102                        getString("_UI_NamedElement_type") :
103                        getString("_UI_NamedElement_type") + " " + label;
104        }
105 
106        /**
107         * This handles model notifications by calling {@link #updateChildren} to update any cached
108         * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
109         * <!-- begin-user-doc -->
110         * <!-- end-user-doc -->
111         * @generated
112         */
113        @Override
114        public void notifyChanged(Notification notification) {
115                updateChildren(notification);
116 
117                switch (notification.getFeatureID(NamedElement.class)) {
118                        case featuremodelPackage.NAMED_ELEMENT__NAME:
119                                fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
120                                return;
121                }
122                super.notifyChanged(notification);
123        }
124 
125        /**
126         * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
127         * that can be created under this object.
128         * <!-- begin-user-doc -->
129         * <!-- end-user-doc -->
130         * @generated
131         */
132        @Override
133        protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
134                super.collectNewChildDescriptors(newChildDescriptors, object);
135        }
136 
137        /**
138         * Return the resource locator for this item provider's resources.
139         * <!-- begin-user-doc -->
140         * <!-- end-user-doc -->
141         * @generated
142         */
143        @Override
144        public ResourceLocator getResourceLocator() {
145                return FeaturemodelEditPlugin.INSTANCE;
146        }
147 
148}

[all classes][de.uka.ipd.sdq.featuremodel.provider]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov