## org.eclipse.emf.edit.ui.provider
Class AdapterFactoryLabelProvider

    java.lang.Object
      org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider

All Implemented Interfaces:
  INotifyChangedListener, IBaseLabelProvider, ILabelProvider, ITableLabelProvider

Direct Known Subclasses:
  MappingDomainLabelProvider

    public class AdapterFactoryLabelProvider

extends java.lang.Object
implements ILabelProvider, ITableLabelProvider, INotifyChangedListener

This label provider wraps an AdapterFactory and it delegates its JFace provider interfaces to corresponding adapter-implemented item provider interfaces. All method calls to the various label provider interfaces are delegated to interfaces implemented by the adapters generated by the AdapterFactory. `ILabelProvider` is delegated to `IItemLabelProvider`; and `ITableLabelProvider` is delegated to `ITableItemLabelProvider`.

The label provider has no mechanism for notifying the viewer of changes. As long as the AdapterFactory is also used in an AdapterFactoryContentProvider, this won't be a problem, because notifications will be forward as a result of that.

Field Summary
`protected AdapterFactory` `adapterFactory` This keep track of the one factory we are using.
`protected java.util.Collection<ILabelProviderListener>` `labelProviderListeners` This keeps track of the label provider listeners.

Constructor Summary
`AdapterFactoryLabelProvider(AdapterFactory adapterFactory)` Construct an instance that wraps this factory.

Method Summary
`void` `addListener(ILabelProviderListener listener)` Since we won't ever generate these notifications, we can just ignore this.
`void` `dispose()` This discards the content provider and removes this as a listener to the `adapterFactory`.
`void` `fireLabelProviderChanged()`
`AdapterFactory` `getAdapterFactory()` Return the wrapped AdapterFactory.
`Image` `getColumnImage(java.lang.Object object, int columnIndex)` This implements `ITableLabelProvider`.getColumnmage by forwarding it to an object that implements `ITableItemLabelProvider.getColumnImage` or failing that, an object that implements `IItemLabelProvider.getImage` where the columnIndex is ignored.
`java.lang.String` `getColumnText(java.lang.Object object, int columnIndex)` This implements `ITableLabelProvider`.getColumnText by forwarding it to an object that implements `ITableItemLabelProvider.getColumnText` or failing that, an object that implements `IItemLabelProvider.getText` where the columnIndex are is ignored.
`protected Image` `getDefaultImage(java.lang.Object object)`
`Image` `getImage(java.lang.Object object)` This implements `ILabelProvider`.getImage by forwarding it to an object that implements `IItemLabelProvider.getImage`
`protected Image` `getImageFromObject(java.lang.Object object)`
`java.lang.String` `getText(java.lang.Object object)` This implements `ILabelProvider`.getText by forwarding it to an object that implements `IItemLabelProvider.getText`
`boolean` `isLabelProperty(java.lang.Object object, java.lang.String id)` This always returns true right now.
`void` `notifyChanged(Notification notification)`
`void` `removeListener(ILabelProviderListener listener)` Since we won't ever add listeners, we can just ignore this.
`void` `setAdapterFactory(AdapterFactory adapterFactory)` Set the wrapped AdapterFactory.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### adapterFactory

    protected AdapterFactory adapterFactory

  This keep track of the one factory we are using. Use a `ComposedAdapterFactory` if adapters from more the one factory are involved in the model.

### labelProviderListeners

    protected java.util.Collection<ILabelProviderListener> labelProviderListeners

  This keeps track of the label provider listeners.

Constructor Detail

### AdapterFactoryLabelProvider

    public AdapterFactoryLabelProvider(AdapterFactory adapterFactory)

  Construct an instance that wraps this factory. The AdapterFactory should yield adapters that implement the various item label provider interfaces.

Method Detail

### getAdapterFactory

    public AdapterFactory getAdapterFactory()

  Return the wrapped AdapterFactory.

### setAdapterFactory

    public void setAdapterFactory(AdapterFactory adapterFactory)

  Set the wrapped AdapterFactory.

### addListener

    public void addListener(ILabelProviderListener listener)

  Since we won't ever generate these notifications, we can just ignore this.

  Specified by:
    `addListener` in interface `IBaseLabelProvider`

### removeListener

    public void removeListener(ILabelProviderListener listener)

  Since we won't ever add listeners, we can just ignore this.

  Specified by:
    `removeListener` in interface `IBaseLabelProvider`

### dispose

    public void dispose()

  This discards the content provider and removes this as a listener to the `adapterFactory`.

  Specified by:
    `dispose` in interface `IBaseLabelProvider`

### isLabelProperty

    public boolean isLabelProperty(java.lang.Object object,
                                   java.lang.String id)

  This always returns true right now.

  Specified by:
    `isLabelProperty` in interface `IBaseLabelProvider`

### getImage

    public Image getImage(java.lang.Object object)

  This implements `ILabelProvider`.getImage by forwarding it to an object that implements `IItemLabelProvider.getImage`

  Specified by:
    `getImage` in interface `ILabelProvider`

### getDefaultImage

    protected Image getDefaultImage(java.lang.Object object)

### getImageFromObject

    protected Image getImageFromObject(java.lang.Object object)

### getText

    public java.lang.String getText(java.lang.Object object)

  This implements `ILabelProvider`.getText by forwarding it to an object that implements `IItemLabelProvider.getText`

  Specified by:
    `getText` in interface `ILabelProvider`

### getColumnImage

    public Image getColumnImage(java.lang.Object object,
                                int columnIndex)

  This implements `ITableLabelProvider`.getColumnmage by forwarding it to an object that implements `ITableItemLabelProvider.getColumnImage` or failing that, an object that implements `IItemLabelProvider.getImage` where the columnIndex is ignored.

  Specified by:
    `getColumnImage` in interface `ITableLabelProvider`

### getColumnText

    public java.lang.String getColumnText(java.lang.Object object,
                                          int columnIndex)

  This implements `ITableLabelProvider`.getColumnText by forwarding it to an object that implements `ITableItemLabelProvider.getColumnText` or failing that, an object that implements `IItemLabelProvider.getText` where the columnIndex are is ignored.

  Specified by:
    `getColumnText` in interface `ITableLabelProvider`

### fireLabelProviderChanged

    public void fireLabelProviderChanged()

### notifyChanged

    public void notifyChanged(Notification notification)

  Specified by:
    `notifyChanged` in interface `INotifyChangedListener`

Copyright 2001-2006 IBM Corporation and others. All Rights Reserved.