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

COVERAGE SUMMARY FOR SOURCE FILE [TermExpressionItemProvider.java]

nameclass, %method, %block, %line, %
TermExpressionItemProvider.java0%   (0/1)0%   (0/10)0%   (0/396)0%   (0/152)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class TermExpressionItemProvider0%   (0/1)0%   (0/10)0%   (0/396)0%   (0/152)
TermExpressionItemProvider (AdapterFactory): void 0%   (0/1)0%   (0/4)0%   (0/2)
addOperationPropertyDescriptor (Object): void 0%   (0/1)0%   (0/28)0%   (0/14)
collectNewChildDescriptors (Collection, Object): void 0%   (0/1)0%   (0/205)0%   (0/102)
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/33)0%   (0/5)
notifyChanged (Notification): void 0%   (0/1)0%   (0/33)0%   (0/8)

1/**
2 * <copyright>
3 * </copyright>
4 *
5 * $Id$
6 */
7package de.uka.ipd.sdq.stoex.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.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.stoex.StoexFactory;
27import de.uka.ipd.sdq.stoex.StoexPackage;
28import de.uka.ipd.sdq.stoex.TermExpression;
29import de.uka.ipd.sdq.stoex.TermOperations;
30 
31/**
32 * This is the item provider adapter for a {@link de.uka.ipd.sdq.stoex.TermExpression} object.
33 * <!-- begin-user-doc -->
34 * <!-- end-user-doc -->
35 * @generated
36 */
37public class TermExpressionItemProvider
38        extends TermItemProvider
39        implements        
40                IEditingDomainItemProvider,        
41                IStructuredItemContentProvider,        
42                ITreeItemContentProvider,        
43                IItemLabelProvider,        
44                IItemPropertySource {
45        /**
46         * <!-- begin-user-doc -->
47         * <!-- end-user-doc -->
48         * @generated
49         */
50        public static final String copyright = "Copyright 2007-2009, SDQ, IPD, U Karlsruhe";
51 
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 TermExpressionItemProvider(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                        addOperationPropertyDescriptor(object);
74                }
75                return itemPropertyDescriptors;
76        }
77 
78        /**
79         * This adds a property descriptor for the Operation feature.
80         * <!-- begin-user-doc -->
81         * <!-- end-user-doc -->
82         * @generated
83         */
84        protected void addOperationPropertyDescriptor(Object object) {
85                itemPropertyDescriptors.add
86                        (createItemPropertyDescriptor
87                                (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
88                                 getResourceLocator(),
89                                 getString("_UI_TermExpression_operation_feature"),
90                                 getString("_UI_PropertyDescriptor_description", "_UI_TermExpression_operation_feature", "_UI_TermExpression_type"),
91                                 StoexPackage.Literals.TERM_EXPRESSION__OPERATION,
92                                 true,
93                                 false,
94                                 false,
95                                 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
96                                 null,
97                                 null));
98        }
99 
100        /**
101         * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
102         * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
103         * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
104         * <!-- begin-user-doc -->
105         * <!-- end-user-doc -->
106         * @generated
107         */
108        @Override
109        public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
110                if (childrenFeatures == null) {
111                        super.getChildrenFeatures(object);
112                        childrenFeatures.add(StoexPackage.Literals.TERM_EXPRESSION__LEFT);
113                        childrenFeatures.add(StoexPackage.Literals.TERM_EXPRESSION__RIGHT);
114                }
115                return childrenFeatures;
116        }
117 
118        /**
119         * <!-- begin-user-doc -->
120         * <!-- end-user-doc -->
121         * @generated
122         */
123        @Override
124        protected EStructuralFeature getChildFeature(Object object, Object child) {
125                // Check the type of the specified child object and return the proper feature to use for
126                // adding (see {@link AddCommand}) it as a child.
127 
128                return super.getChildFeature(object, child);
129        }
130 
131        /**
132         * This returns TermExpression.gif.
133         * <!-- begin-user-doc -->
134         * <!-- end-user-doc -->
135         * @generated
136         */
137        @Override
138        public Object getImage(Object object) {
139                return overlayImage(object, getResourceLocator().getImage("full/obj16/TermExpression"));
140        }
141 
142        /**
143         * This returns the label text for the adapted class.
144         * <!-- begin-user-doc -->
145         * <!-- end-user-doc -->
146         * @generated
147         */
148        @Override
149        public String getText(Object object) {
150                TermOperations labelValue = ((TermExpression)object).getOperation();
151                String label = labelValue == null ? null : labelValue.toString();
152                return label == null || label.length() == 0 ?
153                        getString("_UI_TermExpression_type") :
154                        getString("_UI_TermExpression_type") + " " + label;
155        }
156 
157        /**
158         * This handles model notifications by calling {@link #updateChildren} to update any cached
159         * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
160         * <!-- begin-user-doc -->
161         * <!-- end-user-doc -->
162         * @generated
163         */
164        @Override
165        public void notifyChanged(Notification notification) {
166                updateChildren(notification);
167 
168                switch (notification.getFeatureID(TermExpression.class)) {
169                        case StoexPackage.TERM_EXPRESSION__OPERATION:
170                                fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
171                                return;
172                        case StoexPackage.TERM_EXPRESSION__LEFT:
173                        case StoexPackage.TERM_EXPRESSION__RIGHT:
174                                fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
175                                return;
176                }
177                super.notifyChanged(notification);
178        }
179 
180        /**
181         * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
182         * that can be created under this object.
183         * <!-- begin-user-doc -->
184         * <!-- end-user-doc -->
185         * @generated
186         */
187        @Override
188        protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
189                super.collectNewChildDescriptors(newChildDescriptors, object);
190 
191                newChildDescriptors.add
192                        (createChildParameter
193                                (StoexPackage.Literals.TERM_EXPRESSION__LEFT,
194                                 StoexFactory.eINSTANCE.createVariable()));
195 
196                newChildDescriptors.add
197                        (createChildParameter
198                                (StoexPackage.Literals.TERM_EXPRESSION__LEFT,
199                                 StoexFactory.eINSTANCE.createTermExpression()));
200 
201                newChildDescriptors.add
202                        (createChildParameter
203                                (StoexPackage.Literals.TERM_EXPRESSION__LEFT,
204                                 StoexFactory.eINSTANCE.createProductExpression()));
205 
206                newChildDescriptors.add
207                        (createChildParameter
208                                (StoexPackage.Literals.TERM_EXPRESSION__LEFT,
209                                 StoexFactory.eINSTANCE.createProbabilityFunctionLiteral()));
210 
211                newChildDescriptors.add
212                        (createChildParameter
213                                (StoexPackage.Literals.TERM_EXPRESSION__LEFT,
214                                 StoexFactory.eINSTANCE.createParenthesis()));
215 
216                newChildDescriptors.add
217                        (createChildParameter
218                                (StoexPackage.Literals.TERM_EXPRESSION__LEFT,
219                                 StoexFactory.eINSTANCE.createIntLiteral()));
220 
221                newChildDescriptors.add
222                        (createChildParameter
223                                (StoexPackage.Literals.TERM_EXPRESSION__LEFT,
224                                 StoexFactory.eINSTANCE.createDoubleLiteral()));
225 
226                newChildDescriptors.add
227                        (createChildParameter
228                                (StoexPackage.Literals.TERM_EXPRESSION__LEFT,
229                                 StoexFactory.eINSTANCE.createBoolLiteral()));
230 
231                newChildDescriptors.add
232                        (createChildParameter
233                                (StoexPackage.Literals.TERM_EXPRESSION__LEFT,
234                                 StoexFactory.eINSTANCE.createStringLiteral()));
235 
236                newChildDescriptors.add
237                        (createChildParameter
238                                (StoexPackage.Literals.TERM_EXPRESSION__LEFT,
239                                 StoexFactory.eINSTANCE.createPowerExpression()));
240 
241                newChildDescriptors.add
242                        (createChildParameter
243                                (StoexPackage.Literals.TERM_EXPRESSION__LEFT,
244                                 StoexFactory.eINSTANCE.createNotExpression()));
245 
246                newChildDescriptors.add
247                        (createChildParameter
248                                (StoexPackage.Literals.TERM_EXPRESSION__LEFT,
249                                 StoexFactory.eINSTANCE.createNegativeExpression()));
250 
251                newChildDescriptors.add
252                        (createChildParameter
253                                (StoexPackage.Literals.TERM_EXPRESSION__LEFT,
254                                 StoexFactory.eINSTANCE.createFunctionLiteral()));
255 
256                newChildDescriptors.add
257                        (createChildParameter
258                                (StoexPackage.Literals.TERM_EXPRESSION__RIGHT,
259                                 StoexFactory.eINSTANCE.createVariable()));
260 
261                newChildDescriptors.add
262                        (createChildParameter
263                                (StoexPackage.Literals.TERM_EXPRESSION__RIGHT,
264                                 StoexFactory.eINSTANCE.createProductExpression()));
265 
266                newChildDescriptors.add
267                        (createChildParameter
268                                (StoexPackage.Literals.TERM_EXPRESSION__RIGHT,
269                                 StoexFactory.eINSTANCE.createProbabilityFunctionLiteral()));
270 
271                newChildDescriptors.add
272                        (createChildParameter
273                                (StoexPackage.Literals.TERM_EXPRESSION__RIGHT,
274                                 StoexFactory.eINSTANCE.createParenthesis()));
275 
276                newChildDescriptors.add
277                        (createChildParameter
278                                (StoexPackage.Literals.TERM_EXPRESSION__RIGHT,
279                                 StoexFactory.eINSTANCE.createIntLiteral()));
280 
281                newChildDescriptors.add
282                        (createChildParameter
283                                (StoexPackage.Literals.TERM_EXPRESSION__RIGHT,
284                                 StoexFactory.eINSTANCE.createDoubleLiteral()));
285 
286                newChildDescriptors.add
287                        (createChildParameter
288                                (StoexPackage.Literals.TERM_EXPRESSION__RIGHT,
289                                 StoexFactory.eINSTANCE.createBoolLiteral()));
290 
291                newChildDescriptors.add
292                        (createChildParameter
293                                (StoexPackage.Literals.TERM_EXPRESSION__RIGHT,
294                                 StoexFactory.eINSTANCE.createStringLiteral()));
295 
296                newChildDescriptors.add
297                        (createChildParameter
298                                (StoexPackage.Literals.TERM_EXPRESSION__RIGHT,
299                                 StoexFactory.eINSTANCE.createPowerExpression()));
300 
301                newChildDescriptors.add
302                        (createChildParameter
303                                (StoexPackage.Literals.TERM_EXPRESSION__RIGHT,
304                                 StoexFactory.eINSTANCE.createNotExpression()));
305 
306                newChildDescriptors.add
307                        (createChildParameter
308                                (StoexPackage.Literals.TERM_EXPRESSION__RIGHT,
309                                 StoexFactory.eINSTANCE.createNegativeExpression()));
310 
311                newChildDescriptors.add
312                        (createChildParameter
313                                (StoexPackage.Literals.TERM_EXPRESSION__RIGHT,
314                                 StoexFactory.eINSTANCE.createFunctionLiteral()));
315        }
316 
317        /**
318         * This returns the label text for {@link org.eclipse.emf.edit.command.CreateChildCommand}.
319         * <!-- begin-user-doc -->
320         * <!-- end-user-doc -->
321         * @generated
322         */
323        @Override
324        public String getCreateChildText(Object owner, Object feature, Object child, Collection<?> selection) {
325                Object childFeature = feature;
326                Object childObject = child;
327 
328                boolean qualify =
329                        childFeature == StoexPackage.Literals.TERM_EXPRESSION__LEFT ||
330                        childFeature == StoexPackage.Literals.TERM_EXPRESSION__RIGHT;
331 
332                if (qualify) {
333                        return getString
334                                ("_UI_CreateChild_text2",
335                                 new Object[] { getTypeText(childObject), getFeatureText(childFeature), getTypeText(owner) });
336                }
337                return super.getCreateChildText(owner, feature, child, selection);
338        }
339 
340}

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