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 [SimpleItemProvider.java]

nameclass, %method, %block, %line, %
SimpleItemProvider.java0%   (0/1)0%   (0/9)0%   (0/141)0%   (0/39)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class SimpleItemProvider0%   (0/1)0%   (0/9)0%   (0/141)0%   (0/39)
SimpleItemProvider (AdapterFactory): void 0%   (0/1)0%   (0/4)0%   (0/2)
collectNewChildDescriptors (Collection, Object): void 0%   (0/1)0%   (0/21)0%   (0/10)
getChildFeature (Object, Object): EStructuralFeature 0%   (0/1)0%   (0/5)0%   (0/1)
getChildrenFeatures (Object): Collection 0%   (0/1)0%   (0/20)0%   (0/5)
getCreateChildText (Object, Object, Object, Collection): String 0%   (0/1)0%   (0/47)0%   (0/10)
getImage (Object): Object 0%   (0/1)0%   (0/8)0%   (0/1)
getPropertyDescriptors (Object): List 0%   (0/1)0%   (0/10)0%   (0/3)
getText (Object): String 0%   (0/1)0%   (0/4)0%   (0/1)
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.ecore.EStructuralFeature;
16import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
17import org.eclipse.emf.edit.provider.IItemLabelProvider;
18import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
19import org.eclipse.emf.edit.provider.IItemPropertySource;
20import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
21import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
22import org.eclipse.emf.edit.provider.ViewerNotification;
23 
24import de.uka.ipd.sdq.featuremodel.Simple;
25import de.uka.ipd.sdq.featuremodel.featuremodelFactory;
26import de.uka.ipd.sdq.featuremodel.featuremodelPackage;
27 
28/**
29 * This is the item provider adapter for a {@link de.uka.ipd.sdq.featuremodel.Simple} object.
30 * <!-- begin-user-doc -->
31 * <!-- end-user-doc -->
32 * @generated
33 */
34public class SimpleItemProvider
35        extends ChildRelationItemProvider
36        implements
37                IEditingDomainItemProvider,
38                IStructuredItemContentProvider,
39                ITreeItemContentProvider,
40                IItemLabelProvider,
41                IItemPropertySource {
42        /**
43         * This constructs an instance from a factory and a notifier.
44         * <!-- begin-user-doc -->
45         * <!-- end-user-doc -->
46         * @generated
47         */
48        public SimpleItemProvider(AdapterFactory adapterFactory) {
49                super(adapterFactory);
50        }
51 
52        /**
53         * This returns the property descriptors for the adapted class.
54         * <!-- begin-user-doc -->
55         * <!-- end-user-doc -->
56         * @generated
57         */
58        @Override
59        public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
60                if (itemPropertyDescriptors == null) {
61                        super.getPropertyDescriptors(object);
62 
63                }
64                return itemPropertyDescriptors;
65        }
66 
67        /**
68         * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
69         * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
70         * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
71         * <!-- begin-user-doc -->
72         * <!-- end-user-doc -->
73         * @generated
74         */
75        @Override
76        public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
77                if (childrenFeatures == null) {
78                        super.getChildrenFeatures(object);
79                        childrenFeatures.add(featuremodelPackage.Literals.SIMPLE__OPTIONAL_CHILDREN);
80                        childrenFeatures.add(featuremodelPackage.Literals.SIMPLE__MANDATORY_CHILDREN);
81                }
82                return childrenFeatures;
83        }
84 
85        /**
86         * <!-- begin-user-doc -->
87         * <!-- end-user-doc -->
88         * @generated
89         */
90        @Override
91        protected EStructuralFeature getChildFeature(Object object, Object child) {
92                // Check the type of the specified child object and return the proper feature to use for
93                // adding (see {@link AddCommand}) it as a child.
94 
95                return super.getChildFeature(object, child);
96        }
97 
98        /**
99         * This returns Simple.gif.
100         * <!-- begin-user-doc -->
101         * <!-- end-user-doc -->
102         * @generated
103         */
104        @Override
105        public Object getImage(Object object) {
106                return overlayImage(object, getResourceLocator().getImage("full/obj16/Simple"));
107        }
108 
109        /**
110         * This returns the label text for the adapted class.
111         * <!-- begin-user-doc -->
112         * <!-- end-user-doc -->
113         * @generated
114         */
115        @Override
116        public String getText(Object object) {
117                return getString("_UI_Simple_type");
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         * @generated
126         */
127        @Override
128        public void notifyChanged(Notification notification) {
129                updateChildren(notification);
130 
131                switch (notification.getFeatureID(Simple.class)) {
132                        case featuremodelPackage.SIMPLE__OPTIONAL_CHILDREN:
133                        case featuremodelPackage.SIMPLE__MANDATORY_CHILDREN:
134                                fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
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         * @generated
146         */
147        @Override
148        protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
149                super.collectNewChildDescriptors(newChildDescriptors, object);
150 
151                newChildDescriptors.add
152                        (createChildParameter
153                                (featuremodelPackage.Literals.SIMPLE__OPTIONAL_CHILDREN,
154                                 featuremodelFactory.eINSTANCE.createFeature()));
155 
156                newChildDescriptors.add
157                        (createChildParameter
158                                (featuremodelPackage.Literals.SIMPLE__MANDATORY_CHILDREN,
159                                 featuremodelFactory.eINSTANCE.createFeature()));
160        }
161 
162        /**
163         * This returns the label text for {@link org.eclipse.emf.edit.command.CreateChildCommand}.
164         * <!-- begin-user-doc -->
165         * <!-- end-user-doc -->
166         * @generated
167         */
168        @Override
169        public String getCreateChildText(Object owner, Object feature, Object child, Collection<?> selection) {
170                Object childFeature = feature;
171                Object childObject = child;
172 
173                boolean qualify =
174                        childFeature == featuremodelPackage.Literals.SIMPLE__OPTIONAL_CHILDREN ||
175                        childFeature == featuremodelPackage.Literals.SIMPLE__MANDATORY_CHILDREN;
176 
177                if (qualify) {
178                        return getString
179                                ("_UI_CreateChild_text2",
180                                 new Object[] { getTypeText(childObject), getFeatureText(childFeature), getTypeText(owner) });
181                }
182                return super.getCreateChildText(owner, feature, child, selection);
183        }
184 
185}

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