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

COVERAGE SUMMARY FOR SOURCE FILE [EntityItemProvider.java]

nameclass, %method, %block, %line, %
EntityItemProvider.java0%   (0/1)0%   (0/7)0%   (0/100)0%   (0/33)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class EntityItemProvider0%   (0/1)0%   (0/7)0%   (0/100)0%   (0/33)
EntityItemProvider (AdapterFactory): void 0%   (0/1)0%   (0/4)0%   (0/2)
addEntityNamePropertyDescriptor (Object): void 0%   (0/1)0%   (0/28)0%   (0/14)
collectNewChildDescriptors (Collection, Object): void 0%   (0/1)0%   (0/5)0%   (0/2)
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/22)0%   (0/6)

1/**
2 * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany
3 *
4 * $Id$
5 */
6package de.uka.ipd.sdq.pcm.core.entity.provider;
7 
8 
9import java.util.Collection;
10import java.util.List;
11 
12import org.eclipse.emf.common.notify.AdapterFactory;
13import org.eclipse.emf.common.notify.Notification;
14import org.eclipse.emf.common.util.ResourceLocator;
15import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
16import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
17import org.eclipse.emf.edit.provider.IItemLabelProvider;
18import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
19import org.eclipse.emf.edit.provider.IItemPropertySource;
20import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
21import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
22import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
23import org.eclipse.emf.edit.provider.ViewerNotification;
24 
25import de.uka.ipd.sdq.identifier.provider.IdentifierItemProvider;
26import de.uka.ipd.sdq.pcm.core.entity.Entity;
27import de.uka.ipd.sdq.pcm.core.entity.EntityPackage;
28import de.uka.ipd.sdq.pcm.core.provider.PalladioComponentModelEditPlugin;
29 
30/**
31 * This is the item provider adapter for a {@link de.uka.ipd.sdq.pcm.core.entity.Entity} object.
32 * <!-- begin-user-doc -->
33 * <!-- end-user-doc -->
34 * @generated
35 */
36public class EntityItemProvider
37        extends IdentifierItemProvider
38        implements
39                IEditingDomainItemProvider,
40                IStructuredItemContentProvider,
41                ITreeItemContentProvider,
42                IItemLabelProvider,
43                IItemPropertySource {
44        /**
45         * <!-- begin-user-doc -->
46         * <!-- end-user-doc -->
47         * @generated
48         */
49        public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany";
50 
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 EntityItemProvider(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                        addEntityNamePropertyDescriptor(object);
73                }
74                return itemPropertyDescriptors;
75        }
76 
77        /**
78         * This adds a property descriptor for the Entity Name feature.
79         * <!-- begin-user-doc -->
80         * <!-- end-user-doc -->
81         * @generated
82         */
83        protected void addEntityNamePropertyDescriptor(Object object) {
84                itemPropertyDescriptors.add
85                        (createItemPropertyDescriptor
86                                (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
87                                 getResourceLocator(),
88                                 getString("_UI_NamedElement_entityName_feature"),
89                                 getString("_UI_PropertyDescriptor_description", "_UI_NamedElement_entityName_feature", "_UI_NamedElement_type"),
90                                 EntityPackage.Literals.NAMED_ELEMENT__ENTITY_NAME,
91                                 true,
92                                 false,
93                                 false,
94                                 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
95                                 null,
96                                 null));
97        }
98 
99        /**
100         * This returns the label text for the adapted class.
101         * <!-- begin-user-doc -->
102         * <!-- end-user-doc -->
103         * @generated
104         */
105        @Override
106        public String getText(Object object) {
107                String label = ((Entity)object).getId();
108                return label == null || label.length() == 0 ?
109                        getString("_UI_Entity_type") :
110                        getString("_UI_Entity_type") + " " + label;
111        }
112 
113        /**
114         * This handles model notifications by calling {@link #updateChildren} to update any cached
115         * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
116         * <!-- begin-user-doc -->
117         * <!-- end-user-doc -->
118         * @generated
119         */
120        @Override
121        public void notifyChanged(Notification notification) {
122                updateChildren(notification);
123 
124                switch (notification.getFeatureID(Entity.class)) {
125                        case EntityPackage.ENTITY__ENTITY_NAME:
126                                fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
127                                return;
128                }
129                super.notifyChanged(notification);
130        }
131 
132        /**
133         * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
134         * that can be created under this object.
135         * <!-- begin-user-doc -->
136         * <!-- end-user-doc -->
137         * @generated
138         */
139        @Override
140        protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
141                super.collectNewChildDescriptors(newChildDescriptors, object);
142        }
143 
144        /**
145         * Return the resource locator for this item provider's resources.
146         * <!-- begin-user-doc -->
147         * <!-- end-user-doc -->
148         * @generated
149         */
150        @Override
151        public ResourceLocator getResourceLocator() {
152                return PalladioComponentModelEditPlugin.INSTANCE;
153        }
154 
155}

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