1 | /** |
2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
3 | * |
4 | * $Id$ |
5 | */ |
6 | package de.uka.ipd.sdq.pcm.seff.seff_reliability.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.entity.provider.EntityItemProvider; |
24 | import de.uka.ipd.sdq.pcm.core.provider.PalladioComponentModelEditPlugin; |
25 | import de.uka.ipd.sdq.pcm.seff.seff_reliability.FailureHandlingEntity; |
26 | import de.uka.ipd.sdq.pcm.seff.seff_reliability.Seff_reliabilityPackage; |
27 | |
28 | /** |
29 | * This is the item provider adapter for a {@link de.uka.ipd.sdq.pcm.seff.seff_reliability.FailureHandlingEntity} object. |
30 | * <!-- begin-user-doc --> |
31 | * <!-- end-user-doc --> |
32 | * @generated |
33 | */ |
34 | public class FailureHandlingEntityItemProvider |
35 | extends EntityItemProvider |
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 FailureHandlingEntityItemProvider(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 | addFailureTypes_FailureHandlingEntityPropertyDescriptor(object); |
71 | } |
72 | return itemPropertyDescriptors; |
73 | } |
74 | |
75 | /** |
76 | * This adds a property descriptor for the Failure Types Failure Handling Entity feature. |
77 | * <!-- begin-user-doc --> |
78 | * <!-- end-user-doc --> |
79 | * @generated |
80 | */ |
81 | protected void addFailureTypes_FailureHandlingEntityPropertyDescriptor(Object object) { |
82 | itemPropertyDescriptors.add |
83 | (createItemPropertyDescriptor |
84 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
85 | getResourceLocator(), |
86 | getString("_UI_FailureHandlingEntity_failureTypes_FailureHandlingEntity_feature"), |
87 | getString("_UI_PropertyDescriptor_description", "_UI_FailureHandlingEntity_failureTypes_FailureHandlingEntity_feature", "_UI_FailureHandlingEntity_type"), |
88 | Seff_reliabilityPackage.Literals.FAILURE_HANDLING_ENTITY__FAILURE_TYPES_FAILURE_HANDLING_ENTITY, |
89 | true, |
90 | false, |
91 | true, |
92 | null, |
93 | null, |
94 | null)); |
95 | } |
96 | |
97 | /** |
98 | * This returns the label text for the adapted class. |
99 | * <!-- begin-user-doc --> |
100 | * <!-- end-user-doc --> |
101 | * @generated |
102 | */ |
103 | @Override |
104 | public String getText(Object object) { |
105 | String label = ((FailureHandlingEntity)object).getId(); |
106 | return label == null || label.length() == 0 ? |
107 | getString("_UI_FailureHandlingEntity_type") : |
108 | getString("_UI_FailureHandlingEntity_type") + " " + label; |
109 | } |
110 | |
111 | /** |
112 | * This handles model notifications by calling {@link #updateChildren} to update any cached |
113 | * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. |
114 | * <!-- begin-user-doc --> |
115 | * <!-- end-user-doc --> |
116 | * @generated |
117 | */ |
118 | @Override |
119 | public void notifyChanged(Notification notification) { |
120 | updateChildren(notification); |
121 | super.notifyChanged(notification); |
122 | } |
123 | |
124 | /** |
125 | * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children |
126 | * that can be created under this object. |
127 | * <!-- begin-user-doc --> |
128 | * <!-- end-user-doc --> |
129 | * @generated |
130 | */ |
131 | @Override |
132 | protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { |
133 | super.collectNewChildDescriptors(newChildDescriptors, object); |
134 | } |
135 | |
136 | /** |
137 | * Return the resource locator for this item provider's resources. |
138 | * <!-- begin-user-doc --> |
139 | * <!-- end-user-doc --> |
140 | * @generated |
141 | */ |
142 | @Override |
143 | public ResourceLocator getResourceLocator() { |
144 | return PalladioComponentModelEditPlugin.INSTANCE; |
145 | } |
146 | |
147 | } |