001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id: RenderExecutorItemProvider.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.RenderExecutor;
013: import net.refractions.udig.project.internal.render.RenderPackage;
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:
025: /**
026: * This is the item provider adapter for a
027: * {@link net.refractions.udig.project.internal.render.RenderExecutor} object. <!-- begin-user-doc
028: * --> <!-- end-user-doc -->
029: *
030: * @generated
031: */
032: public class RenderExecutorItemProvider extends RendererItemProvider
033: implements IEditingDomainItemProvider,
034: IStructuredItemContentProvider, ITreeItemContentProvider,
035: IItemLabelProvider, IItemPropertySource {
036:
037: /**
038: * <!-- begin-user-doc --> <!-- end-user-doc -->
039: *
040: * @generated
041: */
042: 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$
043:
044: /**
045: * This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!--
046: * end-user-doc -->
047: *
048: * @generated
049: */
050: public RenderExecutorItemProvider(AdapterFactory adapterFactory) {
051: super (adapterFactory);
052: }
053:
054: /**
055: * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!--
056: * end-user-doc -->
057: *
058: * @generated
059: */
060: public List getPropertyDescriptors(Object object) {
061: if (itemPropertyDescriptors == null) {
062: super .getPropertyDescriptors(object);
063:
064: addRendererPropertyDescriptor(object);
065: }
066: return itemPropertyDescriptors;
067: }
068:
069: /**
070: * This adds a property descriptor for the Renderer feature. <!-- begin-user-doc --> <!--
071: * end-user-doc -->
072: *
073: * @generated
074: */
075: protected void addRendererPropertyDescriptor(Object object) {
076: itemPropertyDescriptors
077: .add(createItemPropertyDescriptor(
078: ((ComposeableAdapterFactory) adapterFactory)
079: .getRootAdapterFactory(),
080: getResourceLocator(),
081: getString("_UI_RenderExecutor_renderer_feature"), //$NON-NLS-1$
082: getString(
083: "_UI_PropertyDescriptor_description", "_UI_RenderExecutor_renderer_feature", "_UI_RenderExecutor_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
084: RenderPackage.eINSTANCE
085: .getRenderExecutor_Renderer(), true,
086: null, null, null));
087: }
088:
089: /**
090: * This returns RenderExecutor.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
091: *
092: * @generated
093: */
094: public Object getImage(Object object) {
095: return getResourceLocator().getImage(
096: "full/obj16/RenderExecutor"); //$NON-NLS-1$
097: }
098:
099: /**
100: * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc
101: * -->
102: *
103: * @generated NOT
104: */
105: public String getText(Object object) {
106: String label = ((RenderExecutor) object).getName();
107: return label == null || label.length() == 0 ? "RenderExecutor"
108: : label;
109: }
110:
111: /**
112: * This handles model notifications by calling {@link #updateChildren} to update any cached
113: * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
114: * <!-- begin-user-doc --> <!-- end-user-doc -->
115: *
116: * @generated
117: */
118: public void notifyChanged(Notification notification) {
119: updateChildren(notification);
120: super .notifyChanged(notification);
121: }
122:
123: /**
124: * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s
125: * describing all of the children that can be created under this object. <!-- begin-user-doc -->
126: * <!-- end-user-doc -->
127: *
128: * @generated
129: */
130: protected void collectNewChildDescriptors(
131: Collection newChildDescriptors, Object object) {
132: super .collectNewChildDescriptors(newChildDescriptors, object);
133: }
134:
135: /**
136: * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!--
137: * end-user-doc -->
138: *
139: * @generated
140: */
141: public ResourceLocator getResourceLocator() {
142: return ProjectEditPlugin.INSTANCE;
143: }
144:
145: }
|