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

COVERAGE SUMMARY FOR SOURCE FILE [OCLRuleItemProvider.java]

nameclass, %method, %block, %line, %
OCLRuleItemProvider.java0%   (0/1)0%   (0/10)0%   (0/147)0%   (0/45)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class OCLRuleItemProvider0%   (0/1)0%   (0/10)0%   (0/147)0%   (0/45)
OCLRuleItemProvider (AdapterFactory): void 0%   (0/1)0%   (0/4)0%   (0/2)
addMainOclQueryPropertyDescriptor (Object): void 0%   (0/1)0%   (0/28)0%   (0/14)
collectNewChildDescriptors (Collection, Object): void 0%   (0/1)0%   (0/13)0%   (0/6)
getChildFeature (Object, Object): EStructuralFeature 0%   (0/1)0%   (0/5)0%   (0/1)
getChildrenFeatures (Object): Collection 0%   (0/1)0%   (0/15)0%   (0/4)
getImage (Object): Object 0%   (0/1)0%   (0/8)0%   (0/1)
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/33)0%   (0/8)

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

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