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