public class ItemProviderDecorator extends java.lang.Object implements INotifyChangedListener, IItemProviderDecorator, IChangeNotifier, IDisposable
IEditingDomainItemProvider
, IItemLabelProvider
, IItemPropertySource
, IStructuredItemContentProvider
,
IItemFontProvider
, IItemColorProvider
,
ITableItemFontProvider
, ITableItemColorProvider
,
ITableItemLabelProvider
, and ITreeItemContentProvider
, and IUpdateableItemText.getUpdateableText(java.lang.Object)
.Modifier and Type | Field and Description |
---|---|
protected AdapterFactory |
adapterFactory
This keeps track of the adapter factory that created this adaptor.
|
protected IChangeNotifier |
changeNotifier
This is used to implement
IChangeNotifier . |
protected IChangeNotifier |
decoratedItemProvider
This keeps track of the item provider being decorated.
|
Constructor and Description |
---|
ItemProviderDecorator(AdapterFactory adapterFactory)
An instance is created from an adapter factory.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(INotifyChangedListener listener)
This adds another listener.
|
Command |
createCommand(java.lang.Object object,
EditingDomain domain,
java.lang.Class<? extends Command> commandClass,
CommandParameter commandParameter)
This implements
IEditingDomainItemProvider.createCommand
by delegating to (IEditingDomainItemProvider) decoratedItemProvider . |
void |
dispose()
This is called to dispose the object.
|
void |
fireNotifyChanged(Notification notification)
This delegates to the
adapterFactory . |
AdapterFactory |
getAdapterFactory()
This provides access to the factory.
|
java.lang.Object |
getBackground(java.lang.Object object)
This implements
IItemColorProvider.getBackground
by delegating to (IItemColorProvider) decoratedItemProvider . |
java.lang.Object |
getBackground(java.lang.Object object,
int columnIndex)
This implements
ITableItemColorProvider.getBackground
by delegating to (ITableItemColorProvider) decoratedItemProvider . |
java.util.Collection<?> |
getChildren(java.lang.Object object)
This implements
ITreeItemContentProvider.getChildren
by delegating to (ITreeItemContentProvider) decoratedItemProvider . |
java.lang.Object |
getColumnImage(java.lang.Object object,
int columnIndex)
This implements
ITableItemLabelProvider.getColumnImage
by delegating to (ITableItemLabelProvider) decoratedItemProvider . |
java.lang.String |
getColumnText(java.lang.Object object,
int columnIndex)
This implements
ITableItemLabelProvider.getColumnText
by delegating to (ITableItemLabelProvider) decoratedItemProvider . |
IChangeNotifier |
getDecoratedItemProvider()
This returns the item provider that this decorates.
|
java.lang.Object |
getEditableValue(java.lang.Object object)
This implements
IItemPropertySource.getEditableValue
by delegating to (IItemPropertySource) decoratedItemProvider . |
java.util.Collection<?> |
getElements(java.lang.Object object)
This implements
IStructuredItemContentProvider.getElements
by delegating to (IStructuredItemContentProvider) decoratedItemProvider . |
java.lang.Object |
getFont(java.lang.Object object)
This implements
IItemFontProvider.getFont
by delegating to (IItemFontProvider) decoratedItemProvider . |
java.lang.Object |
getFont(java.lang.Object object,
int columnIndex)
This implements
ITableItemFontProvider.getFont
by delegating to (IItemFontProvider) decoratedItemProvider . |
java.lang.Object |
getForeground(java.lang.Object object)
This implements
IItemColorProvider.getForeground
by delegating to (IItemColorProvider) decoratedItemProvider . |
java.lang.Object |
getForeground(java.lang.Object object,
int columnIndex)
This implements
ITableItemColorProvider.getForeground
by delegating to (ITableItemColorProvider) decoratedItemProvider . |
java.lang.Object |
getImage(java.lang.Object object)
This implements
IItemLabelProvider.getImage
by delegating to (IItemLabelProvider) decoratedItemProvider . |
java.util.Collection<?> |
getNewChildDescriptors(java.lang.Object object,
EditingDomain editingDomain,
java.lang.Object sibling)
This implements
IEditingDomainItemProvider.getNewChildDescriptors by delegating to
(IEditingDomainItemProvider) decoratedItemProvider . |
java.lang.Object |
getParent(java.lang.Object object)
This implements
ITreeItemContentProvider.getParent
by delegating to (ITreeItemContentProvider) decoratedItemProvider . |
IItemPropertyDescriptor |
getPropertyDescriptor(java.lang.Object object,
java.lang.Object propertyId)
This implements
IItemPropertySource.getPropertyDescriptors
by delegating to (IItemPropertySource) decoratedItemProvider . |
java.util.List<IItemPropertyDescriptor> |
getPropertyDescriptors(java.lang.Object object)
This implements
IItemPropertySource.getPropertyDescriptors
by delegating to (IItemPropertySource) decoratedItemProvider . |
java.lang.String |
getText(java.lang.Object object)
This implements
IItemLabelProvider.getText
by delegating to (IItemLabelProvider) decoratedItemProvider . |
java.lang.String |
getUpdateableText(java.lang.Object object)
This implements
IUpdateableItemText.getUpdateableText
by delegating to (IUpdateableItemText) decoratedItemProvider . |
boolean |
hasChildren(java.lang.Object object)
This implements
ITreeItemContentProvider.hasChildren
by delegating to (ITreeItemContentProvider) decoratedItemProvider . |
boolean |
isAdapterForType(java.lang.Object type)
This returns true, only if this adapter was created by the given factory; the adapter factory is used as the type key.
|
void |
notifyChanged(Notification notification)
This will be called by the
decoratedItemProvider when it normally fires a notification to it's adapter factory. |
void |
removeListener(INotifyChangedListener listener)
This removes a listener.
|
void |
setDecoratedItemProvider(IChangeNotifier decoratedItemProvider)
This sets the item provider that this decorates;
it also hooks up the
INotifyChangedListener . |
java.lang.String |
toString() |
protected AdapterFactory adapterFactory
protected IChangeNotifier decoratedItemProvider
protected IChangeNotifier changeNotifier
IChangeNotifier
.public ItemProviderDecorator(AdapterFactory adapterFactory)
public boolean isAdapterForType(java.lang.Object type)
public AdapterFactory getAdapterFactory()
public IChangeNotifier getDecoratedItemProvider()
getDecoratedItemProvider
in interface IItemProviderDecorator
public void setDecoratedItemProvider(IChangeNotifier decoratedItemProvider)
INotifyChangedListener
.setDecoratedItemProvider
in interface IItemProviderDecorator
public void addListener(INotifyChangedListener listener)
IChangeNotifier
addListener
in interface IChangeNotifier
public void removeListener(INotifyChangedListener listener)
IChangeNotifier
removeListener
in interface IChangeNotifier
public void fireNotifyChanged(Notification notification)
adapterFactory
.
The event type is a value from the static constants in Notifier
.fireNotifyChanged
in interface IChangeNotifier
public java.util.List<IItemPropertyDescriptor> getPropertyDescriptors(java.lang.Object object)
IItemPropertySource.getPropertyDescriptors
by delegating to (IItemPropertySource)
decoratedItemProvider
.public IItemPropertyDescriptor getPropertyDescriptor(java.lang.Object object, java.lang.Object propertyId)
IItemPropertySource.getPropertyDescriptors
by delegating to (IItemPropertySource)
decoratedItemProvider
.public java.lang.Object getEditableValue(java.lang.Object object)
IItemPropertySource.getEditableValue
by delegating to (IItemPropertySource)
decoratedItemProvider
.public java.util.Collection<?> getElements(java.lang.Object object)
IStructuredItemContentProvider.getElements
by delegating to (IStructuredItemContentProvider)
decoratedItemProvider
.public java.util.Collection<?> getChildren(java.lang.Object object)
ITreeItemContentProvider.getChildren
by delegating to (ITreeItemContentProvider)
decoratedItemProvider
.public boolean hasChildren(java.lang.Object object)
ITreeItemContentProvider.hasChildren
by delegating to (ITreeItemContentProvider)
decoratedItemProvider
.public java.lang.Object getParent(java.lang.Object object)
ITreeItemContentProvider.getParent
by delegating to (ITreeItemContentProvider)
decoratedItemProvider
.public java.lang.Object getImage(java.lang.Object object)
IItemLabelProvider.getImage
by delegating to (IItemLabelProvider)
decoratedItemProvider
.public java.lang.Object getColumnImage(java.lang.Object object, int columnIndex)
ITableItemLabelProvider.getColumnImage
by delegating to (ITableItemLabelProvider)
decoratedItemProvider
.public java.lang.String getText(java.lang.Object object)
IItemLabelProvider.getText
by delegating to (IItemLabelProvider)
decoratedItemProvider
.public java.lang.Object getFont(java.lang.Object object)
IItemFontProvider.getFont
by delegating to (IItemFontProvider)
decoratedItemProvider
.public java.lang.Object getFont(java.lang.Object object, int columnIndex)
ITableItemFontProvider.getFont
by delegating to (IItemFontProvider)
decoratedItemProvider
.public java.lang.Object getForeground(java.lang.Object object)
IItemColorProvider.getForeground
by delegating to (IItemColorProvider)
decoratedItemProvider
.public java.lang.Object getForeground(java.lang.Object object, int columnIndex)
ITableItemColorProvider.getForeground
by delegating to (ITableItemColorProvider)
decoratedItemProvider
.public java.lang.Object getBackground(java.lang.Object object)
IItemColorProvider.getBackground
by delegating to (IItemColorProvider)
decoratedItemProvider
.public java.lang.Object getBackground(java.lang.Object object, int columnIndex)
ITableItemColorProvider.getBackground
by delegating to (ITableItemColorProvider)
decoratedItemProvider
.public java.lang.String getColumnText(java.lang.Object object, int columnIndex)
ITableItemLabelProvider.getColumnText
by delegating to (ITableItemLabelProvider)
decoratedItemProvider
.public java.lang.String getUpdateableText(java.lang.Object object)
IUpdateableItemText.getUpdateableText
by delegating to (IUpdateableItemText)
decoratedItemProvider
.public java.util.Collection<?> getNewChildDescriptors(java.lang.Object object, EditingDomain editingDomain, java.lang.Object sibling)
IEditingDomainItemProvider.getNewChildDescriptors
by delegating to
(IEditingDomainItemProvider)
decoratedItemProvider
.public Command createCommand(java.lang.Object object, EditingDomain domain, java.lang.Class<? extends Command> commandClass, CommandParameter commandParameter)
IEditingDomainItemProvider.createCommand
by delegating to (IEditingDomainItemProvider)
decoratedItemProvider
.public void notifyChanged(Notification notification)
decoratedItemProvider
when it normally fires a notification to it's adapter factory.
This listener method is hooked up in setDecoratedItemProvider(org.eclipse.emf.edit.provider.IChangeNotifier)
.notifyChanged
in interface INotifyChangedListener
public void dispose()
IDisposable
dispose
in interface IDisposable
public java.lang.String toString()
toString
in class java.lang.Object