1 | /** |
2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
3 | * |
4 | * $Id$ |
5 | */ |
6 | package de.uka.ipd.sdq.pcm.core.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.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.core.PCMRandomVariable; |
23 | import de.uka.ipd.sdq.stoex.provider.RandomVariableItemProvider; |
24 | |
25 | /** |
26 | * This is the item provider adapter for a {@link de.uka.ipd.sdq.pcm.core.PCMRandomVariable} object. |
27 | * <!-- begin-user-doc --> |
28 | * <!-- end-user-doc --> |
29 | * @generated |
30 | */ |
31 | public class PCMRandomVariableItemProvider |
32 | extends RandomVariableItemProvider |
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 PCMRandomVariableItemProvider(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 | } |
68 | return itemPropertyDescriptors; |
69 | } |
70 | |
71 | /** |
72 | * This returns PCMRandomVariable.gif. |
73 | * <!-- begin-user-doc --> |
74 | * <!-- end-user-doc --> |
75 | * @generated |
76 | */ |
77 | @Override |
78 | public Object getImage(Object object) { |
79 | return overlayImage(object, getResourceLocator().getImage("full/obj16/PCMRandomVariable")); |
80 | } |
81 | |
82 | /** |
83 | * This returns the label text for the adapted class. |
84 | * <!-- begin-user-doc --> |
85 | * <!-- end-user-doc --> |
86 | * @generated |
87 | */ |
88 | @Override |
89 | public String getText(Object object) { |
90 | String label = ((PCMRandomVariable)object).getSpecification(); |
91 | return label == null || label.length() == 0 ? |
92 | getString("_UI_PCMRandomVariable_type") : |
93 | getString("_UI_PCMRandomVariable_type") + " " + label; |
94 | } |
95 | |
96 | /** |
97 | * This handles model notifications by calling {@link #updateChildren} to update any cached |
98 | * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. |
99 | * <!-- begin-user-doc --> |
100 | * <!-- end-user-doc --> |
101 | * @generated |
102 | */ |
103 | @Override |
104 | public void notifyChanged(Notification notification) { |
105 | updateChildren(notification); |
106 | super.notifyChanged(notification); |
107 | } |
108 | |
109 | /** |
110 | * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children |
111 | * that can be created under this object. |
112 | * <!-- begin-user-doc --> |
113 | * <!-- end-user-doc --> |
114 | * @generated |
115 | */ |
116 | @Override |
117 | protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { |
118 | super.collectNewChildDescriptors(newChildDescriptors, object); |
119 | } |
120 | |
121 | /** |
122 | * Return the resource locator for this item provider's resources. |
123 | * <!-- begin-user-doc --> |
124 | * <!-- end-user-doc --> |
125 | * @generated |
126 | */ |
127 | @Override |
128 | public ResourceLocator getResourceLocator() { |
129 | return PalladioComponentModelEditPlugin.INSTANCE; |
130 | } |
131 | |
132 | } |