001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id: BlackboardItemProvider.java 24145 2007-02-01 18:03:34Z jeichar $
006: */package net.refractions.udig.project.internal.provider;
007:
008: import java.util.Collection;
009: import java.util.List;
010:
011: import net.refractions.udig.project.internal.Blackboard;
012: import net.refractions.udig.project.internal.ProjectPackage;
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: import org.eclipse.emf.edit.provider.ItemProviderAdapter;
023: import org.eclipse.emf.edit.provider.ViewerNotification;
024:
025: /**
026: * This is the item provider adapter for a {@link net.refractions.udig.project.internal.Blackboard}
027: * object. <!-- begin-user-doc --> <!-- end-user-doc -->
028: *
029: * @generated
030: */
031: public class BlackboardItemProvider extends ItemProviderAdapter
032: implements IEditingDomainItemProvider,
033: IStructuredItemContentProvider, ITreeItemContentProvider,
034: IItemLabelProvider, IItemPropertySource {
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 BlackboardItemProvider(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 specifies how to implement {@link #getChildren} and is used to deduce an appropriate
068: * feature for an {@link org.eclipse.emf.edit.command.AddCommand},
069: * {@link org.eclipse.emf.edit.command.RemoveCommand} or
070: * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. <!--
071: * begin-user-doc --> <!-- end-user-doc -->
072: *
073: * @generated
074: */
075: public Collection getChildrenFeatures(Object object) {
076: if (childrenFeatures == null) {
077: super .getChildrenFeatures(object);
078: childrenFeatures.add(ProjectPackage.eINSTANCE
079: .getBlackboard_Entries());
080: }
081: return childrenFeatures;
082: }
083:
084: /**
085: * This returns Blackboard.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
086: *
087: * @generated
088: */
089: public Object getImage(Object object) {
090: return getResourceLocator().getImage("full/obj16/Blackboard"); //$NON-NLS-1$
091: }
092:
093: /**
094: * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc
095: * -->
096: *
097: * @generated NOT
098: */
099: public String getText(Object object) {
100: return "Blackboard";
101: }
102:
103: /**
104: * This handles model notifications by calling {@link #updateChildren} to update any cached
105: * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
106: * <!-- begin-user-doc --> <!-- end-user-doc -->
107: *
108: * @generated
109: */
110: public void notifyChanged(Notification notification) {
111: updateChildren(notification);
112:
113: switch (notification.getFeatureID(Blackboard.class)) {
114: case ProjectPackage.BLACKBOARD__ENTRIES:
115: fireNotifyChanged(new ViewerNotification(notification,
116: notification.getNotifier(), true, false));
117: return;
118: }
119: super .notifyChanged(notification);
120: }
121:
122: /**
123: * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!--
124: * end-user-doc -->
125: *
126: * @generated
127: */
128: public ResourceLocator getResourceLocator() {
129: return ProjectEditPlugin.INSTANCE;
130: }
131:
132: }
|