1 | /** |
2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
3 | * |
4 | * $Id$ |
5 | */ |
6 | package de.uka.ipd.sdq.pcm.seff.provider; |
7 | |
8 | |
9 | import java.util.Collection; |
10 | import java.util.List; |
11 | |
12 | import org.eclipse.emf.common.notify.AdapterFactory; |
13 | import org.eclipse.emf.common.notify.Notification; |
14 | import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; |
15 | import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; |
16 | import org.eclipse.emf.edit.provider.IItemLabelProvider; |
17 | import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; |
18 | import org.eclipse.emf.edit.provider.IItemPropertySource; |
19 | import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; |
20 | import org.eclipse.emf.edit.provider.ITreeItemContentProvider; |
21 | import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; |
22 | import org.eclipse.emf.edit.provider.ViewerNotification; |
23 | |
24 | import de.uka.ipd.sdq.pcm.seff.AcquireAction; |
25 | import de.uka.ipd.sdq.pcm.seff.SeffPackage; |
26 | |
27 | /** |
28 | * This is the item provider adapter for a {@link de.uka.ipd.sdq.pcm.seff.AcquireAction} object. |
29 | * <!-- begin-user-doc --> |
30 | * <!-- end-user-doc --> |
31 | * @generated |
32 | */ |
33 | public class AcquireActionItemProvider |
34 | extends AbstractInternalControlFlowActionItemProvider |
35 | implements |
36 | IEditingDomainItemProvider, |
37 | IStructuredItemContentProvider, |
38 | ITreeItemContentProvider, |
39 | IItemLabelProvider, |
40 | IItemPropertySource { |
41 | /** |
42 | * <!-- begin-user-doc --> |
43 | * <!-- end-user-doc --> |
44 | * @generated |
45 | */ |
46 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
47 | |
48 | /** |
49 | * This constructs an instance from a factory and a notifier. |
50 | * <!-- begin-user-doc --> |
51 | * <!-- end-user-doc --> |
52 | * @generated |
53 | */ |
54 | public AcquireActionItemProvider(AdapterFactory adapterFactory) { |
55 | super(adapterFactory); |
56 | } |
57 | |
58 | /** |
59 | * This returns the property descriptors for the adapted class. |
60 | * <!-- begin-user-doc --> |
61 | * <!-- end-user-doc --> |
62 | * @generated |
63 | */ |
64 | @Override |
65 | public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { |
66 | if (itemPropertyDescriptors == null) { |
67 | super.getPropertyDescriptors(object); |
68 | |
69 | addPassiveresource_AcquireActionPropertyDescriptor(object); |
70 | addTimeoutPropertyDescriptor(object); |
71 | addTimeoutValuePropertyDescriptor(object); |
72 | } |
73 | return itemPropertyDescriptors; |
74 | } |
75 | |
76 | /** |
77 | * This adds a property descriptor for the Passiveresource Acquire Action feature. |
78 | * <!-- begin-user-doc --> |
79 | * <!-- end-user-doc --> |
80 | * @generated |
81 | */ |
82 | protected void addPassiveresource_AcquireActionPropertyDescriptor(Object object) { |
83 | itemPropertyDescriptors.add |
84 | (createItemPropertyDescriptor |
85 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
86 | getResourceLocator(), |
87 | getString("_UI_AcquireAction_passiveresource_AcquireAction_feature"), |
88 | getString("_UI_PropertyDescriptor_description", "_UI_AcquireAction_passiveresource_AcquireAction_feature", "_UI_AcquireAction_type"), |
89 | SeffPackage.Literals.ACQUIRE_ACTION__PASSIVERESOURCE_ACQUIRE_ACTION, |
90 | true, |
91 | false, |
92 | true, |
93 | null, |
94 | null, |
95 | null)); |
96 | } |
97 | |
98 | /** |
99 | * This adds a property descriptor for the Timeout feature. |
100 | * <!-- begin-user-doc --> |
101 | * <!-- end-user-doc --> |
102 | * @generated |
103 | */ |
104 | protected void addTimeoutPropertyDescriptor(Object object) { |
105 | itemPropertyDescriptors.add |
106 | (createItemPropertyDescriptor |
107 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
108 | getResourceLocator(), |
109 | getString("_UI_AcquireAction_timeout_feature"), |
110 | getString("_UI_PropertyDescriptor_description", "_UI_AcquireAction_timeout_feature", "_UI_AcquireAction_type"), |
111 | SeffPackage.Literals.ACQUIRE_ACTION__TIMEOUT, |
112 | true, |
113 | false, |
114 | false, |
115 | ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, |
116 | null, |
117 | null)); |
118 | } |
119 | |
120 | /** |
121 | * This adds a property descriptor for the Timeout Value feature. |
122 | * <!-- begin-user-doc --> |
123 | * <!-- end-user-doc --> |
124 | * @generated |
125 | */ |
126 | protected void addTimeoutValuePropertyDescriptor(Object object) { |
127 | itemPropertyDescriptors.add |
128 | (createItemPropertyDescriptor |
129 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
130 | getResourceLocator(), |
131 | getString("_UI_AcquireAction_timeoutValue_feature"), |
132 | getString("_UI_PropertyDescriptor_description", "_UI_AcquireAction_timeoutValue_feature", "_UI_AcquireAction_type"), |
133 | SeffPackage.Literals.ACQUIRE_ACTION__TIMEOUT_VALUE, |
134 | true, |
135 | false, |
136 | false, |
137 | ItemPropertyDescriptor.REAL_VALUE_IMAGE, |
138 | null, |
139 | null)); |
140 | } |
141 | |
142 | /** |
143 | * This returns AcquireAction.gif. |
144 | * <!-- begin-user-doc --> |
145 | * <!-- end-user-doc --> |
146 | * @generated |
147 | */ |
148 | @Override |
149 | public Object getImage(Object object) { |
150 | return overlayImage(object, getResourceLocator().getImage("full/obj16/AcquireAction")); |
151 | } |
152 | |
153 | /** |
154 | * This returns the label text for the adapted class. |
155 | * <!-- begin-user-doc --> |
156 | * <!-- end-user-doc --> |
157 | * @generated |
158 | */ |
159 | @Override |
160 | public String getText(Object object) { |
161 | String label = ((AcquireAction)object).getId(); |
162 | return label == null || label.length() == 0 ? |
163 | getString("_UI_AcquireAction_type") : |
164 | getString("_UI_AcquireAction_type") + " " + label; |
165 | } |
166 | |
167 | /** |
168 | * This handles model notifications by calling {@link #updateChildren} to update any cached |
169 | * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. |
170 | * <!-- begin-user-doc --> |
171 | * <!-- end-user-doc --> |
172 | * @generated |
173 | */ |
174 | @Override |
175 | public void notifyChanged(Notification notification) { |
176 | updateChildren(notification); |
177 | |
178 | switch (notification.getFeatureID(AcquireAction.class)) { |
179 | case SeffPackage.ACQUIRE_ACTION__TIMEOUT: |
180 | case SeffPackage.ACQUIRE_ACTION__TIMEOUT_VALUE: |
181 | fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); |
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 | |
199 | } |