1 | /** |
2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
3 | * |
4 | * $Id$ |
5 | */ |
6 | package de.uka.ipd.sdq.pcm.resourcetype.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.resourcetype.ProcessingResourceType; |
23 | import de.uka.ipd.sdq.pcm.resourcetype.ResourcetypePackage; |
24 | |
25 | /** |
26 | * This is the item provider adapter for a {@link de.uka.ipd.sdq.pcm.resourcetype.ProcessingResourceType} object. |
27 | * <!-- begin-user-doc --> |
28 | * <!-- end-user-doc --> |
29 | * @generated |
30 | */ |
31 | public class ProcessingResourceTypeItemProvider |
32 | extends ResourceTypeItemProvider |
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 ProcessingResourceTypeItemProvider(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 | addHardwareInducedFailureType__ProcessingResourceTypePropertyDescriptor(object); |
68 | } |
69 | return itemPropertyDescriptors; |
70 | } |
71 | |
72 | /** |
73 | * This adds a property descriptor for the Hardware Induced Failure Type Processing Resource Type feature. |
74 | * <!-- begin-user-doc --> |
75 | * <!-- end-user-doc --> |
76 | * @generated |
77 | */ |
78 | protected void addHardwareInducedFailureType__ProcessingResourceTypePropertyDescriptor(Object object) { |
79 | itemPropertyDescriptors.add |
80 | (createItemPropertyDescriptor |
81 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
82 | getResourceLocator(), |
83 | getString("_UI_ProcessingResourceType_hardwareInducedFailureType__ProcessingResourceType_feature"), |
84 | getString("_UI_PropertyDescriptor_description", "_UI_ProcessingResourceType_hardwareInducedFailureType__ProcessingResourceType_feature", "_UI_ProcessingResourceType_type"), |
85 | ResourcetypePackage.Literals.PROCESSING_RESOURCE_TYPE__HARDWARE_INDUCED_FAILURE_TYPE_PROCESSING_RESOURCE_TYPE, |
86 | true, |
87 | false, |
88 | true, |
89 | null, |
90 | null, |
91 | null)); |
92 | } |
93 | |
94 | /** |
95 | * This returns ProcessingResourceType.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/ProcessingResourceType")); |
103 | } |
104 | |
105 | /** |
106 | * This returns the label text for the adapted class. |
107 | * <!-- begin-user-doc --> |
108 | * FB: Adapted method to produce a more informative label for display in non-PCM editors. |
109 | * In PCM editors, display is not controlled by this method but through a more general |
110 | * mechanism (I'n not sure where it's actually controlled, maybe the |
111 | * de.uka.ipd.sdq.pcmbench.tabs.PropertyLabelProvider.getText() method?) |
112 | * <!-- end-user-doc --> |
113 | * @generated not |
114 | */ |
115 | @Override |
116 | public String getText(Object object) { |
117 | return ((ProcessingResourceType)object).getEntityName() |
118 | + " [ID: " + ((ProcessingResourceType)object).getId() + "]" |
119 | + " <" + getString("_UI_ProcessingResourceType_type") + ">"; |
120 | } |
121 | |
122 | /** |
123 | * This handles model notifications by calling {@link #updateChildren} to update any cached |
124 | * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. |
125 | * <!-- begin-user-doc --> |
126 | * <!-- end-user-doc --> |
127 | * @generated |
128 | */ |
129 | @Override |
130 | public void notifyChanged(Notification notification) { |
131 | updateChildren(notification); |
132 | super.notifyChanged(notification); |
133 | } |
134 | |
135 | /** |
136 | * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children |
137 | * that can be created under this object. |
138 | * <!-- begin-user-doc --> |
139 | * <!-- end-user-doc --> |
140 | * @generated |
141 | */ |
142 | @Override |
143 | protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { |
144 | super.collectNewChildDescriptors(newChildDescriptors, object); |
145 | } |
146 | |
147 | } |