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.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.pcm.core.entity.provider.EntityItemProvider; |
24 | import de.uka.ipd.sdq.sensitivity.SensitivityParameter; |
25 | |
26 | /** |
27 | * This is the item provider adapter for a {@link de.uka.ipd.sdq.sensitivity.SensitivityParameter} object. |
28 | * <!-- begin-user-doc --> |
29 | * <!-- end-user-doc --> |
30 | * @generated |
31 | */ |
32 | public class SensitivityParameterItemProvider |
33 | extends EntityItemProvider |
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 SensitivityParameterItemProvider(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 | } |
62 | return itemPropertyDescriptors; |
63 | } |
64 | |
65 | /** |
66 | * This returns the label text for the adapted class. |
67 | * <!-- begin-user-doc --> |
68 | * <!-- end-user-doc --> |
69 | * @generated |
70 | */ |
71 | @Override |
72 | public String getText(Object object) { |
73 | String label = ((SensitivityParameter)object).getId(); |
74 | return label == null || label.length() == 0 ? |
75 | getString("_UI_SensitivityParameter_type") : |
76 | getString("_UI_SensitivityParameter_type") + " " + label; |
77 | } |
78 | |
79 | /** |
80 | * This handles model notifications by calling {@link #updateChildren} to update any cached |
81 | * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. |
82 | * <!-- begin-user-doc --> |
83 | * <!-- end-user-doc --> |
84 | * @generated |
85 | */ |
86 | @Override |
87 | public void notifyChanged(Notification notification) { |
88 | updateChildren(notification); |
89 | super.notifyChanged(notification); |
90 | } |
91 | |
92 | /** |
93 | * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children |
94 | * that can be created under this object. |
95 | * <!-- begin-user-doc --> |
96 | * <!-- end-user-doc --> |
97 | * @generated |
98 | */ |
99 | @Override |
100 | protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { |
101 | super.collectNewChildDescriptors(newChildDescriptors, object); |
102 | } |
103 | |
104 | /** |
105 | * Return the resource locator for this item provider's resources. |
106 | * <!-- begin-user-doc --> |
107 | * <!-- end-user-doc --> |
108 | * @generated |
109 | */ |
110 | @Override |
111 | public ResourceLocator getResourceLocator() { |
112 | return SensitivityEditPlugin.INSTANCE; |
113 | } |
114 | |
115 | } |