|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 package cenrep.provider; |
|
18 |
|
19 |
|
20 import java.util.Collection; |
|
21 import java.util.List; |
|
22 |
|
23 import org.eclipse.emf.common.notify.AdapterFactory; |
|
24 import org.eclipse.emf.common.notify.Notification; |
|
25 import org.eclipse.emf.common.util.ResourceLocator; |
|
26 import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; |
|
27 import org.eclipse.emf.edit.provider.IItemLabelProvider; |
|
28 import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; |
|
29 import org.eclipse.emf.edit.provider.IItemPropertySource; |
|
30 import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; |
|
31 import org.eclipse.emf.edit.provider.ITreeItemContentProvider; |
|
32 |
|
33 import cenrep.Desc; |
|
34 |
|
35 /** |
|
36 * This is the item provider adapter for a {@link cenrep.Desc} object. |
|
37 * <!-- begin-user-doc --> |
|
38 * <!-- end-user-doc --> |
|
39 * @generated |
|
40 */ |
|
41 public class DescItemProvider |
|
42 extends ContentItemProvider |
|
43 implements |
|
44 IEditingDomainItemProvider, |
|
45 IStructuredItemContentProvider, |
|
46 ITreeItemContentProvider, |
|
47 IItemLabelProvider, |
|
48 IItemPropertySource { |
|
49 /** |
|
50 * This constructs an instance from a factory and a notifier. |
|
51 * <!-- begin-user-doc --> |
|
52 * <!-- end-user-doc --> |
|
53 * @generated |
|
54 */ |
|
55 public DescItemProvider(AdapterFactory adapterFactory) { |
|
56 super(adapterFactory); |
|
57 } |
|
58 |
|
59 /** |
|
60 * This returns the property descriptors for the adapted class. |
|
61 * <!-- begin-user-doc --> |
|
62 * <!-- end-user-doc --> |
|
63 * @generated |
|
64 */ |
|
65 @Override |
|
66 public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { |
|
67 if (itemPropertyDescriptors == null) { |
|
68 super.getPropertyDescriptors(object); |
|
69 |
|
70 } |
|
71 return itemPropertyDescriptors; |
|
72 } |
|
73 |
|
74 /** |
|
75 * This returns Desc.gif. |
|
76 * <!-- begin-user-doc --> |
|
77 * <!-- end-user-doc --> |
|
78 * @generated |
|
79 */ |
|
80 @Override |
|
81 public Object getImage(Object object) { |
|
82 return overlayImage(object, getResourceLocator().getImage("full/obj16/Desc")); |
|
83 } |
|
84 |
|
85 /** |
|
86 * This returns the label text for the adapted class. |
|
87 * <!-- begin-user-doc --> |
|
88 * <!-- end-user-doc --> |
|
89 * @generated NOT |
|
90 */ |
|
91 public String getText(Object object) { |
|
92 return ((Desc)object).getValue(); |
|
93 } |
|
94 |
|
95 /** |
|
96 * This handles model notifications by calling {@link #updateChildren} to update any cached |
|
97 * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. |
|
98 * <!-- begin-user-doc --> |
|
99 * <!-- end-user-doc --> |
|
100 * @generated |
|
101 */ |
|
102 @Override |
|
103 public void notifyChanged(Notification notification) { |
|
104 updateChildren(notification); |
|
105 super.notifyChanged(notification); |
|
106 } |
|
107 |
|
108 /** |
|
109 * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children |
|
110 * that can be created under this object. |
|
111 * <!-- begin-user-doc --> |
|
112 * <!-- end-user-doc --> |
|
113 * @generated |
|
114 */ |
|
115 @Override |
|
116 protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { |
|
117 super.collectNewChildDescriptors(newChildDescriptors, object); |
|
118 } |
|
119 |
|
120 /** |
|
121 * Return the resource locator for this item provider's resources. |
|
122 * <!-- begin-user-doc --> |
|
123 * <!-- end-user-doc --> |
|
124 * @generated |
|
125 */ |
|
126 @Override |
|
127 public ResourceLocator getResourceLocator() { |
|
128 return CRPluginModelEditPlugin.INSTANCE; |
|
129 } |
|
130 |
|
131 } |