1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.pcm.designdecision.GDoF.provider; |
8 | |
9 | |
10 | import de.uka.ipd.sdq.pcm.designdecision.GDoF.GDoFPackage; |
11 | |
12 | import de.uka.ipd.sdq.pcm.designdecision.provider.DesignDecisionEditPlugin; |
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.ComposeableAdapterFactory; |
23 | import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; |
24 | import org.eclipse.emf.edit.provider.IItemLabelProvider; |
25 | import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; |
26 | import org.eclipse.emf.edit.provider.IItemPropertySource; |
27 | import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; |
28 | import org.eclipse.emf.edit.provider.ITreeItemContentProvider; |
29 | import org.eclipse.emf.edit.provider.ItemProviderAdapter; |
30 | |
31 | /** |
32 | * This is the item provider adapter for a {@link de.uka.ipd.sdq.pcm.designdecision.GDoF.StaticContextRule} object. |
33 | * <!-- begin-user-doc --> |
34 | * <!-- end-user-doc --> |
35 | * @generated |
36 | */ |
37 | public class StaticContextRuleItemProvider |
38 | extends ItemProviderAdapter |
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 StaticContextRuleItemProvider(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 | addContextClassPropertyDescriptor(object); |
67 | } |
68 | return itemPropertyDescriptors; |
69 | } |
70 | |
71 | /** |
72 | * This adds a property descriptor for the Context Class feature. |
73 | * <!-- begin-user-doc --> |
74 | * <!-- end-user-doc --> |
75 | * @generated |
76 | */ |
77 | protected void addContextClassPropertyDescriptor(Object object) { |
78 | itemPropertyDescriptors.add |
79 | (createItemPropertyDescriptor |
80 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
81 | getResourceLocator(), |
82 | getString("_UI_StaticContextRule_contextClass_feature"), |
83 | getString("_UI_PropertyDescriptor_description", "_UI_StaticContextRule_contextClass_feature", "_UI_StaticContextRule_type"), |
84 | GDoFPackage.Literals.STATIC_CONTEXT_RULE__CONTEXT_CLASS, |
85 | true, |
86 | false, |
87 | true, |
88 | null, |
89 | null, |
90 | null)); |
91 | } |
92 | |
93 | /** |
94 | * This returns the label text for the adapted class. |
95 | * <!-- begin-user-doc --> |
96 | * <!-- end-user-doc --> |
97 | * @generated |
98 | */ |
99 | @Override |
100 | public String getText(Object object) { |
101 | return getString("_UI_StaticContextRule_type"); |
102 | } |
103 | |
104 | /** |
105 | * This handles model notifications by calling {@link #updateChildren} to update any cached |
106 | * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. |
107 | * <!-- begin-user-doc --> |
108 | * <!-- end-user-doc --> |
109 | * @generated |
110 | */ |
111 | @Override |
112 | public void notifyChanged(Notification notification) { |
113 | updateChildren(notification); |
114 | super.notifyChanged(notification); |
115 | } |
116 | |
117 | /** |
118 | * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children |
119 | * that can be created under this object. |
120 | * <!-- begin-user-doc --> |
121 | * <!-- end-user-doc --> |
122 | * @generated |
123 | */ |
124 | @Override |
125 | protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { |
126 | super.collectNewChildDescriptors(newChildDescriptors, object); |
127 | } |
128 | |
129 | /** |
130 | * Return the resource locator for this item provider's resources. |
131 | * <!-- begin-user-doc --> |
132 | * <!-- end-user-doc --> |
133 | * @generated |
134 | */ |
135 | @Override |
136 | public ResourceLocator getResourceLocator() { |
137 | return DesignDecisionEditPlugin.INSTANCE; |
138 | } |
139 | |
140 | } |