1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.dsexplore.qml.contract.QMLContract.provider; |
8 | |
9 | |
10 | import de.uka.ipd.sdq.dsexplore.qml.contract.QMLContract.ValueLiteral; |
11 | |
12 | import de.uka.ipd.sdq.dsexplore.qml.profile.QMLProfile.provider.QMLProfileEditPlugin; |
13 | |
14 | import de.uka.ipd.sdq.identifier.provider.IdentifierItemProvider; |
15 | |
16 | import java.util.Collection; |
17 | import java.util.List; |
18 | |
19 | import org.eclipse.emf.common.notify.AdapterFactory; |
20 | import org.eclipse.emf.common.notify.Notification; |
21 | |
22 | import org.eclipse.emf.common.util.ResourceLocator; |
23 | |
24 | import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; |
25 | import org.eclipse.emf.edit.provider.IItemLabelProvider; |
26 | import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; |
27 | import org.eclipse.emf.edit.provider.IItemPropertySource; |
28 | import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; |
29 | import org.eclipse.emf.edit.provider.ITreeItemContentProvider; |
30 | |
31 | /** |
32 | * This is the item provider adapter for a {@link de.uka.ipd.sdq.dsexplore.qml.contract.QMLContract.ValueLiteral} object. |
33 | * <!-- begin-user-doc --> |
34 | * <!-- end-user-doc --> |
35 | * @generated |
36 | */ |
37 | public class ValueLiteralItemProvider |
38 | extends IdentifierItemProvider |
39 | implements |
40 | IEditingDomainItemProvider, |
41 | IStructuredItemContentProvider, |
42 | ITreeItemContentProvider, |
43 | IItemLabelProvider, |
44 | IItemPropertySource { |
45 | /** |
46 | * This constructs an instance from a factory and a notifier. |
47 | * <!-- begin-user-doc --> |
48 | * <!-- end-user-doc --> |
49 | * @generated |
50 | */ |
51 | public ValueLiteralItemProvider(AdapterFactory adapterFactory) { |
52 | super(adapterFactory); |
53 | } |
54 | |
55 | /** |
56 | * This returns the property descriptors for the adapted class. |
57 | * <!-- begin-user-doc --> |
58 | * <!-- end-user-doc --> |
59 | * @generated |
60 | */ |
61 | @Override |
62 | public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { |
63 | if (itemPropertyDescriptors == null) { |
64 | super.getPropertyDescriptors(object); |
65 | |
66 | } |
67 | return itemPropertyDescriptors; |
68 | } |
69 | |
70 | /** |
71 | * This returns the label text for the adapted class. |
72 | * <!-- begin-user-doc --> |
73 | * <!-- end-user-doc --> |
74 | * @generated |
75 | */ |
76 | @Override |
77 | public String getText(Object object) { |
78 | String label = ((ValueLiteral)object).getId(); |
79 | return label == null || label.length() == 0 ? |
80 | getString("_UI_ValueLiteral_type") : |
81 | getString("_UI_ValueLiteral_type") + " " + label; |
82 | } |
83 | |
84 | /** |
85 | * This handles model notifications by calling {@link #updateChildren} to update any cached |
86 | * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. |
87 | * <!-- begin-user-doc --> |
88 | * <!-- end-user-doc --> |
89 | * @generated |
90 | */ |
91 | @Override |
92 | public void notifyChanged(Notification notification) { |
93 | updateChildren(notification); |
94 | super.notifyChanged(notification); |
95 | } |
96 | |
97 | /** |
98 | * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children |
99 | * that can be created under this object. |
100 | * <!-- begin-user-doc --> |
101 | * <!-- end-user-doc --> |
102 | * @generated |
103 | */ |
104 | @Override |
105 | protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { |
106 | super.collectNewChildDescriptors(newChildDescriptors, object); |
107 | } |
108 | |
109 | /** |
110 | * Return the resource locator for this item provider's resources. |
111 | * <!-- begin-user-doc --> |
112 | * <!-- end-user-doc --> |
113 | * @generated |
114 | */ |
115 | @Override |
116 | public ResourceLocator getResourceLocator() { |
117 | return QMLProfileEditPlugin.INSTANCE; |
118 | } |
119 | |
120 | } |