EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.fzi.se.quality.parameters.provider]

COVERAGE SUMMARY FOR SOURCE FILE [ComponentInstanceItemProvider.java]

nameclass, %method, %block, %line, %
ComponentInstanceItemProvider.java0%   (0/1)0%   (0/9)0%   (0/118)0%   (0/33)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ComponentInstanceItemProvider0%   (0/1)0%   (0/9)0%   (0/118)0%   (0/33)
ComponentInstanceItemProvider (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)
getImage (Object): Object 0%   (0/1)0%   (0/8)0%   (0/1)
getPropertyDescriptors (Object): List 0%   (0/1)0%   (0/10)0%   (0/3)
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.fzi.se.quality.parameters.provider;
8 
9 
10import de.fzi.se.quality.parameters.ComponentInstance;
11import de.fzi.se.quality.parameters.ParametersFactory;
12import de.fzi.se.quality.parameters.ParametersPackage;
13 
14import de.fzi.se.quality.parameters.pcm.PCMFactory;
15 
16import de.fzi.se.quality.provider.QualityEditPlugin;
17 
18import de.uka.ipd.sdq.identifier.provider.IdentifierItemProvider;
19 
20import java.util.Collection;
21import java.util.List;
22 
23import org.eclipse.emf.common.notify.AdapterFactory;
24import org.eclipse.emf.common.notify.Notification;
25 
26import org.eclipse.emf.common.util.ResourceLocator;
27 
28import org.eclipse.emf.ecore.EStructuralFeature;
29 
30import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
31import org.eclipse.emf.edit.provider.IItemLabelProvider;
32import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
33import org.eclipse.emf.edit.provider.IItemPropertySource;
34import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
35import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
36import org.eclipse.emf.edit.provider.ViewerNotification;
37 
38/**
39 * This is the item provider adapter for a {@link de.fzi.se.quality.parameters.ComponentInstance} object.
40 * <!-- begin-user-doc -->
41 * <!-- end-user-doc -->
42 * @generated
43 */
44public class ComponentInstanceItemProvider
45        extends IdentifierItemProvider
46        implements
47                IEditingDomainItemProvider,
48                IStructuredItemContentProvider,
49                ITreeItemContentProvider,
50                IItemLabelProvider,
51                IItemPropertySource {
52        /**
53         * This constructs an instance from a factory and a notifier.
54         * <!-- begin-user-doc -->
55         * <!-- end-user-doc -->
56         * @generated
57         */
58        public ComponentInstanceItemProvider(AdapterFactory adapterFactory) {
59                super(adapterFactory);
60        }
61 
62        /**
63         * This returns the property descriptors for the adapted class.
64         * <!-- begin-user-doc -->
65         * <!-- end-user-doc -->
66         * @generated
67         */
68        @Override
69        public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
70                if (itemPropertyDescriptors == null) {
71                        super.getPropertyDescriptors(object);
72 
73                }
74                return itemPropertyDescriptors;
75        }
76 
77        /**
78         * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
79         * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
80         * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
81         * <!-- begin-user-doc -->
82         * <!-- end-user-doc -->
83         * @generated
84         */
85        @Override
86        public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
87                if (childrenFeatures == null) {
88                        super.getChildrenFeatures(object);
89                        childrenFeatures.add(ParametersPackage.Literals.COMPONENT_INSTANCE__COMPONENT_REFERENCE);
90                        childrenFeatures.add(ParametersPackage.Literals.COMPONENT_INSTANCE__PARAMETER_INSTANCES);
91                }
92                return childrenFeatures;
93        }
94 
95        /**
96         * <!-- begin-user-doc -->
97         * <!-- end-user-doc -->
98         * @generated
99         */
100        @Override
101        protected EStructuralFeature getChildFeature(Object object, Object child) {
102                // Check the type of the specified child object and return the proper feature to use for
103                // adding (see {@link AddCommand}) it as a child.
104 
105                return super.getChildFeature(object, child);
106        }
107 
108        /**
109         * This returns ComponentInstance.gif.
110         * <!-- begin-user-doc -->
111         * <!-- end-user-doc -->
112         * @generated
113         */
114        @Override
115        public Object getImage(Object object) {
116                return overlayImage(object, getResourceLocator().getImage("full/obj16/ComponentInstance"));
117        }
118 
119        /**
120         * This returns the label text for the adapted class.
121         * <!-- begin-user-doc -->
122         * <!-- end-user-doc -->
123         * @generated
124         */
125        @Override
126        public String getText(Object object) {
127                String label = ((ComponentInstance)object).getId();
128                return label == null || label.length() == 0 ?
129                        getString("_UI_ComponentInstance_type") :
130                        getString("_UI_ComponentInstance_type") + " " + label;
131        }
132 
133        /**
134         * This handles model notifications by calling {@link #updateChildren} to update any cached
135         * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
136         * <!-- begin-user-doc -->
137         * <!-- end-user-doc -->
138         * @generated
139         */
140        @Override
141        public void notifyChanged(Notification notification) {
142                updateChildren(notification);
143 
144                switch (notification.getFeatureID(ComponentInstance.class)) {
145                        case ParametersPackage.COMPONENT_INSTANCE__COMPONENT_REFERENCE:
146                        case ParametersPackage.COMPONENT_INSTANCE__PARAMETER_INSTANCES:
147                                fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
148                                return;
149                }
150                super.notifyChanged(notification);
151        }
152 
153        /**
154         * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
155         * that can be created under this object.
156         * <!-- begin-user-doc -->
157         * <!-- end-user-doc -->
158         * @generated
159         */
160        @Override
161        protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
162                super.collectNewChildDescriptors(newChildDescriptors, object);
163 
164                newChildDescriptors.add
165                        (createChildParameter
166                                (ParametersPackage.Literals.COMPONENT_INSTANCE__COMPONENT_REFERENCE,
167                                 PCMFactory.eINSTANCE.createPCMComponentReference()));
168 
169                newChildDescriptors.add
170                        (createChildParameter
171                                (ParametersPackage.Literals.COMPONENT_INSTANCE__PARAMETER_INSTANCES,
172                                 ParametersFactory.eINSTANCE.createParameterInstance()));
173        }
174 
175        /**
176         * Return the resource locator for this item provider's resources.
177         * <!-- begin-user-doc -->
178         * <!-- end-user-doc -->
179         * @generated
180         */
181        @Override
182        public ResourceLocator getResourceLocator() {
183                return QualityEditPlugin.INSTANCE;
184        }
185 
186}

[all classes][de.fzi.se.quality.parameters.provider]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov