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.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.InterfaceProvidingRequiringEntityItemProvider; |
23 | import de.uka.ipd.sdq.pcm.core.provider.PalladioComponentModelEditPlugin; |
24 | import de.uka.ipd.sdq.pcm.repository.RepositoryComponent; |
25 | |
26 | /** |
27 | * This is the item provider adapter for a {@link de.uka.ipd.sdq.pcm.repository.RepositoryComponent} object. |
28 | * <!-- begin-user-doc --> |
29 | * <!-- end-user-doc --> |
30 | * @generated |
31 | */ |
32 | public class RepositoryComponentItemProvider |
33 | extends InterfaceProvidingRequiringEntityItemProvider |
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 RepositoryComponentItemProvider(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 the label text for the adapted class. |
74 | * <!-- begin-user-doc --> |
75 | * <!-- end-user-doc --> |
76 | * @generated |
77 | */ |
78 | @Override |
79 | public String getText(Object object) { |
80 | String label = ((RepositoryComponent)object).getId(); |
81 | return label == null || label.length() == 0 ? |
82 | getString("_UI_RepositoryComponent_type") : |
83 | getString("_UI_RepositoryComponent_type") + " " + label; |
84 | } |
85 | |
86 | /** |
87 | * This handles model notifications by calling {@link #updateChildren} to update any cached |
88 | * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. |
89 | * <!-- begin-user-doc --> |
90 | * <!-- end-user-doc --> |
91 | * @generated |
92 | */ |
93 | @Override |
94 | public void notifyChanged(Notification notification) { |
95 | updateChildren(notification); |
96 | super.notifyChanged(notification); |
97 | } |
98 | |
99 | /** |
100 | * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children |
101 | * that can be created under this object. |
102 | * <!-- begin-user-doc --> |
103 | * <!-- end-user-doc --> |
104 | * @generated |
105 | */ |
106 | @Override |
107 | protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { |
108 | super.collectNewChildDescriptors(newChildDescriptors, object); |
109 | } |
110 | |
111 | /** |
112 | * Return the resource locator for this item provider's resources. |
113 | * <!-- begin-user-doc --> |
114 | * <!-- end-user-doc --> |
115 | * @generated |
116 | */ |
117 | @Override |
118 | public ResourceLocator getResourceLocator() { |
119 | return PalladioComponentModelEditPlugin.INSTANCE; |
120 | } |
121 | |
122 | } |