EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][QVTRelation.provider]

COVERAGE SUMMARY FOR SOURCE FILE [RelationItemProvider.java]

nameclass, %method, %block, %line, %
RelationItemProvider.java0%   (0/1)0%   (0/11)0%   (0/257)0%   (0/82)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class RelationItemProvider0%   (0/1)0%   (0/11)0%   (0/257)0%   (0/82)
RelationItemProvider (AdapterFactory): void 0%   (0/1)0%   (0/4)0%   (0/2)
addIsTopLevelPropertyDescriptor (Object): void 0%   (0/1)0%   (0/28)0%   (0/14)
collectNewChildDescriptors (Collection, Object): void 0%   (0/1)0%   (0/61)0%   (0/30)
getChildFeature (Object, Object): EStructuralFeature 0%   (0/1)0%   (0/5)0%   (0/1)
getChildrenFeatures (Object): Collection 0%   (0/1)0%   (0/30)0%   (0/7)
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)
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 QVTRelation.provider;
8 
9 
10import EMOF.provider.QvtmodelsEditPlugin;
11 
12import EssentialOCL.EssentialOCLFactory;
13 
14import QVTBase.QVTBaseFactory;
15 
16import QVTBase.provider.RuleItemProvider;
17 
18import QVTRelation.QVTRelationFactory;
19import QVTRelation.QVTRelationPackage;
20import QVTRelation.Relation;
21 
22import java.util.Collection;
23import java.util.List;
24 
25import org.eclipse.emf.common.notify.AdapterFactory;
26import org.eclipse.emf.common.notify.Notification;
27 
28import org.eclipse.emf.common.util.ResourceLocator;
29 
30import org.eclipse.emf.ecore.EStructuralFeature;
31 
32import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
33import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
34import org.eclipse.emf.edit.provider.IItemLabelProvider;
35import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
36import org.eclipse.emf.edit.provider.IItemPropertySource;
37import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
38import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
39import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
40import org.eclipse.emf.edit.provider.ViewerNotification;
41 
42/**
43 * This is the item provider adapter for a {@link QVTRelation.Relation} object.
44 * <!-- begin-user-doc -->
45 * <!-- end-user-doc -->
46 * @generated
47 */
48public class RelationItemProvider
49        extends RuleItemProvider
50        implements
51                IEditingDomainItemProvider,
52                IStructuredItemContentProvider,
53                ITreeItemContentProvider,
54                IItemLabelProvider,
55                IItemPropertySource {
56        /**
57         * This constructs an instance from a factory and a notifier.
58         * <!-- begin-user-doc -->
59         * <!-- end-user-doc -->
60         * @generated
61         */
62        public RelationItemProvider(AdapterFactory adapterFactory) {
63                super(adapterFactory);
64        }
65 
66        /**
67         * This returns the property descriptors for the adapted class.
68         * <!-- begin-user-doc -->
69         * <!-- end-user-doc -->
70         * @generated
71         */
72        @Override
73        public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
74                if (itemPropertyDescriptors == null) {
75                        super.getPropertyDescriptors(object);
76 
77                        addIsTopLevelPropertyDescriptor(object);
78                }
79                return itemPropertyDescriptors;
80        }
81 
82        /**
83         * This adds a property descriptor for the Is Top Level feature.
84         * <!-- begin-user-doc -->
85         * <!-- end-user-doc -->
86         * @generated
87         */
88        protected void addIsTopLevelPropertyDescriptor(Object object) {
89                itemPropertyDescriptors.add
90                        (createItemPropertyDescriptor
91                                (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
92                                 getResourceLocator(),
93                                 getString("_UI_Relation_isTopLevel_feature"),
94                                 getString("_UI_PropertyDescriptor_description", "_UI_Relation_isTopLevel_feature", "_UI_Relation_type"),
95                                 QVTRelationPackage.Literals.RELATION__IS_TOP_LEVEL,
96                                 true,
97                                 false,
98                                 false,
99                                 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
100                                 null,
101                                 null));
102        }
103 
104        /**
105         * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
106         * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
107         * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
108         * <!-- begin-user-doc -->
109         * <!-- end-user-doc -->
110         * @generated
111         */
112        @Override
113        public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
114                if (childrenFeatures == null) {
115                        super.getChildrenFeatures(object);
116                        childrenFeatures.add(QVTRelationPackage.Literals.RELATION__OPERATIONAL_IMPL);
117                        childrenFeatures.add(QVTRelationPackage.Literals.RELATION__VARIABLE);
118                        childrenFeatures.add(QVTRelationPackage.Literals.RELATION__WHEN);
119                        childrenFeatures.add(QVTRelationPackage.Literals.RELATION__WHERE);
120                }
121                return childrenFeatures;
122        }
123 
124        /**
125         * <!-- begin-user-doc -->
126         * <!-- end-user-doc -->
127         * @generated
128         */
129        @Override
130        protected EStructuralFeature getChildFeature(Object object, Object child) {
131                // Check the type of the specified child object and return the proper feature to use for
132                // adding (see {@link AddCommand}) it as a child.
133 
134                return super.getChildFeature(object, child);
135        }
136 
137        /**
138         * This returns Relation.gif.
139         * <!-- begin-user-doc -->
140         * <!-- end-user-doc -->
141         * @generated
142         */
143        @Override
144        public Object getImage(Object object) {
145                return overlayImage(object, getResourceLocator().getImage("full/obj16/Relation"));
146        }
147 
148        /**
149         * This returns the label text for the adapted class.
150         * <!-- begin-user-doc -->
151         * <!-- end-user-doc -->
152         * @generated
153         */
154        @Override
155        public String getText(Object object) {
156                String label = ((Relation)object).getName();
157                return label == null || label.length() == 0 ?
158                        getString("_UI_Relation_type") :
159                        getString("_UI_Relation_type") + " " + label;
160        }
161 
162        /**
163         * This handles model notifications by calling {@link #updateChildren} to update any cached
164         * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
165         * <!-- begin-user-doc -->
166         * <!-- end-user-doc -->
167         * @generated
168         */
169        @Override
170        public void notifyChanged(Notification notification) {
171                updateChildren(notification);
172 
173                switch (notification.getFeatureID(Relation.class)) {
174                        case QVTRelationPackage.RELATION__IS_TOP_LEVEL:
175                                fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
176                                return;
177                        case QVTRelationPackage.RELATION__OPERATIONAL_IMPL:
178                        case QVTRelationPackage.RELATION__VARIABLE:
179                        case QVTRelationPackage.RELATION__WHEN:
180                        case QVTRelationPackage.RELATION__WHERE:
181                                fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
182                                return;
183                }
184                super.notifyChanged(notification);
185        }
186 
187        /**
188         * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
189         * that can be created under this object.
190         * <!-- begin-user-doc -->
191         * <!-- end-user-doc -->
192         * @generated
193         */
194        @Override
195        protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
196                super.collectNewChildDescriptors(newChildDescriptors, object);
197 
198                newChildDescriptors.add
199                        (createChildParameter
200                                (QVTRelationPackage.Literals.RELATION__OPERATIONAL_IMPL,
201                                 QVTRelationFactory.eINSTANCE.createRelationImplementation()));
202 
203                newChildDescriptors.add
204                        (createChildParameter
205                                (QVTRelationPackage.Literals.RELATION__VARIABLE,
206                                 EssentialOCLFactory.eINSTANCE.createVariable()));
207 
208                newChildDescriptors.add
209                        (createChildParameter
210                                (QVTRelationPackage.Literals.RELATION__VARIABLE,
211                                 QVTBaseFactory.eINSTANCE.createFunctionParameter()));
212 
213                newChildDescriptors.add
214                        (createChildParameter
215                                (QVTRelationPackage.Literals.RELATION__WHEN,
216                                 QVTRelationFactory.eINSTANCE.createDomainPattern()));
217 
218                newChildDescriptors.add
219                        (createChildParameter
220                                (QVTRelationPackage.Literals.RELATION__WHEN,
221                                 QVTBaseFactory.eINSTANCE.createPattern()));
222 
223                newChildDescriptors.add
224                        (createChildParameter
225                                (QVTRelationPackage.Literals.RELATION__WHERE,
226                                 QVTRelationFactory.eINSTANCE.createDomainPattern()));
227 
228                newChildDescriptors.add
229                        (createChildParameter
230                                (QVTRelationPackage.Literals.RELATION__WHERE,
231                                 QVTBaseFactory.eINSTANCE.createPattern()));
232        }
233 
234        /**
235         * This returns the label text for {@link org.eclipse.emf.edit.command.CreateChildCommand}.
236         * <!-- begin-user-doc -->
237         * <!-- end-user-doc -->
238         * @generated
239         */
240        @Override
241        public String getCreateChildText(Object owner, Object feature, Object child, Collection<?> selection) {
242                Object childFeature = feature;
243                Object childObject = child;
244 
245                boolean qualify =
246                        childFeature == QVTRelationPackage.Literals.RELATION__WHEN ||
247                        childFeature == QVTRelationPackage.Literals.RELATION__WHERE;
248 
249                if (qualify) {
250                        return getString
251                                ("_UI_CreateChild_text2",
252                                 new Object[] { getTypeText(childObject), getFeatureText(childFeature), getTypeText(owner) });
253                }
254                return super.getCreateChildText(owner, feature, child, selection);
255        }
256 
257        /**
258         * Return the resource locator for this item provider's resources.
259         * <!-- begin-user-doc -->
260         * <!-- end-user-doc -->
261         * @generated
262         */
263        @Override
264        public ResourceLocator getResourceLocator() {
265                return QvtmodelsEditPlugin.INSTANCE;
266        }
267 
268}

[all classes][QVTRelation.provider]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov