1 | /** |
2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
3 | * |
4 | * $Id$ |
5 | */ |
6 | package de.uka.ipd.sdq.pcm.repository.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.repository.RepositoryPackage; |
23 | import de.uka.ipd.sdq.pcm.repository.SinkRole; |
24 | |
25 | /** |
26 | * This is the item provider adapter for a {@link de.uka.ipd.sdq.pcm.repository.SinkRole} object. |
27 | * <!-- begin-user-doc --> |
28 | * <!-- end-user-doc --> |
29 | * @generated |
30 | */ |
31 | public class SinkRoleItemProvider |
32 | extends ProvidedRoleItemProvider |
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 SinkRoleItemProvider(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 | addEventGroup__SinkRolePropertyDescriptor(object); |
68 | } |
69 | return itemPropertyDescriptors; |
70 | } |
71 | |
72 | /** |
73 | * This adds a property descriptor for the Event Group Sink Role feature. |
74 | * <!-- begin-user-doc --> |
75 | * <!-- end-user-doc --> |
76 | * @generated |
77 | */ |
78 | protected void addEventGroup__SinkRolePropertyDescriptor(Object object) { |
79 | itemPropertyDescriptors.add |
80 | (createItemPropertyDescriptor |
81 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
82 | getResourceLocator(), |
83 | getString("_UI_SinkRole_eventGroup__SinkRole_feature"), |
84 | getString("_UI_PropertyDescriptor_description", "_UI_SinkRole_eventGroup__SinkRole_feature", "_UI_SinkRole_type"), |
85 | RepositoryPackage.Literals.SINK_ROLE__EVENT_GROUP_SINK_ROLE, |
86 | true, |
87 | false, |
88 | true, |
89 | null, |
90 | null, |
91 | null)); |
92 | } |
93 | |
94 | /** |
95 | * This returns SinkRole.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/SinkRole")); |
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 | String label = ((SinkRole)object).getId(); |
114 | return label == null || label.length() == 0 ? |
115 | getString("_UI_SinkRole_type") : |
116 | getString("_UI_SinkRole_type") + " " + label; |
117 | } |
118 | |
119 | /** |
120 | * This handles model notifications by calling {@link #updateChildren} to update any cached |
121 | * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. |
122 | * <!-- begin-user-doc --> |
123 | * <!-- end-user-doc --> |
124 | * @generated |
125 | */ |
126 | @Override |
127 | public void notifyChanged(Notification notification) { |
128 | updateChildren(notification); |
129 | super.notifyChanged(notification); |
130 | } |
131 | |
132 | /** |
133 | * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children |
134 | * that can be created under this object. |
135 | * <!-- begin-user-doc --> |
136 | * <!-- end-user-doc --> |
137 | * @generated |
138 | */ |
139 | @Override |
140 | protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { |
141 | super.collectNewChildDescriptors(newChildDescriptors, object); |
142 | } |
143 | |
144 | } |