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.edit.provider.ComposeableAdapterFactory; |
16 | import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; |
17 | import org.eclipse.emf.edit.provider.IItemLabelProvider; |
18 | import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; |
19 | import org.eclipse.emf.edit.provider.IItemPropertySource; |
20 | import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; |
21 | import org.eclipse.emf.edit.provider.ITreeItemContentProvider; |
22 | |
23 | import de.uka.ipd.sdq.sensitivity.InternalActionReliabilityParameter; |
24 | import de.uka.ipd.sdq.sensitivity.SensitivityPackage; |
25 | |
26 | /** |
27 | * This is the item provider adapter for a {@link de.uka.ipd.sdq.sensitivity.InternalActionReliabilityParameter} object. |
28 | * <!-- begin-user-doc --> |
29 | * <!-- end-user-doc --> |
30 | * @generated |
31 | */ |
32 | public class InternalActionReliabilityParameterItemProvider |
33 | extends SingleSensitivityParameterItemProvider |
34 | implements |
35 | IEditingDomainItemProvider, |
36 | IStructuredItemContentProvider, |
37 | ITreeItemContentProvider, |
38 | IItemLabelProvider, |
39 | IItemPropertySource { |
40 | /** |
41 | * This constructs an instance from a factory and a notifier. |
42 | * <!-- begin-user-doc --> |
43 | * <!-- end-user-doc --> |
44 | * @generated |
45 | */ |
46 | public InternalActionReliabilityParameterItemProvider(AdapterFactory adapterFactory) { |
47 | super(adapterFactory); |
48 | } |
49 | |
50 | /** |
51 | * This returns the property descriptors for the adapted class. |
52 | * <!-- begin-user-doc --> |
53 | * <!-- end-user-doc --> |
54 | * @generated |
55 | */ |
56 | @Override |
57 | public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { |
58 | if (itemPropertyDescriptors == null) { |
59 | super.getPropertyDescriptors(object); |
60 | |
61 | addSoftwareInducedFailureType__InternalActionReliabilityParameterPropertyDescriptor(object); |
62 | addInternalAction__InternalActionReliabilityParameterPropertyDescriptor(object); |
63 | } |
64 | return itemPropertyDescriptors; |
65 | } |
66 | |
67 | /** |
68 | * This adds a property descriptor for the Software Induced Failure Type Internal Action Reliability Parameter feature. |
69 | * <!-- begin-user-doc --> |
70 | * <!-- end-user-doc --> |
71 | * @generated |
72 | */ |
73 | protected void addSoftwareInducedFailureType__InternalActionReliabilityParameterPropertyDescriptor(Object object) { |
74 | itemPropertyDescriptors.add |
75 | (createItemPropertyDescriptor |
76 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
77 | getResourceLocator(), |
78 | getString("_UI_InternalActionReliabilityParameter_softwareInducedFailureType__InternalActionReliabilityParameter_feature"), |
79 | getString("_UI_PropertyDescriptor_description", "_UI_InternalActionReliabilityParameter_softwareInducedFailureType__InternalActionReliabilityParameter_feature", "_UI_InternalActionReliabilityParameter_type"), |
80 | SensitivityPackage.Literals.INTERNAL_ACTION_RELIABILITY_PARAMETER__SOFTWARE_INDUCED_FAILURE_TYPE_INTERNAL_ACTION_RELIABILITY_PARAMETER, |
81 | true, |
82 | false, |
83 | true, |
84 | null, |
85 | null, |
86 | null)); |
87 | } |
88 | |
89 | /** |
90 | * This adds a property descriptor for the Internal Action Internal Action Reliability Parameter feature. |
91 | * <!-- begin-user-doc --> |
92 | * <!-- end-user-doc --> |
93 | * @generated |
94 | */ |
95 | protected void addInternalAction__InternalActionReliabilityParameterPropertyDescriptor(Object object) { |
96 | itemPropertyDescriptors.add |
97 | (createItemPropertyDescriptor |
98 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
99 | getResourceLocator(), |
100 | getString("_UI_InternalActionReliabilityParameter_internalAction__InternalActionReliabilityParameter_feature"), |
101 | getString("_UI_PropertyDescriptor_description", "_UI_InternalActionReliabilityParameter_internalAction__InternalActionReliabilityParameter_feature", "_UI_InternalActionReliabilityParameter_type"), |
102 | SensitivityPackage.Literals.INTERNAL_ACTION_RELIABILITY_PARAMETER__INTERNAL_ACTION_INTERNAL_ACTION_RELIABILITY_PARAMETER, |
103 | true, |
104 | false, |
105 | true, |
106 | null, |
107 | null, |
108 | null)); |
109 | } |
110 | |
111 | /** |
112 | * This returns InternalActionReliabilityParameter.gif. |
113 | * <!-- begin-user-doc --> |
114 | * <!-- end-user-doc --> |
115 | * @generated |
116 | */ |
117 | @Override |
118 | public Object getImage(Object object) { |
119 | return overlayImage(object, getResourceLocator().getImage("full/obj16/InternalActionReliabilityParameter")); |
120 | } |
121 | |
122 | /** |
123 | * This returns the label text for the adapted class. |
124 | * <!-- begin-user-doc --> |
125 | * <!-- end-user-doc --> |
126 | * @generated not |
127 | */ |
128 | @Override |
129 | public String getText(Object object) { |
130 | String internalActionName = "UNSPECIFIED"; |
131 | try { |
132 | internalActionName = ((InternalActionReliabilityParameter)object). |
133 | getInternalAction__InternalActionReliabilityParameter().getEntityName(); |
134 | } catch(Exception e) {} |
135 | String failureTypeName = "UNSPECIFIED"; |
136 | try { |
137 | failureTypeName = ((InternalActionReliabilityParameter)object). |
138 | getSoftwareInducedFailureType__InternalActionReliabilityParameter(). |
139 | getEntityName(); |
140 | } catch(Exception e) {} |
141 | return ((InternalActionReliabilityParameter)object).getEntityName() |
142 | + " (" + internalActionName + "/" + failureTypeName + ")" |
143 | + " [ID: " + ((InternalActionReliabilityParameter)object).getId() + "]" |
144 | + " <" + getString("_UI_InternalActionReliabilityParameter_type") + ">"; |
145 | } |
146 | |
147 | /** |
148 | * This handles model notifications by calling {@link #updateChildren} to update any cached |
149 | * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. |
150 | * <!-- begin-user-doc --> |
151 | * <!-- end-user-doc --> |
152 | * @generated |
153 | */ |
154 | @Override |
155 | public void notifyChanged(Notification notification) { |
156 | updateChildren(notification); |
157 | super.notifyChanged(notification); |
158 | } |
159 | |
160 | /** |
161 | * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children |
162 | * that can be created under this object. |
163 | * <!-- begin-user-doc --> |
164 | * <!-- end-user-doc --> |
165 | * @generated |
166 | */ |
167 | @Override |
168 | protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { |
169 | super.collectNewChildDescriptors(newChildDescriptors, object); |
170 | } |
171 | |
172 | } |