001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id: RenderManagerItemProvider.java 24145 2007-02-01 18:03:34Z jeichar $
006: */package net.refractions.udig.project.internal.render.provider;
007:
008: import java.util.Collection;
009: import java.util.List;
010:
011: import net.refractions.udig.project.internal.provider.ProjectEditPlugin;
012: import net.refractions.udig.project.internal.render.RenderManager;
013: import net.refractions.udig.project.internal.render.RenderPackage;
014: import net.refractions.udig.project.render.displayAdapter.IMapDisplay;
015:
016: import org.eclipse.emf.common.notify.AdapterFactory;
017: import org.eclipse.emf.common.notify.Notification;
018: import org.eclipse.emf.common.util.ResourceLocator;
019: import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
020: import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
021: import org.eclipse.emf.edit.provider.IItemLabelProvider;
022: import org.eclipse.emf.edit.provider.IItemPropertySource;
023: import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
024: import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
025: import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
026: import org.eclipse.emf.edit.provider.ItemProviderAdapter;
027: import org.eclipse.emf.edit.provider.ViewerNotification;
028:
029: /**
030: * This is the item provider adapter for a
031: * {@link net.refractions.udig.project.internal.render.RenderManager} object. <!-- begin-user-doc
032: * --> <!-- end-user-doc -->
033: *
034: * @generated
035: */
036: public class RenderManagerItemProvider extends ItemProviderAdapter
037: implements IEditingDomainItemProvider,
038: IStructuredItemContentProvider, ITreeItemContentProvider,
039: IItemLabelProvider, IItemPropertySource {
040: /**
041: * <!-- begin-user-doc --> <!-- end-user-doc -->
042: *
043: * @generated
044: */
045: public static final String copyright = "uDig - User Friendly Desktop Internet GIS client http://udig.refractions.net (C) 2004, Refractions Research Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; version 2.1 of the License. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details."; //$NON-NLS-1$
046:
047: /**
048: * This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!--
049: * end-user-doc -->
050: *
051: * @generated
052: */
053: public RenderManagerItemProvider(AdapterFactory adapterFactory) {
054: super (adapterFactory);
055: }
056:
057: /**
058: * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!--
059: * end-user-doc -->
060: *
061: * @generated
062: */
063: public List getPropertyDescriptors(Object object) {
064: if (itemPropertyDescriptors == null) {
065: super .getPropertyDescriptors(object);
066:
067: addRenderExecutorPropertyDescriptor(object);
068: addMapDisplayPropertyDescriptor(object);
069: addMapInternalPropertyDescriptor(object);
070: addViewportModelInternalPropertyDescriptor(object);
071: }
072: return itemPropertyDescriptors;
073: }
074:
075: /**
076: * This adds a property descriptor for the Map Display feature. <!-- begin-user-doc --> <!--
077: * end-user-doc -->
078: *
079: * @generated
080: */
081: protected void addMapDisplayPropertyDescriptor(Object object) {
082: itemPropertyDescriptors
083: .add(createItemPropertyDescriptor(
084: ((ComposeableAdapterFactory) adapterFactory)
085: .getRootAdapterFactory(),
086: getResourceLocator(),
087: getString("_UI_RenderManager_mapDisplay_feature"), //$NON-NLS-1$
088: getString(
089: "_UI_PropertyDescriptor_description", "_UI_RenderManager_mapDisplay_feature", "_UI_RenderManager_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
090: RenderPackage.eINSTANCE
091: .getRenderManager_MapDisplay(), true,
092: ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
093: null, null));
094: }
095:
096: /**
097: * This adds a property descriptor for the Map Internal feature. <!-- begin-user-doc --> <!--
098: * end-user-doc -->
099: *
100: * @generated
101: */
102: protected void addMapInternalPropertyDescriptor(Object object) {
103: itemPropertyDescriptors
104: .add(createItemPropertyDescriptor(
105: ((ComposeableAdapterFactory) adapterFactory)
106: .getRootAdapterFactory(),
107: getResourceLocator(),
108: getString("_UI_RenderManager_mapInternal_feature"), //$NON-NLS-1$
109: getString(
110: "_UI_PropertyDescriptor_description", "_UI_RenderManager_mapInternal_feature", "_UI_RenderManager_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
111: RenderPackage.eINSTANCE
112: .getRenderManager_MapInternal(), true,
113: null, null, null));
114: }
115:
116: /**
117: * This adds a property descriptor for the Viewport Model Internal feature. <!-- begin-user-doc
118: * --> <!-- end-user-doc -->
119: *
120: * @generated
121: */
122: protected void addViewportModelInternalPropertyDescriptor(
123: Object object) {
124: itemPropertyDescriptors
125: .add(createItemPropertyDescriptor(
126: ((ComposeableAdapterFactory) adapterFactory)
127: .getRootAdapterFactory(),
128: getResourceLocator(),
129: getString("_UI_RenderManager_viewportModelInternal_feature"), //$NON-NLS-1$
130: getString(
131: "_UI_PropertyDescriptor_description", "_UI_RenderManager_viewportModelInternal_feature", "_UI_RenderManager_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
132: RenderPackage.eINSTANCE
133: .getRenderManager_ViewportModelInternal(),
134: true, null, null, null));
135: }
136:
137: /**
138: * This adds a property descriptor for the Render Executor feature. <!-- begin-user-doc --> <!--
139: * end-user-doc -->
140: *
141: * @generated
142: */
143: protected void addRenderExecutorPropertyDescriptor(Object object) {
144: itemPropertyDescriptors
145: .add(createItemPropertyDescriptor(
146: ((ComposeableAdapterFactory) adapterFactory)
147: .getRootAdapterFactory(),
148: getResourceLocator(),
149: getString("_UI_RenderManager_renderExecutor_feature"), //$NON-NLS-1$
150: getString(
151: "_UI_PropertyDescriptor_description", "_UI_RenderManager_renderExecutor_feature", "_UI_RenderManager_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
152: RenderPackage.eINSTANCE
153: .getRenderManager_RenderExecutor(),
154: true, null, null, null));
155: }
156:
157: /**
158: * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate
159: * feature for an {@link org.eclipse.emf.edit.command.AddCommand},
160: * {@link org.eclipse.emf.edit.command.RemoveCommand} or
161: * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. <!--
162: * begin-user-doc --> <!-- end-user-doc -->
163: *
164: * @generated
165: */
166: public Collection getChildrenFeatures(Object object) {
167: if (childrenFeatures == null) {
168: super .getChildrenFeatures(object);
169: }
170: return childrenFeatures;
171: }
172:
173: /**
174: * This returns RenderManager.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
175: *
176: * @generated
177: */
178: public Object getImage(Object object) {
179: return getResourceLocator()
180: .getImage("full/obj16/RenderManager"); //$NON-NLS-1$
181: }
182:
183: /**
184: * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc
185: * -->
186: *
187: * @generated NOT
188: */
189: public String getText(Object object) {
190: IMapDisplay labelValue = ((RenderManager) object)
191: .getMapDisplay();
192: String label = labelValue == null ? null : labelValue
193: .toString();
194: return label == null || label.length() == 0 ? "RenderManager"
195: : label;
196: }
197:
198: /**
199: * This handles model notifications by calling {@link #updateChildren} to update any cached
200: * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
201: * <!-- begin-user-doc --> <!-- end-user-doc -->
202: *
203: * @generated
204: */
205: public void notifyChanged(Notification notification) {
206: updateChildren(notification);
207:
208: switch (notification.getFeatureID(RenderManager.class)) {
209: case RenderPackage.RENDER_MANAGER__MAP_DISPLAY:
210: fireNotifyChanged(new ViewerNotification(notification,
211: notification.getNotifier(), false, true));
212: return;
213: }
214: super .notifyChanged(notification);
215: }
216:
217: /**
218: * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s
219: * describing all of the children that can be created under this object. <!-- begin-user-doc -->
220: * <!-- end-user-doc -->
221: *
222: * @generated NOT
223: */
224: protected void collectNewChildDescriptors(
225: Collection newChildDescriptors, Object object) {
226: super .collectNewChildDescriptors(newChildDescriptors, object);
227: }
228:
229: /**
230: * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!--
231: * end-user-doc -->
232: *
233: * @generated
234: */
235: public ResourceLocator getResourceLocator() {
236: return ProjectEditPlugin.INSTANCE;
237: }
238:
239: }
|