001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id$
006: */package net.refractions.udig.project.internal.provider;
007:
008: import java.util.List;
009:
010: import net.refractions.udig.project.internal.ProjectPackage;
011: import net.refractions.udig.project.internal.StyleEntry;
012:
013: import org.eclipse.emf.common.notify.AdapterFactory;
014: import org.eclipse.emf.common.notify.Notification;
015: import org.eclipse.emf.common.util.ResourceLocator;
016: import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
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.ItemPropertyDescriptor;
023: import org.eclipse.emf.edit.provider.ItemProviderAdapter;
024: import org.eclipse.emf.edit.provider.ViewerNotification;
025:
026: /**
027: * This is the item provider adapter for a {@link net.refractions.udig.project.internal.StyleEntry}
028: * object. <!-- begin-user-doc --> <!-- end-user-doc -->
029: *
030: * @generated
031: */
032: public class StyleEntryItemProvider 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 StyleEntryItemProvider(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: addIDPropertyDescriptor(object);
064: addMementoPropertyDescriptor(object);
065: addStylePropertyDescriptor(object);
066: addStyleClassPropertyDescriptor(object);
067: }
068: return itemPropertyDescriptors;
069: }
070:
071: /**
072: * This adds a property descriptor for the ID feature. <!-- begin-user-doc --> <!-- end-user-doc
073: * -->
074: *
075: * @generated
076: */
077: protected void addIDPropertyDescriptor(Object object) {
078: itemPropertyDescriptors
079: .add(createItemPropertyDescriptor(
080: ((ComposeableAdapterFactory) adapterFactory)
081: .getRootAdapterFactory(),
082: getResourceLocator(),
083: getString("_UI_StyleEntry_iD_feature"), //$NON-NLS-1$
084: getString(
085: "_UI_PropertyDescriptor_description", "_UI_StyleEntry_iD_feature", "_UI_StyleEntry_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
086: ProjectPackage.eINSTANCE.getStyleEntry_ID(),
087: true,
088: ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
089: null, null));
090: }
091:
092: /**
093: * This adds a property descriptor for the Memento feature. <!-- begin-user-doc --> <!--
094: * end-user-doc -->
095: *
096: * @generated
097: */
098: protected void addMementoPropertyDescriptor(Object object) {
099: itemPropertyDescriptors
100: .add(createItemPropertyDescriptor(
101: ((ComposeableAdapterFactory) adapterFactory)
102: .getRootAdapterFactory(),
103: getResourceLocator(),
104: getString("_UI_StyleEntry_memento_feature"), //$NON-NLS-1$
105: getString(
106: "_UI_PropertyDescriptor_description", "_UI_StyleEntry_memento_feature", "_UI_StyleEntry_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
107: ProjectPackage.eINSTANCE
108: .getStyleEntry_Memento(), true,
109: ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
110: null, null));
111: }
112:
113: /**
114: * This adds a property descriptor for the Style feature. <!-- begin-user-doc --> <!--
115: * end-user-doc -->
116: *
117: * @generated
118: */
119: protected void addStylePropertyDescriptor(Object object) {
120: itemPropertyDescriptors
121: .add(createItemPropertyDescriptor(
122: ((ComposeableAdapterFactory) adapterFactory)
123: .getRootAdapterFactory(),
124: getResourceLocator(),
125: getString("_UI_StyleEntry_style_feature"), //$NON-NLS-1$
126: getString(
127: "_UI_PropertyDescriptor_description", "_UI_StyleEntry_style_feature", "_UI_StyleEntry_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
128: ProjectPackage.eINSTANCE.getStyleEntry_Style(),
129: true,
130: ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
131: null, null));
132: }
133:
134: /**
135: * This adds a property descriptor for the Style Class feature. <!-- begin-user-doc --> <!--
136: * end-user-doc -->
137: *
138: * @generated
139: */
140: protected void addStyleClassPropertyDescriptor(Object object) {
141: itemPropertyDescriptors
142: .add(createItemPropertyDescriptor(
143: ((ComposeableAdapterFactory) adapterFactory)
144: .getRootAdapterFactory(),
145: getResourceLocator(),
146: getString("_UI_StyleEntry_styleClass_feature"), //$NON-NLS-1$
147: getString(
148: "_UI_PropertyDescriptor_description", "_UI_StyleEntry_styleClass_feature", "_UI_StyleEntry_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
149: ProjectPackage.eINSTANCE
150: .getStyleEntry_StyleClass(), true,
151: ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
152: null, null));
153: }
154:
155: /**
156: * This returns StyleEntry.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
157: *
158: * @generated
159: */
160: public Object getImage(Object object) {
161: return getResourceLocator().getImage("full/obj16/StyleEntry"); //$NON-NLS-1$
162: }
163:
164: /**
165: * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc
166: * -->
167: *
168: * @generated NOT
169: */
170: public String getText(Object object) {
171: String label = ((StyleEntry) object).getID();
172: return label == null || label.length() == 0 ? "StyleEntry"
173: : label;
174: }
175:
176: /**
177: * This handles model notifications by calling {@link #updateChildren} to update any cached
178: * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
179: * <!-- begin-user-doc --> <!-- end-user-doc -->
180: *
181: * @generated
182: */
183: public void notifyChanged(Notification notification) {
184: updateChildren(notification);
185:
186: switch (notification.getFeatureID(StyleEntry.class)) {
187: case ProjectPackage.STYLE_ENTRY__ID:
188: case ProjectPackage.STYLE_ENTRY__MEMENTO:
189: case ProjectPackage.STYLE_ENTRY__STYLE:
190: case ProjectPackage.STYLE_ENTRY__STYLE_CLASS:
191: fireNotifyChanged(new ViewerNotification(notification,
192: notification.getNotifier(), false, true));
193: return;
194: }
195: super .notifyChanged(notification);
196: }
197:
198: /**
199: * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!--
200: * end-user-doc -->
201: *
202: * @generated
203: */
204: public ResourceLocator getResourceLocator() {
205: return ProjectEditPlugin.INSTANCE;
206: }
207:
208: }
|