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