01: /**
02: * <copyright>
03: * </copyright>
04: *
05: * $Id: LayerManagerItemProvider.java 15577 2005-09-02 17:55:00Z jeichar $
06: */package net.refractions.udig.project.internal.provider;
07:
08: import java.util.Collection;
09:
10: import net.refractions.udig.project.internal.EditManager;
11:
12: import org.eclipse.emf.common.notify.AdapterFactory;
13: import org.eclipse.emf.common.util.ResourceLocator;
14: import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
15: import org.eclipse.emf.edit.provider.IItemLabelProvider;
16: import org.eclipse.emf.edit.provider.IItemPropertySource;
17: import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
18: import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
19: import org.eclipse.emf.edit.provider.ItemProviderAdapter;
20: import org.geotools.feature.Feature;
21:
22: /**
23: * This is the item provider adpater for a {@link net.refractions.udig.project.LayerManager} object.
24: * <!-- begin-user-doc --> <!-- end-user-doc -->
25: *
26: * @generated
27: */
28: public class LayerManagerItemProvider extends ItemProviderAdapter
29: implements IEditingDomainItemProvider,
30: IStructuredItemContentProvider, ITreeItemContentProvider,
31: IItemLabelProvider, IItemPropertySource {
32: /**
33: * <!-- begin-user-doc --> <!-- end-user-doc -->
34: *
35: * @generated
36: */
37: 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$
38:
39: /**
40: * This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!--
41: * end-user-doc -->
42: *
43: * @generated
44: */
45: public LayerManagerItemProvider(AdapterFactory adapterFactory) {
46: super (adapterFactory);
47: }
48:
49: /**
50: * This returns LayerManager.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
51: *
52: * @generated
53: */
54: public Object getImage(Object object) {
55: return getResourceLocator().getImage("full/obj16/LayerManager"); //$NON-NLS-1$
56: }
57:
58: /**
59: * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc
60: * -->
61: *
62: * @generated
63: */
64: public String getText(Object object) {
65: Feature labelValue = ((EditManager) object).getEditFeature();
66: String label = labelValue == null ? null : labelValue
67: .toString();
68: return label == null || label.length() == 0 ? getString("_UI_LayerManager_type") : //$NON-NLS-1$
69: getString("_UI_LayerManager_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
70: }
71:
72: /**
73: * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s
74: * describing all of the children that can be created under this object. <!-- begin-user-doc -->
75: * <!-- end-user-doc -->
76: *
77: * @generated
78: */
79: protected void collectNewChildDescriptors(
80: Collection newChildDescriptors, Object object) {
81: super .collectNewChildDescriptors(newChildDescriptors, object);
82: }
83:
84: /**
85: * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!--
86: * end-user-doc -->
87: *
88: * @generated
89: */
90: public ResourceLocator getResourceLocator() {
91: return ProjectEditPlugin.INSTANCE;
92: }
93:
94: }
|