1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.probfunction.provider; |
8 | |
9 | |
10 | import java.util.Collection; |
11 | import java.util.List; |
12 | |
13 | import org.eclipse.emf.common.notify.AdapterFactory; |
14 | import org.eclipse.emf.common.notify.Notification; |
15 | import org.eclipse.emf.common.util.ResourceLocator; |
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.probfunction.ProbabilityFunction; |
24 | import de.uka.ipd.sdq.units.provider.UnitCarryingElementItemProvider; |
25 | |
26 | /** |
27 | * This is the item provider adapter for a {@link de.uka.ipd.sdq.probfunction.ProbabilityFunction} object. |
28 | * <!-- begin-user-doc --> |
29 | * <!-- end-user-doc --> |
30 | * @generated |
31 | */ |
32 | public class ProbabilityFunctionItemProvider |
33 | extends UnitCarryingElementItemProvider |
34 | implements |
35 | IEditingDomainItemProvider, |
36 | IStructuredItemContentProvider, |
37 | ITreeItemContentProvider, |
38 | IItemLabelProvider, |
39 | IItemPropertySource { |
40 | /** |
41 | * <!-- begin-user-doc --> |
42 | * <!-- end-user-doc --> |
43 | * @generated |
44 | */ |
45 | public static final String copyright = "Copyright 2007-2009, SDQ, IPD, U Karlsruhe"; |
46 | |
47 | /** |
48 | * This constructs an instance from a factory and a notifier. |
49 | * <!-- begin-user-doc --> |
50 | * <!-- end-user-doc --> |
51 | * @generated |
52 | */ |
53 | public ProbabilityFunctionItemProvider(AdapterFactory adapterFactory) { |
54 | super(adapterFactory); |
55 | } |
56 | |
57 | /** |
58 | * This returns the property descriptors for the adapted class. |
59 | * <!-- begin-user-doc --> |
60 | * <!-- end-user-doc --> |
61 | * @generated |
62 | */ |
63 | @Override |
64 | public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { |
65 | if (itemPropertyDescriptors == null) { |
66 | super.getPropertyDescriptors(object); |
67 | |
68 | } |
69 | return itemPropertyDescriptors; |
70 | } |
71 | |
72 | /** |
73 | * This returns the label text for the adapted class. |
74 | * <!-- begin-user-doc --> |
75 | * <!-- end-user-doc --> |
76 | * @generated |
77 | */ |
78 | @Override |
79 | public String getText(Object object) { |
80 | String label = ((ProbabilityFunction)object).getUnitSpecification(); |
81 | return label == null || label.length() == 0 ? |
82 | getString("_UI_ProbabilityFunction_type") : |
83 | getString("_UI_ProbabilityFunction_type") + " " + label; |
84 | } |
85 | |
86 | /** |
87 | * This handles model notifications by calling {@link #updateChildren} to update any cached |
88 | * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. |
89 | * <!-- begin-user-doc --> |
90 | * <!-- end-user-doc --> |
91 | * @generated |
92 | */ |
93 | @Override |
94 | public void notifyChanged(Notification notification) { |
95 | updateChildren(notification); |
96 | super.notifyChanged(notification); |
97 | } |
98 | |
99 | /** |
100 | * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children |
101 | * that can be created under this object. |
102 | * <!-- begin-user-doc --> |
103 | * <!-- end-user-doc --> |
104 | * @generated |
105 | */ |
106 | @Override |
107 | protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { |
108 | super.collectNewChildDescriptors(newChildDescriptors, object); |
109 | } |
110 | |
111 | /** |
112 | * Return the resource locator for this item provider's resources. |
113 | * <!-- begin-user-doc --> |
114 | * <!-- end-user-doc --> |
115 | * @generated |
116 | */ |
117 | @Override |
118 | public ResourceLocator getResourceLocator() { |
119 | return ProbabilityFunctionEditPlugin.INSTANCE; |
120 | } |
121 | |
122 | } |