1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.pcm.designdecision.provider; |
8 | |
9 | |
10 | import de.uka.ipd.sdq.pcm.designdecision.OrderedIntegerDegree; |
11 | import de.uka.ipd.sdq.pcm.designdecision.designdecisionPackage; |
12 | |
13 | import java.util.Collection; |
14 | import java.util.List; |
15 | |
16 | import org.eclipse.emf.common.notify.AdapterFactory; |
17 | import org.eclipse.emf.common.notify.Notification; |
18 | |
19 | import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; |
20 | import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; |
21 | import org.eclipse.emf.edit.provider.IItemLabelProvider; |
22 | import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; |
23 | import org.eclipse.emf.edit.provider.IItemPropertySource; |
24 | import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; |
25 | import org.eclipse.emf.edit.provider.ITreeItemContentProvider; |
26 | import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; |
27 | import org.eclipse.emf.edit.provider.ViewerNotification; |
28 | |
29 | /** |
30 | * This is the item provider adapter for a {@link de.uka.ipd.sdq.pcm.designdecision.OrderedIntegerDegree} object. |
31 | * <!-- begin-user-doc --> |
32 | * <!-- end-user-doc --> |
33 | * @generated |
34 | */ |
35 | public class OrderedIntegerDegreeItemProvider |
36 | extends DiscreteDegreeItemProvider |
37 | implements |
38 | IEditingDomainItemProvider, |
39 | IStructuredItemContentProvider, |
40 | ITreeItemContentProvider, |
41 | IItemLabelProvider, |
42 | IItemPropertySource { |
43 | /** |
44 | * This constructs an instance from a factory and a notifier. |
45 | * <!-- begin-user-doc --> |
46 | * <!-- end-user-doc --> |
47 | * @generated |
48 | */ |
49 | public OrderedIntegerDegreeItemProvider(AdapterFactory adapterFactory) { |
50 | super(adapterFactory); |
51 | } |
52 | |
53 | /** |
54 | * This returns the property descriptors for the adapted class. |
55 | * <!-- begin-user-doc --> |
56 | * <!-- end-user-doc --> |
57 | * @generated |
58 | */ |
59 | @Override |
60 | public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { |
61 | if (itemPropertyDescriptors == null) { |
62 | super.getPropertyDescriptors(object); |
63 | |
64 | addListOfIntegersPropertyDescriptor(object); |
65 | } |
66 | return itemPropertyDescriptors; |
67 | } |
68 | |
69 | /** |
70 | * This adds a property descriptor for the List Of Integers feature. |
71 | * <!-- begin-user-doc --> |
72 | * <!-- end-user-doc --> |
73 | * @generated |
74 | */ |
75 | protected void addListOfIntegersPropertyDescriptor(Object object) { |
76 | itemPropertyDescriptors.add |
77 | (createItemPropertyDescriptor |
78 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
79 | getResourceLocator(), |
80 | getString("_UI_OrderedIntegerDegree_listOfIntegers_feature"), |
81 | getString("_UI_PropertyDescriptor_description", "_UI_OrderedIntegerDegree_listOfIntegers_feature", "_UI_OrderedIntegerDegree_type"), |
82 | designdecisionPackage.Literals.ORDERED_INTEGER_DEGREE__LIST_OF_INTEGERS, |
83 | true, |
84 | false, |
85 | false, |
86 | ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, |
87 | null, |
88 | null)); |
89 | } |
90 | |
91 | /** |
92 | * This returns OrderedIntegerDegree.gif. |
93 | * <!-- begin-user-doc --> |
94 | * <!-- end-user-doc --> |
95 | * @generated |
96 | */ |
97 | @Override |
98 | public Object getImage(Object object) { |
99 | return overlayImage(object, getResourceLocator().getImage("full/obj16/OrderedIntegerDegree")); |
100 | } |
101 | |
102 | /** |
103 | * This returns the label text for the adapted class. |
104 | * <!-- begin-user-doc --> |
105 | * <!-- end-user-doc --> |
106 | * @generated |
107 | */ |
108 | @Override |
109 | public String getText(Object object) { |
110 | return getString("_UI_OrderedIntegerDegree_type"); |
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(OrderedIntegerDegree.class)) { |
125 | case designdecisionPackage.ORDERED_INTEGER_DEGREE__LIST_OF_INTEGERS: |
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 | } |