1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package EMOF.provider; |
8 | |
9 | |
10 | import EMOF.PrimitiveType; |
11 | |
12 | import java.util.Collection; |
13 | import java.util.List; |
14 | |
15 | import org.eclipse.emf.common.notify.AdapterFactory; |
16 | import org.eclipse.emf.common.notify.Notification; |
17 | |
18 | import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; |
19 | import org.eclipse.emf.edit.provider.IItemLabelProvider; |
20 | import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; |
21 | import org.eclipse.emf.edit.provider.IItemPropertySource; |
22 | import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; |
23 | import org.eclipse.emf.edit.provider.ITreeItemContentProvider; |
24 | |
25 | /** |
26 | * This is the item provider adapter for a {@link EMOF.PrimitiveType} object. |
27 | * <!-- begin-user-doc --> |
28 | * <!-- end-user-doc --> |
29 | * @generated |
30 | */ |
31 | public class PrimitiveTypeItemProvider |
32 | extends DataTypeItemProvider |
33 | implements |
34 | IEditingDomainItemProvider, |
35 | IStructuredItemContentProvider, |
36 | ITreeItemContentProvider, |
37 | IItemLabelProvider, |
38 | IItemPropertySource { |
39 | /** |
40 | * This constructs an instance from a factory and a notifier. |
41 | * <!-- begin-user-doc --> |
42 | * <!-- end-user-doc --> |
43 | * @generated |
44 | */ |
45 | public PrimitiveTypeItemProvider(AdapterFactory adapterFactory) { |
46 | super(adapterFactory); |
47 | } |
48 | |
49 | /** |
50 | * This returns the property descriptors for the adapted class. |
51 | * <!-- begin-user-doc --> |
52 | * <!-- end-user-doc --> |
53 | * @generated |
54 | */ |
55 | @Override |
56 | public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { |
57 | if (itemPropertyDescriptors == null) { |
58 | super.getPropertyDescriptors(object); |
59 | |
60 | } |
61 | return itemPropertyDescriptors; |
62 | } |
63 | |
64 | /** |
65 | * This returns PrimitiveType.gif. |
66 | * <!-- begin-user-doc --> |
67 | * <!-- end-user-doc --> |
68 | * @generated |
69 | */ |
70 | @Override |
71 | public Object getImage(Object object) { |
72 | return overlayImage(object, getResourceLocator().getImage("full/obj16/PrimitiveType")); |
73 | } |
74 | |
75 | /** |
76 | * This returns the label text for the adapted class. |
77 | * <!-- begin-user-doc --> |
78 | * <!-- end-user-doc --> |
79 | * @generated |
80 | */ |
81 | @Override |
82 | public String getText(Object object) { |
83 | String label = ((PrimitiveType)object).getName(); |
84 | return label == null || label.length() == 0 ? |
85 | getString("_UI_PrimitiveType_type") : |
86 | getString("_UI_PrimitiveType_type") + " " + label; |
87 | } |
88 | |
89 | /** |
90 | * This handles model notifications by calling {@link #updateChildren} to update any cached |
91 | * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. |
92 | * <!-- begin-user-doc --> |
93 | * <!-- end-user-doc --> |
94 | * @generated |
95 | */ |
96 | @Override |
97 | public void notifyChanged(Notification notification) { |
98 | updateChildren(notification); |
99 | super.notifyChanged(notification); |
100 | } |
101 | |
102 | /** |
103 | * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children |
104 | * that can be created under this object. |
105 | * <!-- begin-user-doc --> |
106 | * <!-- end-user-doc --> |
107 | * @generated |
108 | */ |
109 | @Override |
110 | protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { |
111 | super.collectNewChildDescriptors(newChildDescriptors, object); |
112 | } |
113 | |
114 | } |