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