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.CompositionPackage; |
24 | import de.uka.ipd.sdq.pcm.core.composition.ProvidedDelegationConnector; |
25 | import de.uka.ipd.sdq.pcm.core.provider.PalladioComponentModelEditPlugin; |
26 | import de.uka.ipd.sdq.pcm.repository.provider.DelegationConnectorItemProvider; |
27 | |
28 | /** |
29 | * This is the item provider adapter for a {@link de.uka.ipd.sdq.pcm.core.composition.ProvidedDelegationConnector} object. |
30 | * <!-- begin-user-doc --> |
31 | * <!-- end-user-doc --> |
32 | * @generated |
33 | */ |
34 | public class ProvidedDelegationConnectorItemProvider |
35 | extends DelegationConnectorItemProvider |
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 ProvidedDelegationConnectorItemProvider(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 | addInnerProvidedRole_ProvidedDelegationConnectorPropertyDescriptor(object); |
71 | addOuterProvidedRole_ProvidedDelegationConnectorPropertyDescriptor(object); |
72 | addAssemblyContext_ProvidedDelegationConnectorPropertyDescriptor(object); |
73 | } |
74 | return itemPropertyDescriptors; |
75 | } |
76 | |
77 | /** |
78 | * This adds a property descriptor for the Inner Provided Role Provided Delegation Connector feature. |
79 | * <!-- begin-user-doc --> |
80 | * <!-- end-user-doc --> |
81 | * @generated |
82 | */ |
83 | protected void addInnerProvidedRole_ProvidedDelegationConnectorPropertyDescriptor(Object object) { |
84 | itemPropertyDescriptors.add |
85 | (createItemPropertyDescriptor |
86 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
87 | getResourceLocator(), |
88 | getString("_UI_ProvidedDelegationConnector_innerProvidedRole_ProvidedDelegationConnector_feature"), |
89 | getString("_UI_PropertyDescriptor_description", "_UI_ProvidedDelegationConnector_innerProvidedRole_ProvidedDelegationConnector_feature", "_UI_ProvidedDelegationConnector_type"), |
90 | CompositionPackage.Literals.PROVIDED_DELEGATION_CONNECTOR__INNER_PROVIDED_ROLE_PROVIDED_DELEGATION_CONNECTOR, |
91 | true, |
92 | false, |
93 | true, |
94 | null, |
95 | null, |
96 | null)); |
97 | } |
98 | |
99 | /** |
100 | * This adds a property descriptor for the Outer Provided Role Provided Delegation Connector feature. |
101 | * <!-- begin-user-doc --> |
102 | * <!-- end-user-doc --> |
103 | * @generated |
104 | */ |
105 | protected void addOuterProvidedRole_ProvidedDelegationConnectorPropertyDescriptor(Object object) { |
106 | itemPropertyDescriptors.add |
107 | (createItemPropertyDescriptor |
108 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
109 | getResourceLocator(), |
110 | getString("_UI_ProvidedDelegationConnector_outerProvidedRole_ProvidedDelegationConnector_feature"), |
111 | getString("_UI_PropertyDescriptor_description", "_UI_ProvidedDelegationConnector_outerProvidedRole_ProvidedDelegationConnector_feature", "_UI_ProvidedDelegationConnector_type"), |
112 | CompositionPackage.Literals.PROVIDED_DELEGATION_CONNECTOR__OUTER_PROVIDED_ROLE_PROVIDED_DELEGATION_CONNECTOR, |
113 | true, |
114 | false, |
115 | true, |
116 | null, |
117 | null, |
118 | null)); |
119 | } |
120 | |
121 | /** |
122 | * This adds a property descriptor for the Assembly Context Provided Delegation Connector feature. |
123 | * <!-- begin-user-doc --> |
124 | * <!-- end-user-doc --> |
125 | * @generated |
126 | */ |
127 | protected void addAssemblyContext_ProvidedDelegationConnectorPropertyDescriptor(Object object) { |
128 | itemPropertyDescriptors.add |
129 | (createItemPropertyDescriptor |
130 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
131 | getResourceLocator(), |
132 | getString("_UI_ProvidedDelegationConnector_assemblyContext_ProvidedDelegationConnector_feature"), |
133 | getString("_UI_PropertyDescriptor_description", "_UI_ProvidedDelegationConnector_assemblyContext_ProvidedDelegationConnector_feature", "_UI_ProvidedDelegationConnector_type"), |
134 | CompositionPackage.Literals.PROVIDED_DELEGATION_CONNECTOR__ASSEMBLY_CONTEXT_PROVIDED_DELEGATION_CONNECTOR, |
135 | true, |
136 | false, |
137 | true, |
138 | null, |
139 | null, |
140 | null)); |
141 | } |
142 | |
143 | /** |
144 | * This returns ProvidedDelegationConnector.gif. |
145 | * <!-- begin-user-doc --> |
146 | * <!-- end-user-doc --> |
147 | * @generated |
148 | */ |
149 | @Override |
150 | public Object getImage(Object object) { |
151 | return overlayImage(object, getResourceLocator().getImage("full/obj16/ProvidedDelegationConnector")); |
152 | } |
153 | |
154 | /** |
155 | * This returns the label text for the adapted class. |
156 | * <!-- begin-user-doc --> |
157 | * <!-- end-user-doc --> |
158 | * @generated |
159 | */ |
160 | @Override |
161 | public String getText(Object object) { |
162 | String label = ((ProvidedDelegationConnector)object).getId(); |
163 | return label == null || label.length() == 0 ? |
164 | getString("_UI_ProvidedDelegationConnector_type") : |
165 | getString("_UI_ProvidedDelegationConnector_type") + " " + label; |
166 | } |
167 | |
168 | /** |
169 | * This handles model notifications by calling {@link #updateChildren} to update any cached |
170 | * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. |
171 | * <!-- begin-user-doc --> |
172 | * <!-- end-user-doc --> |
173 | * @generated |
174 | */ |
175 | @Override |
176 | public void notifyChanged(Notification notification) { |
177 | updateChildren(notification); |
178 | super.notifyChanged(notification); |
179 | } |
180 | |
181 | /** |
182 | * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children |
183 | * that can be created under this object. |
184 | * <!-- begin-user-doc --> |
185 | * <!-- end-user-doc --> |
186 | * @generated |
187 | */ |
188 | @Override |
189 | protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { |
190 | super.collectNewChildDescriptors(newChildDescriptors, object); |
191 | } |
192 | |
193 | } |