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