1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package edu.kit.ipd.sdq.completionfeaturemodel.provider; |
8 | |
9 | |
10 | import de.uka.ipd.sdq.featuremodel.featuremodelPackage; |
11 | |
12 | import de.uka.ipd.sdq.featuremodel.provider.FeatureGroupItemProvider; |
13 | |
14 | import edu.kit.ipd.sdq.completionfeaturemodel.CompletionFeatureGroup; |
15 | import edu.kit.ipd.sdq.completionfeaturemodel.completionfeaturemodelFactory; |
16 | |
17 | import java.util.Collection; |
18 | import java.util.List; |
19 | |
20 | import org.eclipse.emf.common.notify.AdapterFactory; |
21 | import org.eclipse.emf.common.notify.Notification; |
22 | |
23 | import org.eclipse.emf.common.util.ResourceLocator; |
24 | |
25 | import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; |
26 | import org.eclipse.emf.edit.provider.IItemColorProvider; |
27 | import org.eclipse.emf.edit.provider.IItemLabelProvider; |
28 | import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; |
29 | import org.eclipse.emf.edit.provider.IItemPropertySource; |
30 | import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; |
31 | import org.eclipse.emf.edit.provider.ITreeItemContentProvider; |
32 | |
33 | /** |
34 | * This is the item provider adapter for a {@link edu.kit.ipd.sdq.completionfeaturemodel.CompletionFeatureGroup} object. |
35 | * <!-- begin-user-doc --> |
36 | * <!-- end-user-doc --> |
37 | * @generated |
38 | */ |
39 | public class CompletionFeatureGroupItemProvider |
40 | extends FeatureGroupItemProvider |
41 | implements |
42 | IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource, IItemColorProvider { |
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 CompletionFeatureGroupItemProvider(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 CompletionFeatureGroup.gif. |
70 | * <!-- begin-user-doc --> |
71 | * <!-- end-user-doc --> |
72 | * @generated |
73 | */ |
74 | @Override |
75 | public Object getImage(Object object) { |
76 | return overlayImage(object, getResourceLocator().getImage("full/obj16/CompletionFeatureGroup")); |
77 | } |
78 | |
79 | /** |
80 | * This returns the label text for the adapted class. |
81 | * <!-- begin-user-doc --> |
82 | * <!-- end-user-doc --> |
83 | * @generated |
84 | */ |
85 | @Override |
86 | public String getText(Object object) { |
87 | CompletionFeatureGroup completionFeatureGroup = (CompletionFeatureGroup)object; |
88 | return getString("_UI_CompletionFeatureGroup_type") + " " + completionFeatureGroup.getMin(); |
89 | } |
90 | |
91 | /** |
92 | * This handles model notifications by calling {@link #updateChildren} to update any cached |
93 | * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. |
94 | * <!-- begin-user-doc --> |
95 | * <!-- end-user-doc --> |
96 | * @generated |
97 | */ |
98 | @Override |
99 | public void notifyChanged(Notification notification) { |
100 | updateChildren(notification); |
101 | super.notifyChanged(notification); |
102 | } |
103 | |
104 | /** |
105 | * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children |
106 | * that can be created under this object. |
107 | * <!-- begin-user-doc --> |
108 | * <!-- end-user-doc --> |
109 | * @generated |
110 | */ |
111 | @Override |
112 | protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { |
113 | super.collectNewChildDescriptors(newChildDescriptors, object); |
114 | |
115 | newChildDescriptors.add |
116 | (createChildParameter |
117 | (featuremodelPackage.Literals.FEATURE_GROUP__CHILDREN, |
118 | completionfeaturemodelFactory.eINSTANCE.createCompletionFeature())); |
119 | } |
120 | |
121 | /** |
122 | * Return the resource locator for this item provider's resources. |
123 | * <!-- begin-user-doc --> |
124 | * <!-- end-user-doc --> |
125 | * @generated |
126 | */ |
127 | @Override |
128 | public ResourceLocator getResourceLocator() { |
129 | return CompletionfeaturemodelEditPlugin.INSTANCE; |
130 | } |
131 | |
132 | } |