1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.fzi.se.quality.parameters.pcm.provider; |
8 | |
9 | |
10 | import de.fzi.se.quality.parameters.pcm.PCMPackage; |
11 | import de.fzi.se.quality.parameters.pcm.PCMRequiredBusinessOperationReturnParameterReference; |
12 | |
13 | import java.util.Collection; |
14 | import java.util.List; |
15 | |
16 | import org.eclipse.emf.common.notify.AdapterFactory; |
17 | import org.eclipse.emf.common.notify.Notification; |
18 | |
19 | import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; |
20 | import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; |
21 | import org.eclipse.emf.edit.provider.IItemLabelProvider; |
22 | import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; |
23 | import org.eclipse.emf.edit.provider.IItemPropertySource; |
24 | import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; |
25 | import org.eclipse.emf.edit.provider.ITreeItemContentProvider; |
26 | |
27 | /** |
28 | * This is the item provider adapter for a {@link de.fzi.se.quality.parameters.pcm.PCMRequiredBusinessOperationReturnParameterReference} object. |
29 | * <!-- begin-user-doc --> |
30 | * <!-- end-user-doc --> |
31 | * @generated |
32 | */ |
33 | public class PCMRequiredBusinessOperationReturnParameterReferenceItemProvider |
34 | extends PCMParameterReferenceItemProvider |
35 | implements |
36 | IEditingDomainItemProvider, |
37 | IStructuredItemContentProvider, |
38 | ITreeItemContentProvider, |
39 | IItemLabelProvider, |
40 | IItemPropertySource { |
41 | /** |
42 | * This constructs an instance from a factory and a notifier. |
43 | * <!-- begin-user-doc --> |
44 | * <!-- end-user-doc --> |
45 | * @generated |
46 | */ |
47 | public PCMRequiredBusinessOperationReturnParameterReferenceItemProvider(AdapterFactory adapterFactory) { |
48 | super(adapterFactory); |
49 | } |
50 | |
51 | /** |
52 | * This returns the property descriptors for the adapted class. |
53 | * <!-- begin-user-doc --> |
54 | * <!-- end-user-doc --> |
55 | * @generated |
56 | */ |
57 | @Override |
58 | public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { |
59 | if (itemPropertyDescriptors == null) { |
60 | super.getPropertyDescriptors(object); |
61 | |
62 | addRequiredRolePropertyDescriptor(object); |
63 | addSignaturePropertyDescriptor(object); |
64 | } |
65 | return itemPropertyDescriptors; |
66 | } |
67 | |
68 | /** |
69 | * This adds a property descriptor for the Required Role feature. |
70 | * <!-- begin-user-doc --> |
71 | * <!-- end-user-doc --> |
72 | * @generated |
73 | */ |
74 | protected void addRequiredRolePropertyDescriptor(Object object) { |
75 | itemPropertyDescriptors.add |
76 | (createItemPropertyDescriptor |
77 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
78 | getResourceLocator(), |
79 | getString("_UI_PCMRequiredBusinessOperationReturnParameterReference_requiredRole_feature"), |
80 | getString("_UI_PropertyDescriptor_description", "_UI_PCMRequiredBusinessOperationReturnParameterReference_requiredRole_feature", "_UI_PCMRequiredBusinessOperationReturnParameterReference_type"), |
81 | PCMPackage.Literals.PCM_REQUIRED_BUSINESS_OPERATION_RETURN_PARAMETER_REFERENCE__REQUIRED_ROLE, |
82 | true, |
83 | false, |
84 | true, |
85 | null, |
86 | null, |
87 | null)); |
88 | } |
89 | |
90 | /** |
91 | * This adds a property descriptor for the Signature feature. |
92 | * <!-- begin-user-doc --> |
93 | * <!-- end-user-doc --> |
94 | * @generated |
95 | */ |
96 | protected void addSignaturePropertyDescriptor(Object object) { |
97 | itemPropertyDescriptors.add |
98 | (createItemPropertyDescriptor |
99 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
100 | getResourceLocator(), |
101 | getString("_UI_PCMRequiredBusinessOperationReturnParameterReference_signature_feature"), |
102 | getString("_UI_PropertyDescriptor_description", "_UI_PCMRequiredBusinessOperationReturnParameterReference_signature_feature", "_UI_PCMRequiredBusinessOperationReturnParameterReference_type"), |
103 | PCMPackage.Literals.PCM_REQUIRED_BUSINESS_OPERATION_RETURN_PARAMETER_REFERENCE__SIGNATURE, |
104 | true, |
105 | false, |
106 | true, |
107 | null, |
108 | null, |
109 | null)); |
110 | } |
111 | |
112 | /** |
113 | * This returns PCMRequiredBusinessOperationReturnParameterReference.gif. |
114 | * <!-- begin-user-doc --> |
115 | * <!-- end-user-doc --> |
116 | * @generated |
117 | */ |
118 | @Override |
119 | public Object getImage(Object object) { |
120 | return overlayImage(object, getResourceLocator().getImage("full/obj16/PCMRequiredBusinessOperationReturnParameterReference")); |
121 | } |
122 | |
123 | /** |
124 | * This returns the label text for the adapted class. |
125 | * <!-- begin-user-doc --> |
126 | * <!-- end-user-doc --> |
127 | * @generated |
128 | */ |
129 | @Override |
130 | public String getText(Object object) { |
131 | String label = ((PCMRequiredBusinessOperationReturnParameterReference)object).getId(); |
132 | return label == null || label.length() == 0 ? |
133 | getString("_UI_PCMRequiredBusinessOperationReturnParameterReference_type") : |
134 | getString("_UI_PCMRequiredBusinessOperationReturnParameterReference_type") + " " + label; |
135 | } |
136 | |
137 | /** |
138 | * This handles model notifications by calling {@link #updateChildren} to update any cached |
139 | * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. |
140 | * <!-- begin-user-doc --> |
141 | * <!-- end-user-doc --> |
142 | * @generated |
143 | */ |
144 | @Override |
145 | public void notifyChanged(Notification notification) { |
146 | updateChildren(notification); |
147 | super.notifyChanged(notification); |
148 | } |
149 | |
150 | /** |
151 | * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children |
152 | * that can be created under this object. |
153 | * <!-- begin-user-doc --> |
154 | * <!-- end-user-doc --> |
155 | * @generated |
156 | */ |
157 | @Override |
158 | protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { |
159 | super.collectNewChildDescriptors(newChildDescriptors, object); |
160 | } |
161 | |
162 | } |