001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id: ViewportModelItemProvider.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.RenderPackage;
013: import net.refractions.udig.project.internal.render.ViewportModel;
014:
015: import org.eclipse.emf.common.notify.AdapterFactory;
016: import org.eclipse.emf.common.notify.Notification;
017: import org.eclipse.emf.common.util.ResourceLocator;
018: import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
019: import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
020: import org.eclipse.emf.edit.provider.IItemLabelProvider;
021: import org.eclipse.emf.edit.provider.IItemPropertySource;
022: import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
023: import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
024: import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
025: import org.eclipse.emf.edit.provider.ItemProviderAdapter;
026: import org.eclipse.emf.edit.provider.ViewerNotification;
027:
028: /**
029: * This is the item provider adapter for a
030: * {@link net.refractions.udig.project.internal.render.ViewportModel} object. <!-- begin-user-doc
031: * --> <!-- end-user-doc -->
032: *
033: * @generated
034: */
035: public class ViewportModelItemProvider extends ItemProviderAdapter
036: implements IEditingDomainItemProvider,
037: IStructuredItemContentProvider, ITreeItemContentProvider,
038: IItemLabelProvider, IItemPropertySource {
039: /**
040: * <!-- begin-user-doc --> <!-- end-user-doc -->
041: *
042: * @generated
043: */
044: 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$
045:
046: /**
047: * This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!--
048: * end-user-doc -->
049: *
050: * @generated
051: */
052: public ViewportModelItemProvider(AdapterFactory adapterFactory) {
053: super (adapterFactory);
054: }
055:
056: /**
057: * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!--
058: * end-user-doc -->
059: *
060: * @generated NOT
061: */
062: public List getPropertyDescriptors(Object object) {
063: if (itemPropertyDescriptors == null) {
064: super .getPropertyDescriptors(object);
065:
066: addCRSPropertyDescriptor(object);
067: addBoundsPropertyDescriptor(object);
068: addCenterPropertyDescriptor(object);
069: addHeightPropertyDescriptor(object);
070: addWidthPropertyDescriptor(object);
071: }
072: return itemPropertyDescriptors;
073: }
074:
075: /**
076: * This adds a property descriptor for the CRS feature. <!-- begin-user-doc --> <!--
077: * end-user-doc -->
078: *
079: * @generated
080: */
081: protected void addCRSPropertyDescriptor(Object object) {
082: itemPropertyDescriptors
083: .add(createItemPropertyDescriptor(
084: ((ComposeableAdapterFactory) adapterFactory)
085: .getRootAdapterFactory(),
086: getResourceLocator(),
087: getString("_UI_ViewportModel_cRS_feature"), //$NON-NLS-1$
088: getString(
089: "_UI_PropertyDescriptor_description", "_UI_ViewportModel_cRS_feature", "_UI_ViewportModel_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
090: RenderPackage.eINSTANCE.getViewportModel_CRS(),
091: true,
092: ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
093: null, null));
094: }
095:
096: /**
097: * This adds a property descriptor for the Bounds feature. <!-- begin-user-doc --> <!--
098: * end-user-doc -->
099: *
100: * @generated
101: */
102: protected void addBoundsPropertyDescriptor(Object object) {
103: itemPropertyDescriptors
104: .add(createItemPropertyDescriptor(
105: ((ComposeableAdapterFactory) adapterFactory)
106: .getRootAdapterFactory(),
107: getResourceLocator(),
108: getString("_UI_ViewportModel_bounds_feature"), //$NON-NLS-1$
109: getString(
110: "_UI_PropertyDescriptor_description", "_UI_ViewportModel_bounds_feature", "_UI_ViewportModel_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
111: RenderPackage.eINSTANCE
112: .getViewportModel_Bounds(), true,
113: ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
114: null, null));
115: }
116:
117: /**
118: * This adds a property descriptor for the Center feature. <!-- begin-user-doc --> <!--
119: * end-user-doc -->
120: *
121: * @generated NOT
122: */
123: protected void addCenterPropertyDescriptor(Object object) {
124: itemPropertyDescriptors
125: .add(new ItemPropertyDescriptor(
126: ((ComposeableAdapterFactory) adapterFactory)
127: .getRootAdapterFactory(),
128: getResourceLocator(),
129: getString("_UI_ViewportModel_center_feature"), //$NON-NLS-1$
130: getString(
131: "_UI_PropertyDescriptor_description", "_UI_ViewportModel_center_feature", "_UI_ViewportModel_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
132: RenderPackage.eINSTANCE
133: .getViewportModel_Center(), false,
134: ItemPropertyDescriptor.GENERIC_VALUE_IMAGE));
135: }
136:
137: /**
138: * This adds a property descriptor for the Height feature. <!-- begin-user-doc --> <!--
139: * end-user-doc -->
140: *
141: * @generated NOT
142: */
143: protected void addHeightPropertyDescriptor(Object object) {
144: itemPropertyDescriptors
145: .add(new ItemPropertyDescriptor(
146: ((ComposeableAdapterFactory) adapterFactory)
147: .getRootAdapterFactory(),
148: getResourceLocator(),
149: getString("_UI_ViewportModel_height_feature"), //$NON-NLS-1$
150: getString(
151: "_UI_PropertyDescriptor_description", "_UI_ViewportModel_height_feature", "_UI_ViewportModel_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
152: RenderPackage.eINSTANCE
153: .getViewportModel_Height(), false,
154: ItemPropertyDescriptor.REAL_VALUE_IMAGE));
155: }
156:
157: /**
158: * This adds a property descriptor for the Width feature. <!-- begin-user-doc --> <!--
159: * end-user-doc -->
160: *
161: * @generated NOT
162: */
163: protected void addWidthPropertyDescriptor(Object object) {
164: itemPropertyDescriptors
165: .add(new ItemPropertyDescriptor(
166: ((ComposeableAdapterFactory) adapterFactory)
167: .getRootAdapterFactory(),
168: getResourceLocator(),
169: getString("_UI_ViewportModel_width_feature"), //$NON-NLS-1$
170: getString(
171: "_UI_PropertyDescriptor_description", "_UI_ViewportModel_width_feature", "_UI_ViewportModel_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
172: RenderPackage.eINSTANCE
173: .getViewportModel_Width(), false,
174: ItemPropertyDescriptor.REAL_VALUE_IMAGE));
175: }
176:
177: /**
178: * This adds a property descriptor for the Aspect Ratio feature. <!-- begin-user-doc --> <!--
179: * end-user-doc -->
180: *
181: * @generated
182: */
183: protected void addAspectRatioPropertyDescriptor(Object object) {
184: itemPropertyDescriptors
185: .add(createItemPropertyDescriptor(
186: ((ComposeableAdapterFactory) adapterFactory)
187: .getRootAdapterFactory(),
188: getResourceLocator(),
189: getString("_UI_ViewportModel_aspectRatio_feature"), //$NON-NLS-1$
190: getString(
191: "_UI_PropertyDescriptor_description", "_UI_ViewportModel_aspectRatio_feature", "_UI_ViewportModel_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
192: RenderPackage.eINSTANCE
193: .getViewportModel_AspectRatio(), false,
194: ItemPropertyDescriptor.REAL_VALUE_IMAGE, null,
195: null));
196: }
197:
198: /**
199: * This adds a property descriptor for the Pixel Size feature. <!-- begin-user-doc --> <!--
200: * end-user-doc -->
201: *
202: * @generated
203: */
204: protected void addPixelSizePropertyDescriptor(Object object) {
205: itemPropertyDescriptors
206: .add(createItemPropertyDescriptor(
207: ((ComposeableAdapterFactory) adapterFactory)
208: .getRootAdapterFactory(),
209: getResourceLocator(),
210: getString("_UI_ViewportModel_pixelSize_feature"), //$NON-NLS-1$
211: getString(
212: "_UI_PropertyDescriptor_description", "_UI_ViewportModel_pixelSize_feature", "_UI_ViewportModel_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
213: RenderPackage.eINSTANCE
214: .getViewportModel_PixelSize(), false,
215: ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
216: null, null));
217: }
218:
219: /**
220: * This adds a property descriptor for the Render Manager Internal feature. <!-- begin-user-doc
221: * --> <!-- end-user-doc -->
222: *
223: * @generated
224: */
225: protected void addRenderManagerInternalPropertyDescriptor(
226: Object object) {
227: itemPropertyDescriptors
228: .add(createItemPropertyDescriptor(
229: ((ComposeableAdapterFactory) adapterFactory)
230: .getRootAdapterFactory(),
231: getResourceLocator(),
232: getString("_UI_ViewportModel_renderManagerInternal_feature"), //$NON-NLS-1$
233: getString(
234: "_UI_PropertyDescriptor_description", "_UI_ViewportModel_renderManagerInternal_feature", "_UI_ViewportModel_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
235: RenderPackage.eINSTANCE
236: .getViewportModel_RenderManagerInternal(),
237: true, null, null, null));
238: }
239:
240: /**
241: * This returns ViewportModel.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
242: *
243: * @generated
244: */
245: public Object getImage(Object object) {
246: return getResourceLocator()
247: .getImage("full/obj16/ViewportModel"); //$NON-NLS-1$
248: }
249:
250: /**
251: * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc
252: * -->
253: *
254: * @generated NOT
255: */
256: public String getText(Object object) {
257: return "ViewportModel";
258:
259: }
260:
261: /**
262: * This handles model notifications by calling {@link #updateChildren} to update any cached
263: * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
264: * <!-- begin-user-doc --> <!-- end-user-doc -->
265: *
266: * @generated
267: */
268: public void notifyChanged(Notification notification) {
269: updateChildren(notification);
270:
271: switch (notification.getFeatureID(ViewportModel.class)) {
272: case RenderPackage.VIEWPORT_MODEL__CRS:
273: case RenderPackage.VIEWPORT_MODEL__BOUNDS:
274: case RenderPackage.VIEWPORT_MODEL__CENTER:
275: case RenderPackage.VIEWPORT_MODEL__HEIGHT:
276: case RenderPackage.VIEWPORT_MODEL__WIDTH:
277: case RenderPackage.VIEWPORT_MODEL__ASPECT_RATIO:
278: case RenderPackage.VIEWPORT_MODEL__PIXEL_SIZE:
279: fireNotifyChanged(new ViewerNotification(notification,
280: notification.getNotifier(), false, true));
281: return;
282: }
283: super .notifyChanged(notification);
284: }
285:
286: /**
287: * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s
288: * describing all of the children that can be created under this object. <!-- begin-user-doc -->
289: * <!-- end-user-doc -->
290: *
291: * @generated
292: */
293: protected void collectNewChildDescriptors(
294: Collection newChildDescriptors, Object object) {
295: super .collectNewChildDescriptors(newChildDescriptors, object);
296: }
297:
298: /**
299: * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!--
300: * end-user-doc -->
301: *
302: * @generated
303: */
304: public ResourceLocator getResourceLocator() {
305: return ProjectEditPlugin.INSTANCE;
306: }
307:
308: }
|