1 | /** |
2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
3 | * |
4 | * $Id$ |
5 | */ |
6 | package de.uka.ipd.sdq.pcm.core.composition.provider; |
7 | |
8 | |
9 | import java.util.Collection; |
10 | import java.util.List; |
11 | |
12 | import org.eclipse.emf.common.notify.AdapterFactory; |
13 | import org.eclipse.emf.common.notify.Notification; |
14 | import org.eclipse.emf.common.util.ResourceLocator; |
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.pcm.core.composition.AssemblyInfrastructureConnector; |
24 | import de.uka.ipd.sdq.pcm.core.composition.CompositionPackage; |
25 | import de.uka.ipd.sdq.pcm.core.composition.provider.ConnectorItemProvider; |
26 | import de.uka.ipd.sdq.pcm.core.provider.PalladioComponentModelEditPlugin; |
27 | |
28 | /** |
29 | * This is the item provider adapter for a {@link de.uka.ipd.sdq.pcm.core.composition.AssemblyInfrastructureConnector} object. |
30 | * <!-- begin-user-doc --> |
31 | * <!-- end-user-doc --> |
32 | * @generated |
33 | */ |
34 | public class AssemblyInfrastructureConnectorItemProvider |
35 | extends ConnectorItemProvider |
36 | implements |
37 | IEditingDomainItemProvider, |
38 | IStructuredItemContentProvider, |
39 | ITreeItemContentProvider, |
40 | IItemLabelProvider, |
41 | IItemPropertySource { |
42 | /** |
43 | * <!-- begin-user-doc --> |
44 | * <!-- end-user-doc --> |
45 | * @generated |
46 | */ |
47 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
48 | |
49 | /** |
50 | * This constructs an instance from a factory and a notifier. |
51 | * <!-- begin-user-doc --> |
52 | * <!-- end-user-doc --> |
53 | * @generated |
54 | */ |
55 | public AssemblyInfrastructureConnectorItemProvider(AdapterFactory adapterFactory) { |
56 | super(adapterFactory); |
57 | } |
58 | |
59 | /** |
60 | * This returns the property descriptors for the adapted class. |
61 | * <!-- begin-user-doc --> |
62 | * <!-- end-user-doc --> |
63 | * @generated |
64 | */ |
65 | @Override |
66 | public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { |
67 | if (itemPropertyDescriptors == null) { |
68 | super.getPropertyDescriptors(object); |
69 | |
70 | addProvidedRole__AssemblyInfrastructureConnectorPropertyDescriptor(object); |
71 | addRequiredRole__AssemblyInfrastructureConnectorPropertyDescriptor(object); |
72 | addProvidingAssemblyContext__AssemblyInfrastructureConnectorPropertyDescriptor(object); |
73 | addRequiringAssemblyContext__AssemblyInfrastructureConnectorPropertyDescriptor(object); |
74 | } |
75 | return itemPropertyDescriptors; |
76 | } |
77 | |
78 | /** |
79 | * This adds a property descriptor for the Provided Role Assembly Infrastructure Connector feature. |
80 | * <!-- begin-user-doc --> |
81 | * <!-- end-user-doc --> |
82 | * @generated |
83 | */ |
84 | protected void addProvidedRole__AssemblyInfrastructureConnectorPropertyDescriptor(Object object) { |
85 | itemPropertyDescriptors.add |
86 | (createItemPropertyDescriptor |
87 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
88 | getResourceLocator(), |
89 | getString("_UI_AssemblyInfrastructureConnector_providedRole__AssemblyInfrastructureConnector_feature"), |
90 | getString("_UI_PropertyDescriptor_description", "_UI_AssemblyInfrastructureConnector_providedRole__AssemblyInfrastructureConnector_feature", "_UI_AssemblyInfrastructureConnector_type"), |
91 | CompositionPackage.Literals.ASSEMBLY_INFRASTRUCTURE_CONNECTOR__PROVIDED_ROLE_ASSEMBLY_INFRASTRUCTURE_CONNECTOR, |
92 | true, |
93 | false, |
94 | true, |
95 | null, |
96 | null, |
97 | null)); |
98 | } |
99 | |
100 | /** |
101 | * This adds a property descriptor for the Required Role Assembly Infrastructure Connector feature. |
102 | * <!-- begin-user-doc --> |
103 | * <!-- end-user-doc --> |
104 | * @generated |
105 | */ |
106 | protected void addRequiredRole__AssemblyInfrastructureConnectorPropertyDescriptor(Object object) { |
107 | itemPropertyDescriptors.add |
108 | (createItemPropertyDescriptor |
109 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
110 | getResourceLocator(), |
111 | getString("_UI_AssemblyInfrastructureConnector_requiredRole__AssemblyInfrastructureConnector_feature"), |
112 | getString("_UI_PropertyDescriptor_description", "_UI_AssemblyInfrastructureConnector_requiredRole__AssemblyInfrastructureConnector_feature", "_UI_AssemblyInfrastructureConnector_type"), |
113 | CompositionPackage.Literals.ASSEMBLY_INFRASTRUCTURE_CONNECTOR__REQUIRED_ROLE_ASSEMBLY_INFRASTRUCTURE_CONNECTOR, |
114 | true, |
115 | false, |
116 | true, |
117 | null, |
118 | null, |
119 | null)); |
120 | } |
121 | |
122 | /** |
123 | * This adds a property descriptor for the Providing Assembly Context Assembly Infrastructure Connector feature. |
124 | * <!-- begin-user-doc --> |
125 | * <!-- end-user-doc --> |
126 | * @generated |
127 | */ |
128 | protected void addProvidingAssemblyContext__AssemblyInfrastructureConnectorPropertyDescriptor(Object object) { |
129 | itemPropertyDescriptors.add |
130 | (createItemPropertyDescriptor |
131 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
132 | getResourceLocator(), |
133 | getString("_UI_AssemblyInfrastructureConnector_providingAssemblyContext__AssemblyInfrastructureConnector_feature"), |
134 | getString("_UI_PropertyDescriptor_description", "_UI_AssemblyInfrastructureConnector_providingAssemblyContext__AssemblyInfrastructureConnector_feature", "_UI_AssemblyInfrastructureConnector_type"), |
135 | CompositionPackage.Literals.ASSEMBLY_INFRASTRUCTURE_CONNECTOR__PROVIDING_ASSEMBLY_CONTEXT_ASSEMBLY_INFRASTRUCTURE_CONNECTOR, |
136 | true, |
137 | false, |
138 | true, |
139 | null, |
140 | null, |
141 | null)); |
142 | } |
143 | |
144 | /** |
145 | * This adds a property descriptor for the Requiring Assembly Context Assembly Infrastructure Connector feature. |
146 | * <!-- begin-user-doc --> |
147 | * <!-- end-user-doc --> |
148 | * @generated |
149 | */ |
150 | protected void addRequiringAssemblyContext__AssemblyInfrastructureConnectorPropertyDescriptor(Object object) { |
151 | itemPropertyDescriptors.add |
152 | (createItemPropertyDescriptor |
153 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
154 | getResourceLocator(), |
155 | getString("_UI_AssemblyInfrastructureConnector_requiringAssemblyContext__AssemblyInfrastructureConnector_feature"), |
156 | getString("_UI_PropertyDescriptor_description", "_UI_AssemblyInfrastructureConnector_requiringAssemblyContext__AssemblyInfrastructureConnector_feature", "_UI_AssemblyInfrastructureConnector_type"), |
157 | CompositionPackage.Literals.ASSEMBLY_INFRASTRUCTURE_CONNECTOR__REQUIRING_ASSEMBLY_CONTEXT_ASSEMBLY_INFRASTRUCTURE_CONNECTOR, |
158 | true, |
159 | false, |
160 | true, |
161 | null, |
162 | null, |
163 | null)); |
164 | } |
165 | |
166 | /** |
167 | * This returns AssemblyInfrastructureConnector.gif. |
168 | * <!-- begin-user-doc --> |
169 | * <!-- end-user-doc --> |
170 | * @generated |
171 | */ |
172 | @Override |
173 | public Object getImage(Object object) { |
174 | return overlayImage(object, getResourceLocator().getImage("full/obj16/AssemblyInfrastructureConnector")); |
175 | } |
176 | |
177 | /** |
178 | * This returns the label text for the adapted class. |
179 | * <!-- begin-user-doc --> |
180 | * <!-- end-user-doc --> |
181 | * @generated |
182 | */ |
183 | @Override |
184 | public String getText(Object object) { |
185 | String label = ((AssemblyInfrastructureConnector)object).getId(); |
186 | return label == null || label.length() == 0 ? |
187 | getString("_UI_AssemblyInfrastructureConnector_type") : |
188 | getString("_UI_AssemblyInfrastructureConnector_type") + " " + label; |
189 | } |
190 | |
191 | /** |
192 | * This handles model notifications by calling {@link #updateChildren} to update any cached |
193 | * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. |
194 | * <!-- begin-user-doc --> |
195 | * <!-- end-user-doc --> |
196 | * @generated |
197 | */ |
198 | @Override |
199 | public void notifyChanged(Notification notification) { |
200 | updateChildren(notification); |
201 | super.notifyChanged(notification); |
202 | } |
203 | |
204 | /** |
205 | * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children |
206 | * that can be created under this object. |
207 | * <!-- begin-user-doc --> |
208 | * <!-- end-user-doc --> |
209 | * @generated |
210 | */ |
211 | @Override |
212 | protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { |
213 | super.collectNewChildDescriptors(newChildDescriptors, object); |
214 | } |
215 | |
216 | } |