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