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.ComponentReliabilityParameter; |
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.ComponentReliabilityParameter} object. |
28 | * <!-- begin-user-doc --> |
29 | * <!-- end-user-doc --> |
30 | * @generated |
31 | */ |
32 | public class ComponentReliabilityParameterItemProvider |
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 ComponentReliabilityParameterItemProvider(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 | addBasicComponent__ComponentReliabilityParameterPropertyDescriptor(object); |
62 | } |
63 | return itemPropertyDescriptors; |
64 | } |
65 | |
66 | /** |
67 | * This adds a property descriptor for the Basic Component Component Reliability Parameter feature. |
68 | * <!-- begin-user-doc --> |
69 | * <!-- end-user-doc --> |
70 | * @generated |
71 | */ |
72 | protected void addBasicComponent__ComponentReliabilityParameterPropertyDescriptor(Object object) { |
73 | itemPropertyDescriptors.add |
74 | (createItemPropertyDescriptor |
75 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
76 | getResourceLocator(), |
77 | getString("_UI_ComponentReliabilityParameter_basicComponent__ComponentReliabilityParameter_feature"), |
78 | getString("_UI_PropertyDescriptor_description", "_UI_ComponentReliabilityParameter_basicComponent__ComponentReliabilityParameter_feature", "_UI_ComponentReliabilityParameter_type"), |
79 | SensitivityPackage.Literals.COMPONENT_RELIABILITY_PARAMETER__BASIC_COMPONENT_COMPONENT_RELIABILITY_PARAMETER, |
80 | true, |
81 | false, |
82 | true, |
83 | null, |
84 | null, |
85 | null)); |
86 | } |
87 | |
88 | /** |
89 | * This returns ComponentReliabilityParameter.gif. |
90 | * <!-- begin-user-doc --> |
91 | * <!-- end-user-doc --> |
92 | * @generated |
93 | */ |
94 | @Override |
95 | public Object getImage(Object object) { |
96 | return overlayImage(object, getResourceLocator().getImage("full/obj16/ComponentReliabilityParameter")); |
97 | } |
98 | |
99 | /** |
100 | * This returns the label text for the adapted class. |
101 | * <!-- begin-user-doc --> |
102 | * <!-- end-user-doc --> |
103 | * @generated not |
104 | */ |
105 | @Override |
106 | public String getText(Object object) { |
107 | String componentName = "UNSPECIFIED"; |
108 | try { |
109 | componentName = ((ComponentReliabilityParameter)object). |
110 | getBasicComponent__ComponentReliabilityParameter(). |
111 | getEntityName(); |
112 | } catch(Exception e) {} |
113 | return ((ComponentReliabilityParameter)object).getEntityName() |
114 | + " (" + componentName + ")" |
115 | + " [ID: " + ((ComponentReliabilityParameter)object).getId() + "]" |
116 | + " <" + getString("_UI_ComponentReliabilityParameter_type") + ">"; |
117 | } |
118 | |
119 | /** |
120 | * This handles model notifications by calling {@link #updateChildren} to update any cached |
121 | * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. |
122 | * <!-- begin-user-doc --> |
123 | * <!-- end-user-doc --> |
124 | * @generated |
125 | */ |
126 | @Override |
127 | public void notifyChanged(Notification notification) { |
128 | updateChildren(notification); |
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 | } |