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