1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.sensitivity.provider; |
8 | |
9 | |
10 | import java.util.Collection; |
11 | import java.util.List; |
12 | |
13 | import org.eclipse.emf.common.notify.AdapterFactory; |
14 | import org.eclipse.emf.common.notify.Notification; |
15 | import org.eclipse.emf.common.util.ResourceLocator; |
16 | import org.eclipse.emf.ecore.EStructuralFeature; |
17 | import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; |
18 | import org.eclipse.emf.edit.provider.IItemLabelProvider; |
19 | import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; |
20 | import org.eclipse.emf.edit.provider.IItemPropertySource; |
21 | import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; |
22 | import org.eclipse.emf.edit.provider.ITreeItemContentProvider; |
23 | import org.eclipse.emf.edit.provider.ViewerNotification; |
24 | |
25 | import de.uka.ipd.sdq.pcm.core.entity.provider.EntityItemProvider; |
26 | import de.uka.ipd.sdq.sensitivity.SensitivityConfiguration; |
27 | import de.uka.ipd.sdq.sensitivity.SensitivityFactory; |
28 | import de.uka.ipd.sdq.sensitivity.SensitivityPackage; |
29 | |
30 | /** |
31 | * This is the item provider adapter for a {@link de.uka.ipd.sdq.sensitivity.SensitivityConfiguration} object. |
32 | * <!-- begin-user-doc --> |
33 | * <!-- end-user-doc --> |
34 | * @generated |
35 | */ |
36 | public class SensitivityConfigurationItemProvider |
37 | extends EntityItemProvider |
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 SensitivityConfigurationItemProvider(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 specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an |
71 | * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or |
72 | * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. |
73 | * <!-- begin-user-doc --> |
74 | * <!-- end-user-doc --> |
75 | * @generated |
76 | */ |
77 | @Override |
78 | public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) { |
79 | if (childrenFeatures == null) { |
80 | super.getChildrenFeatures(object); |
81 | childrenFeatures.add(SensitivityPackage.Literals.SENSITIVITY_CONFIGURATION__SENSITIVITY_PARAMETERS_SENSITIVITY_CONFIGURATION); |
82 | childrenFeatures.add(SensitivityPackage.Literals.SENSITIVITY_CONFIGURATION__SENSITIVITY_RESULT_SPECIFICATIONS_SENSITIVITY_CONFIGURATION); |
83 | } |
84 | return childrenFeatures; |
85 | } |
86 | |
87 | /** |
88 | * <!-- begin-user-doc --> |
89 | * <!-- end-user-doc --> |
90 | * @generated |
91 | */ |
92 | @Override |
93 | protected EStructuralFeature getChildFeature(Object object, Object child) { |
94 | // Check the type of the specified child object and return the proper feature to use for |
95 | // adding (see {@link AddCommand}) it as a child. |
96 | |
97 | return super.getChildFeature(object, child); |
98 | } |
99 | |
100 | /** |
101 | * This returns SensitivityConfiguration.gif. |
102 | * <!-- begin-user-doc --> |
103 | * <!-- end-user-doc --> |
104 | * @generated |
105 | */ |
106 | @Override |
107 | public Object getImage(Object object) { |
108 | return overlayImage(object, getResourceLocator().getImage("full/obj16/SensitivityConfiguration")); |
109 | } |
110 | |
111 | /** |
112 | * This returns the label text for the adapted class. |
113 | * <!-- begin-user-doc --> |
114 | * <!-- end-user-doc --> |
115 | * @generated not |
116 | */ |
117 | @Override |
118 | public String getText(Object object) { |
119 | return ((SensitivityConfiguration)object).getEntityName() |
120 | + " [ID: " + ((SensitivityConfiguration)object).getId() + "]" |
121 | + " <" + getString("_UI_SensitivityConfiguration_type") + ">"; |
122 | } |
123 | |
124 | /** |
125 | * This handles model notifications by calling {@link #updateChildren} to update any cached |
126 | * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. |
127 | * <!-- begin-user-doc --> |
128 | * <!-- end-user-doc --> |
129 | * @generated |
130 | */ |
131 | @Override |
132 | public void notifyChanged(Notification notification) { |
133 | updateChildren(notification); |
134 | |
135 | switch (notification.getFeatureID(SensitivityConfiguration.class)) { |
136 | case SensitivityPackage.SENSITIVITY_CONFIGURATION__SENSITIVITY_PARAMETERS_SENSITIVITY_CONFIGURATION: |
137 | case SensitivityPackage.SENSITIVITY_CONFIGURATION__SENSITIVITY_RESULT_SPECIFICATIONS_SENSITIVITY_CONFIGURATION: |
138 | fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); |
139 | return; |
140 | } |
141 | super.notifyChanged(notification); |
142 | } |
143 | |
144 | /** |
145 | * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children |
146 | * that can be created under this object. |
147 | * <!-- begin-user-doc --> |
148 | * <!-- end-user-doc --> |
149 | * @generated |
150 | */ |
151 | @Override |
152 | protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { |
153 | super.collectNewChildDescriptors(newChildDescriptors, object); |
154 | |
155 | newChildDescriptors.add |
156 | (createChildParameter |
157 | (SensitivityPackage.Literals.SENSITIVITY_CONFIGURATION__SENSITIVITY_PARAMETERS_SENSITIVITY_CONFIGURATION, |
158 | SensitivityFactory.eINSTANCE.createCombinedSensitivityParameter())); |
159 | |
160 | newChildDescriptors.add |
161 | (createChildParameter |
162 | (SensitivityPackage.Literals.SENSITIVITY_CONFIGURATION__SENSITIVITY_PARAMETERS_SENSITIVITY_CONFIGURATION, |
163 | SensitivityFactory.eINSTANCE.createComponentReliabilityParameter())); |
164 | |
165 | newChildDescriptors.add |
166 | (createChildParameter |
167 | (SensitivityPackage.Literals.SENSITIVITY_CONFIGURATION__SENSITIVITY_PARAMETERS_SENSITIVITY_CONFIGURATION, |
168 | SensitivityFactory.eINSTANCE.createInternalActionReliabilityParameter())); |
169 | |
170 | newChildDescriptors.add |
171 | (createChildParameter |
172 | (SensitivityPackage.Literals.SENSITIVITY_CONFIGURATION__SENSITIVITY_PARAMETERS_SENSITIVITY_CONFIGURATION, |
173 | SensitivityFactory.eINSTANCE.createProbabilisticBranchParameter())); |
174 | |
175 | newChildDescriptors.add |
176 | (createChildParameter |
177 | (SensitivityPackage.Literals.SENSITIVITY_CONFIGURATION__SENSITIVITY_PARAMETERS_SENSITIVITY_CONFIGURATION, |
178 | SensitivityFactory.eINSTANCE.createHardwareMTTFParameter())); |
179 | |
180 | newChildDescriptors.add |
181 | (createChildParameter |
182 | (SensitivityPackage.Literals.SENSITIVITY_CONFIGURATION__SENSITIVITY_PARAMETERS_SENSITIVITY_CONFIGURATION, |
183 | SensitivityFactory.eINSTANCE.createHardwareMTTRParameter())); |
184 | |
185 | newChildDescriptors.add |
186 | (createChildParameter |
187 | (SensitivityPackage.Literals.SENSITIVITY_CONFIGURATION__SENSITIVITY_PARAMETERS_SENSITIVITY_CONFIGURATION, |
188 | SensitivityFactory.eINSTANCE.createResourceMTTFParameter())); |
189 | |
190 | newChildDescriptors.add |
191 | (createChildParameter |
192 | (SensitivityPackage.Literals.SENSITIVITY_CONFIGURATION__SENSITIVITY_PARAMETERS_SENSITIVITY_CONFIGURATION, |
193 | SensitivityFactory.eINSTANCE.createResourceMTTRParameter())); |
194 | |
195 | newChildDescriptors.add |
196 | (createChildParameter |
197 | (SensitivityPackage.Literals.SENSITIVITY_CONFIGURATION__SENSITIVITY_PARAMETERS_SENSITIVITY_CONFIGURATION, |
198 | SensitivityFactory.eINSTANCE.createNetworkReliabilityParameter())); |
199 | |
200 | newChildDescriptors.add |
201 | (createChildParameter |
202 | (SensitivityPackage.Literals.SENSITIVITY_CONFIGURATION__SENSITIVITY_PARAMETERS_SENSITIVITY_CONFIGURATION, |
203 | SensitivityFactory.eINSTANCE.createCommunicationLinkReliabilityParameter())); |
204 | |
205 | newChildDescriptors.add |
206 | (createChildParameter |
207 | (SensitivityPackage.Literals.SENSITIVITY_CONFIGURATION__SENSITIVITY_PARAMETERS_SENSITIVITY_CONFIGURATION, |
208 | SensitivityFactory.eINSTANCE.createSoftwareReliabilityParameter())); |
209 | |
210 | newChildDescriptors.add |
211 | (createChildParameter |
212 | (SensitivityPackage.Literals.SENSITIVITY_CONFIGURATION__SENSITIVITY_PARAMETERS_SENSITIVITY_CONFIGURATION, |
213 | SensitivityFactory.eINSTANCE.createVariableUsageParameter())); |
214 | |
215 | newChildDescriptors.add |
216 | (createChildParameter |
217 | (SensitivityPackage.Literals.SENSITIVITY_CONFIGURATION__SENSITIVITY_PARAMETERS_SENSITIVITY_CONFIGURATION, |
218 | SensitivityFactory.eINSTANCE.createUsageBranchParameter())); |
219 | |
220 | newChildDescriptors.add |
221 | (createChildParameter |
222 | (SensitivityPackage.Literals.SENSITIVITY_CONFIGURATION__SENSITIVITY_PARAMETERS_SENSITIVITY_CONFIGURATION, |
223 | SensitivityFactory.eINSTANCE.createSoftwareFailureTypesParameter())); |
224 | |
225 | newChildDescriptors.add |
226 | (createChildParameter |
227 | (SensitivityPackage.Literals.SENSITIVITY_CONFIGURATION__SENSITIVITY_RESULT_SPECIFICATIONS_SENSITIVITY_CONFIGURATION, |
228 | SensitivityFactory.eINSTANCE.createFailureTypeResultSpecification())); |
229 | |
230 | newChildDescriptors.add |
231 | (createChildParameter |
232 | (SensitivityPackage.Literals.SENSITIVITY_CONFIGURATION__SENSITIVITY_RESULT_SPECIFICATIONS_SENSITIVITY_CONFIGURATION, |
233 | SensitivityFactory.eINSTANCE.createFailureDimensionResultSpecification())); |
234 | } |
235 | |
236 | /** |
237 | * Return the resource locator for this item provider's resources. |
238 | * <!-- begin-user-doc --> |
239 | * <!-- end-user-doc --> |
240 | * @generated |
241 | */ |
242 | @Override |
243 | public ResourceLocator getResourceLocator() { |
244 | return SensitivityEditPlugin.INSTANCE; |
245 | } |
246 | |
247 | } |