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

COVERAGE SUMMARY FOR SOURCE FILE [VariableProcessingResourceCostItemProvider.java]

nameclass, %method, %block, %line, %
VariableProcessingResourceCostItemProvider.java0%   (0/1)0%   (0/10)0%   (0/185)0%   (0/55)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class VariableProcessingResourceCostItemProvider0%   (0/1)0%   (0/10)0%   (0/185)0%   (0/55)
VariableProcessingResourceCostItemProvider (AdapterFactory): void 0%   (0/1)0%   (0/4)0%   (0/2)
addProcessingresourcespecificationPropertyDescriptor (Object): void 0%   (0/1)0%   (0/28)0%   (0/14)
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/13)0%   (0/4)
getText (Object): String 0%   (0/1)0%   (0/17)0%   (0/2)
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.pcm.cost.provider;
8 
9 
10import de.uka.ipd.sdq.pcm.cost.VariableProcessingResourceCost;
11import de.uka.ipd.sdq.pcm.cost.costFactory;
12import de.uka.ipd.sdq.pcm.cost.costPackage;
13 
14import de.uka.ipd.sdq.stoex.StoexFactory;
15import java.util.Collection;
16import java.util.List;
17 
18import org.eclipse.emf.common.notify.AdapterFactory;
19import org.eclipse.emf.common.notify.Notification;
20 
21import org.eclipse.emf.ecore.EStructuralFeature;
22import org.eclipse.emf.common.util.ResourceLocator;
23import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
24import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
25import org.eclipse.emf.edit.provider.IItemLabelProvider;
26import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
27import org.eclipse.emf.edit.provider.IItemPropertySource;
28import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
29import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
30import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
31import org.eclipse.emf.edit.provider.ViewerNotification;
32 
33/**
34 * This is the item provider adapter for a {@link de.uka.ipd.sdq.pcm.cost.VariableProcessingResourceCost} object.
35 * <!-- begin-user-doc -->
36 * <!-- end-user-doc -->
37 * @generated
38 */
39public class VariableProcessingResourceCostItemProvider
40        extends VariableCostItemProvider
41        implements
42                IEditingDomainItemProvider,
43                IStructuredItemContentProvider,
44                ITreeItemContentProvider,
45                IItemLabelProvider,
46                IItemPropertySource {
47        /**
48         * This constructs an instance from a factory and a notifier.
49         * <!-- begin-user-doc -->
50         * <!-- end-user-doc -->
51         * @generated
52         */
53        public VariableProcessingResourceCostItemProvider(AdapterFactory adapterFactory) {
54                super(adapterFactory);
55        }
56 
57        /**
58         * This returns the property descriptors for the adapted class.
59         * <!-- begin-user-doc -->
60         * <!-- end-user-doc -->
61         * @generated
62         */
63        @Override
64        public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
65                if (itemPropertyDescriptors == null) {
66                        super.getPropertyDescriptors(object);
67 
68                        addProcessingresourcespecificationPropertyDescriptor(object);
69                }
70                return itemPropertyDescriptors;
71        }
72 
73        /**
74         * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
75         * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
76         * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
77         * <!-- begin-user-doc -->
78         * <!-- end-user-doc -->
79         * @generated
80         */
81        @Override
82        public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
83                if (childrenFeatures == null) {
84                        super.getChildrenFeatures(object);
85                        childrenFeatures.add(costPackage.Literals.VARIABLE_PROCESSING_RESOURCE_COST__PROCESSING_RATE_INITIAL_FUNCTION);
86                        childrenFeatures.add(costPackage.Literals.VARIABLE_PROCESSING_RESOURCE_COST__PROCESSING_RATE_OPERATING_FUNCTION);
87                }
88                return childrenFeatures;
89        }
90 
91        /**
92         * <!-- begin-user-doc -->
93         * <!-- end-user-doc -->
94         * @generated
95         */
96        @Override
97        protected EStructuralFeature getChildFeature(Object object, Object child) {
98                // Check the type of the specified child object and return the proper feature to use for
99                // adding (see {@link AddCommand}) it as a child.
100 
101                return super.getChildFeature(object, child);
102        }
103 
104        /**
105         * This adds a property descriptor for the Processingresourcespecification feature.
106         * <!-- begin-user-doc -->
107         * <!-- end-user-doc -->
108         * @generated
109         */
110        protected void addProcessingresourcespecificationPropertyDescriptor(Object object) {
111                itemPropertyDescriptors.add
112                        (createItemPropertyDescriptor
113                                (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
114                                 getResourceLocator(),
115                                 getString("_UI_ProcessingResourceCost_processingresourcespecification_feature"),
116                                 getString("_UI_PropertyDescriptor_description", "_UI_ProcessingResourceCost_processingresourcespecification_feature", "_UI_ProcessingResourceCost_type"),
117                                 costPackage.Literals.PROCESSING_RESOURCE_COST__PROCESSINGRESOURCESPECIFICATION,
118                                 true,
119                                 false,
120                                 true,
121                                 null,
122                                 null,
123                                 null));
124        }
125 
126        /**
127         * This returns VariableProcessingResourceCost.gif.
128         * <!-- begin-user-doc -->
129         * <!-- end-user-doc -->
130         * @generated
131         */
132        @Override
133        public Object getImage(Object object) {
134                return overlayImage(object, getResourceLocator().getImage("full/obj16/VariableProcessingResourceCost"));
135        }
136 
137        /**
138         * This returns the label text for the adapted class.
139         * <!-- begin-user-doc -->
140         * <!-- end-user-doc -->
141         * @generated
142         */
143        @Override
144        public String getText(Object object) {
145                VariableProcessingResourceCost variableProcessingResourceCost = (VariableProcessingResourceCost)object;
146                return getString("_UI_VariableProcessingResourceCost_type") + " " + variableProcessingResourceCost.getInitialCost();
147        }
148 
149        /**
150         * This handles model notifications by calling {@link #updateChildren} to update any cached
151         * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
152         * <!-- begin-user-doc -->
153         * <!-- end-user-doc -->
154         * @generated
155         */
156        @Override
157        public void notifyChanged(Notification notification) {
158                updateChildren(notification);
159 
160                switch (notification.getFeatureID(VariableProcessingResourceCost.class)) {
161                        case costPackage.VARIABLE_PROCESSING_RESOURCE_COST__PROCESSING_RATE_INITIAL_FUNCTION:
162                        case costPackage.VARIABLE_PROCESSING_RESOURCE_COST__PROCESSING_RATE_OPERATING_FUNCTION:
163                                fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
164                                return;
165                }
166                super.notifyChanged(notification);
167        }
168 
169        /**
170         * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
171         * that can be created under this object.
172         * <!-- begin-user-doc -->
173         * <!-- end-user-doc -->
174         * @generated
175         */
176        @Override
177        protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
178                super.collectNewChildDescriptors(newChildDescriptors, object);
179 
180                newChildDescriptors.add
181                        (createChildParameter
182                                (costPackage.Literals.VARIABLE_PROCESSING_RESOURCE_COST__PROCESSING_RATE_INITIAL_FUNCTION,
183                                 costFactory.eINSTANCE.createScalarFunction()));
184 
185                newChildDescriptors.add
186                        (createChildParameter
187                                (costPackage.Literals.VARIABLE_PROCESSING_RESOURCE_COST__PROCESSING_RATE_OPERATING_FUNCTION,
188                                 costFactory.eINSTANCE.createScalarFunction()));
189        }
190 
191        /**
192         * This returns the label text for {@link org.eclipse.emf.edit.command.CreateChildCommand}.
193         * <!-- begin-user-doc -->
194         * <!-- end-user-doc -->
195         * @generated
196         */
197        @Override
198        public String getCreateChildText(Object owner, Object feature, Object child, Collection<?> selection) {
199                Object childFeature = feature;
200                Object childObject = child;
201 
202                boolean qualify =
203                        childFeature == costPackage.Literals.VARIABLE_PROCESSING_RESOURCE_COST__PROCESSING_RATE_INITIAL_FUNCTION ||
204                        childFeature == costPackage.Literals.VARIABLE_PROCESSING_RESOURCE_COST__PROCESSING_RATE_OPERATING_FUNCTION;
205 
206                if (qualify) {
207                        return getString
208                                ("_UI_CreateChild_text2",
209                                 new Object[] { getTypeText(childObject), getFeatureText(childFeature), getTypeText(owner) });
210                }
211                return super.getCreateChildText(owner, feature, child, selection);
212        }
213 
214}

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