001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id$
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.ProjectPackage;
012: import net.refractions.udig.project.internal.StyleBlackboard;
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
027: * {@link net.refractions.udig.project.internal.StyleBlackboard} object. <!-- begin-user-doc -->
028: * <!-- end-user-doc -->
029: *
030: * @generated
031: */
032: public class StyleBlackboardItemProvider extends ItemProviderAdapter
033: implements IEditingDomainItemProvider,
034: IStructuredItemContentProvider, ITreeItemContentProvider,
035: IItemLabelProvider, IItemPropertySource {
036: /**
037: * <!-- begin-user-doc --> <!-- end-user-doc -->
038: *
039: * @generated
040: */
041: 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$
042:
043: /**
044: * This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!--
045: * end-user-doc -->
046: *
047: * @generated
048: */
049: public StyleBlackboardItemProvider(AdapterFactory adapterFactory) {
050: super (adapterFactory);
051: }
052:
053: /**
054: * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!--
055: * end-user-doc -->
056: *
057: * @generated
058: */
059: public List getPropertyDescriptors(Object object) {
060: if (itemPropertyDescriptors == null) {
061: super .getPropertyDescriptors(object);
062:
063: }
064: return itemPropertyDescriptors;
065: }
066:
067: /**
068: * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate
069: * feature for an {@link org.eclipse.emf.edit.command.AddCommand},
070: * {@link org.eclipse.emf.edit.command.RemoveCommand} or
071: * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. <!--
072: * begin-user-doc --> <!-- end-user-doc -->
073: *
074: * @generated
075: */
076: public Collection getChildrenFeatures(Object object) {
077: if (childrenFeatures == null) {
078: super .getChildrenFeatures(object);
079: childrenFeatures.add(ProjectPackage.eINSTANCE
080: .getStyleBlackboard_Content());
081: }
082: return childrenFeatures;
083: }
084:
085: /**
086: * This returns StyleBlackboard.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
087: *
088: * @generated
089: */
090: public Object getImage(Object object) {
091: return getResourceLocator().getImage(
092: "full/obj16/StyleBlackboard"); //$NON-NLS-1$
093: }
094:
095: /**
096: * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc
097: * -->
098: *
099: * @generated NOT
100: */
101: public String getText(Object object) {
102: return "StyleBlackboard";
103: }
104:
105: /**
106: * This handles model notifications by calling {@link #updateChildren} to update any cached
107: * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
108: * <!-- begin-user-doc --> <!-- end-user-doc -->
109: *
110: * @generated
111: */
112: public void notifyChanged(Notification notification) {
113: updateChildren(notification);
114:
115: switch (notification.getFeatureID(StyleBlackboard.class)) {
116: case ProjectPackage.STYLE_BLACKBOARD__CONTENT:
117: fireNotifyChanged(new ViewerNotification(notification,
118: notification.getNotifier(), true, false));
119: return;
120: }
121: super .notifyChanged(notification);
122: }
123:
124: /**
125: * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!--
126: * end-user-doc -->
127: *
128: * @generated
129: */
130: public ResourceLocator getResourceLocator() {
131: return ProjectEditPlugin.INSTANCE;
132: }
133:
134: }
|