001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id: CompositeRendererItemProvider.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.MultiLayerRenderer;
013:
014: import org.eclipse.emf.common.notify.AdapterFactory;
015: import org.eclipse.emf.common.notify.Notification;
016: import org.eclipse.emf.common.util.ResourceLocator;
017: import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
018: import org.eclipse.emf.edit.provider.IItemLabelProvider;
019: import org.eclipse.emf.edit.provider.IItemPropertySource;
020: import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
021: import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
022:
023: /**
024: * This is the item provider adpater for a
025: * {@link net.refractions.udig.project.render.CompositeRenderer} object. <!-- begin-user-doc -->
026: * <!-- end-user-doc -->
027: *
028: * @generated
029: */
030: public class CompositeRendererItemProvider extends RendererItemProvider
031: implements IEditingDomainItemProvider,
032: IStructuredItemContentProvider, ITreeItemContentProvider,
033: IItemLabelProvider, IItemPropertySource {
034:
035: /**
036: * <!-- begin-user-doc --> <!-- end-user-doc -->
037: *
038: * @generated
039: */
040: 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$
041:
042: /**
043: * This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!--
044: * end-user-doc -->
045: *
046: * @generated
047: */
048: public CompositeRendererItemProvider(AdapterFactory adapterFactory) {
049: super (adapterFactory);
050: }
051:
052: /**
053: * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!--
054: * end-user-doc -->
055: *
056: * @generated
057: */
058: public List getPropertyDescriptors(Object object) {
059: if (itemPropertyDescriptors == null) {
060: super .getPropertyDescriptors(object);
061:
062: }
063: return itemPropertyDescriptors;
064: }
065:
066: /**
067: * This returns CompositeRenderer.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
068: *
069: * @generated
070: */
071: public Object getImage(Object object) {
072: return getResourceLocator().getImage(
073: "full/obj16/CompositeRenderer"); //$NON-NLS-1$
074: }
075:
076: /**
077: * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc
078: * -->
079: *
080: * @generated NOT
081: */
082: public String getText(Object object) {
083: String label = ((MultiLayerRenderer) object).getName();
084: return label == null || label.length() == 0 ? "CompositeRenderer"
085: : "CompositeRenderer" + " " + label;
086: }
087:
088: /**
089: * This handles model notifications by calling {@link #updateChildren} to update any cached
090: * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
091: * <!-- begin-user-doc --> <!-- end-user-doc -->
092: *
093: * @generated
094: */
095: public void notifyChanged(Notification notification) {
096: updateChildren(notification);
097: super .notifyChanged(notification);
098: }
099:
100: /**
101: * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s
102: * describing all of the children that can be created under this object. <!-- begin-user-doc -->
103: * <!-- end-user-doc -->
104: *
105: * @generated
106: */
107: protected void collectNewChildDescriptors(
108: Collection newChildDescriptors, Object object) {
109: super .collectNewChildDescriptors(newChildDescriptors, object);
110: }
111:
112: /**
113: * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!--
114: * end-user-doc -->
115: *
116: * @generated
117: */
118: public ResourceLocator getResourceLocator() {
119: return ProjectEditPlugin.INSTANCE;
120: }
121:
122: }
|