1 | /** |
2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
3 | * |
4 | * $Id$ |
5 | */ |
6 | package de.uka.ipd.sdq.pcm.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.edit.provider.ComposeableAdapterFactory; |
15 | import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; |
16 | import org.eclipse.emf.edit.provider.IItemLabelProvider; |
17 | import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; |
18 | import org.eclipse.emf.edit.provider.IItemPropertySource; |
19 | import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; |
20 | import org.eclipse.emf.edit.provider.ITreeItemContentProvider; |
21 | |
22 | import de.uka.ipd.sdq.pcm.reliability.ExternalFailureOccurrenceDescription; |
23 | import de.uka.ipd.sdq.pcm.reliability.ReliabilityPackage; |
24 | |
25 | /** |
26 | * This is the item provider adapter for a {@link de.uka.ipd.sdq.pcm.reliability.ExternalFailureOccurrenceDescription} object. |
27 | * <!-- begin-user-doc --> |
28 | * <!-- end-user-doc --> |
29 | * @generated |
30 | */ |
31 | public class ExternalFailureOccurrenceDescriptionItemProvider |
32 | extends FailureOccurrenceDescriptionItemProvider |
33 | implements |
34 | IEditingDomainItemProvider, |
35 | IStructuredItemContentProvider, |
36 | ITreeItemContentProvider, |
37 | IItemLabelProvider, |
38 | IItemPropertySource { |
39 | /** |
40 | * <!-- begin-user-doc --> |
41 | * <!-- end-user-doc --> |
42 | * @generated |
43 | */ |
44 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
45 | |
46 | /** |
47 | * This constructs an instance from a factory and a notifier. |
48 | * <!-- begin-user-doc --> |
49 | * <!-- end-user-doc --> |
50 | * @generated |
51 | */ |
52 | public ExternalFailureOccurrenceDescriptionItemProvider(AdapterFactory adapterFactory) { |
53 | super(adapterFactory); |
54 | } |
55 | |
56 | /** |
57 | * This returns the property descriptors for the adapted class. |
58 | * <!-- begin-user-doc --> |
59 | * <!-- end-user-doc --> |
60 | * @generated |
61 | */ |
62 | @Override |
63 | public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { |
64 | if (itemPropertyDescriptors == null) { |
65 | super.getPropertyDescriptors(object); |
66 | |
67 | addFailureType__ExternalFailureOccurrenceDescriptionPropertyDescriptor(object); |
68 | } |
69 | return itemPropertyDescriptors; |
70 | } |
71 | |
72 | /** |
73 | * This adds a property descriptor for the Failure Type External Failure Occurrence Description feature. |
74 | * <!-- begin-user-doc --> |
75 | * <!-- end-user-doc --> |
76 | * @generated |
77 | */ |
78 | protected void addFailureType__ExternalFailureOccurrenceDescriptionPropertyDescriptor(Object object) { |
79 | itemPropertyDescriptors.add |
80 | (createItemPropertyDescriptor |
81 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
82 | getResourceLocator(), |
83 | getString("_UI_ExternalFailureOccurrenceDescription_failureType__ExternalFailureOccurrenceDescription_feature"), |
84 | getString("_UI_PropertyDescriptor_description", "_UI_ExternalFailureOccurrenceDescription_failureType__ExternalFailureOccurrenceDescription_feature", "_UI_ExternalFailureOccurrenceDescription_type"), |
85 | ReliabilityPackage.Literals.EXTERNAL_FAILURE_OCCURRENCE_DESCRIPTION__FAILURE_TYPE_EXTERNAL_FAILURE_OCCURRENCE_DESCRIPTION, |
86 | true, |
87 | false, |
88 | true, |
89 | null, |
90 | null, |
91 | null)); |
92 | } |
93 | |
94 | /** |
95 | * This returns ExternalFailureOccurrenceDescription.gif. |
96 | * <!-- begin-user-doc --> |
97 | * <!-- end-user-doc --> |
98 | * @generated |
99 | */ |
100 | @Override |
101 | public Object getImage(Object object) { |
102 | return overlayImage(object, getResourceLocator().getImage("full/obj16/ExternalFailureOccurrenceDescription")); |
103 | } |
104 | |
105 | /** |
106 | * This returns the label text for the adapted class. |
107 | * <!-- begin-user-doc --> |
108 | * <!-- end-user-doc --> |
109 | * @generated |
110 | */ |
111 | @Override |
112 | public String getText(Object object) { |
113 | ExternalFailureOccurrenceDescription externalFailureOccurrenceDescription = (ExternalFailureOccurrenceDescription)object; |
114 | return getString("_UI_ExternalFailureOccurrenceDescription_type") + " " + externalFailureOccurrenceDescription.getFailureProbability(); |
115 | } |
116 | |
117 | /** |
118 | * This handles model notifications by calling {@link #updateChildren} to update any cached |
119 | * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. |
120 | * <!-- begin-user-doc --> |
121 | * <!-- end-user-doc --> |
122 | * @generated |
123 | */ |
124 | @Override |
125 | public void notifyChanged(Notification notification) { |
126 | updateChildren(notification); |
127 | super.notifyChanged(notification); |
128 | } |
129 | |
130 | /** |
131 | * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children |
132 | * that can be created under this object. |
133 | * <!-- begin-user-doc --> |
134 | * <!-- end-user-doc --> |
135 | * @generated |
136 | */ |
137 | @Override |
138 | protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { |
139 | super.collectNewChildDescriptors(newChildDescriptors, object); |
140 | } |
141 | |
142 | } |