public class DelegatingWrapperItemProvider extends WrapperItemProvider implements IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemFontProvider, IItemColorProvider, ITableItemLabelProvider, ITableItemFontProvider, ITableItemColorProvider, IItemPropertySource, IEditingDomainItemProvider, IChangeNotifier, INotifyChangedListener
owner
as the parent, and it has to decorate the children, property descriptors, and commands that it returns.| Modifier and Type | Class and Description |
|---|---|
protected class |
DelegatingWrapperItemProvider.AffectedObjectsWrappingCommand
An
AffectedObjectsWrappingCommand wraps another command to substitute this wrapper for its value
and child wrappers for their corresponding child values, whenever they appear in the affected objects. |
protected class |
DelegatingWrapperItemProvider.AffectedObjectsWrappingCommandActionDelegate
An
AffectedObjectsWrappingCommandActionDelegate wraps another command that also implements
CommandActionDelegate, to substitute this wrapper for its value and child wrappers for their
corresponding child values, whenever they appear in the affected objects. |
protected class |
DelegatingWrapperItemProvider.DelegatingWrapperItemPropertyDescriptor
A
DelegatingWrapperItemPropertyDescriptor decorates an ItemPropertyDescriptor and
manages a command owner override. |
WrapperItemProvider.ReplacementAffectedObjectCommand, WrapperItemProvider.SimpleCopyCommand, WrapperItemProvider.WrapperItemPropertyDescriptor, WrapperItemProvider.WrappingCopyCommand| Modifier and Type | Field and Description |
|---|---|
protected IChangeNotifier |
changeNotifier
Records any listeners for this wrapper and fires notifications to them.
|
protected java.util.Map<java.lang.Object,IWrapperItemProvider> |
childrenMap
The wrapped children are cached here, keyed by the children returned by the delegate item provider.
|
protected java.util.Collection<?> |
delegateChildren
The collection of children last returned by the delegate item provider is cached here.
|
protected java.lang.Object |
delegateItemProvider
The wrapped value's item provider, to which most methods are delegated.
|
protected java.util.List<IItemPropertyDescriptor> |
propertyDescriptors
The decorated property descriptors are cached here.
|
adapterFactory, COPY_COMMAND_DESCRIPTION, COPY_COMMAND_LABEL, feature, index, owner, valueBOLD_FONT, BOLD_ITALIC_FONT, ITALIC_FONT, NORMAL_FONTGRAYED_OUT_COLOR| Constructor and Description |
|---|
DelegatingWrapperItemProvider(java.lang.Object value,
java.lang.Object owner,
AdapterFactory adapterFactory)
Deprecated.
As of EMF 2.0.1, replaced by
this form. This constructor will be removed as public API, but remain available as a protected method. |
DelegatingWrapperItemProvider(java.lang.Object value,
java.lang.Object owner,
EStructuralFeature feature,
int index,
AdapterFactory adapterFactory)
Creates an instance for the given value.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(INotifyChangedListener listener)
Adds a listener to receive this wrapper's repeated notifications.
|
Command |
createCommand(java.lang.Object object,
EditingDomain domain,
java.lang.Class<? extends Command> commandClass,
CommandParameter commandParameter)
Uses the delegate item provider to create a command for the delegate value, and then calls
wrapCommand to return an appropriate wrapper-substituting command wrapper for it. |
protected IWrapperItemProvider |
createWrapper(java.lang.Object value,
java.lang.Object owner,
AdapterFactory adapterFactory)
Creates a new instance of this wrapper for the given value, owner, and adapter factory.
|
void |
dispose()
Deactivates notification repeating and disposes any wrappers it is maintaining for its children.
|
void |
fireNotifyChanged(Notification notification)
Fires a notification to the adapter factory and any registered listeners.
|
java.lang.Object |
getBackground(java.lang.Object object)
Uses the delegate item provider to return the delegate value's background color.
|
java.lang.Object |
getBackground(java.lang.Object object,
int columnIndex)
Uses the delegate item provider to return the delegate value's background color.
|
java.util.Collection<?> |
getChildren(java.lang.Object object)
Uses the delegate item provider to return the delegate value's children, with appropriate wrappers to ensure that
this wrapper is considered their parent.
|
java.lang.Object |
getColumnImage(java.lang.Object object,
int columnIndex)
Uses the delegate item provider to return the delegate value's column image.
|
java.lang.String |
getColumnText(java.lang.Object object,
int columnIndex)
Uses the delegate item provider to return the delegate value's column text.
|
protected java.lang.Object |
getDelegateValue()
Returns the value from which to obtain and which to pass to a delegate item provider.
|
java.lang.Object |
getEditableValue(java.lang.Object object)
Uses the delegate item provider to return an editable value.
|
java.util.Collection<?> |
getElements(java.lang.Object object)
Uses the delegate item provider to return the delegate value's elements.
|
java.lang.Object |
getFont(java.lang.Object object)
Uses the delegate item provider to return the delegate value's font.
|
java.lang.Object |
getFont(java.lang.Object object,
int columnIndex)
Uses the delegate item provider to return the delegate value's font.
|
java.lang.Object |
getForeground(java.lang.Object object)
Uses the delegate item provider to return the delegate value's foreground color.
|
java.lang.Object |
getForeground(java.lang.Object object,
int columnIndex)
Uses the delegate item provider to return the delegate value's foreground color.
|
java.lang.Object |
getImage(java.lang.Object object)
Uses the delegate item provider to return the delegate value's image.
|
java.util.Collection<?> |
getNewChildDescriptors(java.lang.Object object,
EditingDomain editingDomain,
java.lang.Object sibling)
Uses the delegate item provider to return the delegate value's new child descriptors.
|
java.util.List<IItemPropertyDescriptor> |
getPropertyDescriptors(java.lang.Object object)
Wraps the property descriptors returned by the delegate item provider, caching and returning them.
|
protected java.lang.Object |
getRefreshElement(Notification notification)
Returns the operative object of this notification, from which the viewer would be refreshed.
|
java.lang.String |
getText(java.lang.Object object)
Uses the delegate item provider to return the delegate value's text.
|
boolean |
hasChildren(java.lang.Object object)
Uses the delegate item provider to test whether the delegate value has children.
|
void |
notifyChanged(Notification notification)
Called by
delegateItemProvider when it normally fires a notification to it's adapter factory; if the
notification originated from the delegate value, this repeats the notification, using wrapNotification to substitute this wrapper as the operative object. |
void |
removeListener(INotifyChangedListener listener)
Removes a notification listener.
|
protected void |
updateChildren()
Uses the delegate item provider to get the delegate value's children, assigning the collection to
delegateChildren, and to update the childrenMap. |
protected Command |
wrapCommand(Command command,
java.lang.Class<? extends Command> commandClass)
Wraps the given command in an appropriate command that will substitute the delegating wrapper for its value and
child wrappers for their corresponding values, whenever they appear in the affected objects.
|
protected Notification |
wrapNotification(Notification notification)
Wraps the given notification, substituting this wrapper as the operative object, by calling
ViewerNotification.wrapNotification. |
baseCreateCommand, createCopyCommand, createDragAndDropCommand, createSetCommand, getFeature, getIndex, getOwner, getParent, getPropertyCategory, getPropertyDescription, getPropertyDescriptor, getPropertyFilterFlags, getPropertyImage, getPropertyImage, getPropertyName, getRootAdapterFactory, getUpdateableText, getValue, isPropertyMultiLine, isPropertySettable, isPropertySortChoices, setIndexclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetParentgetPropertyDescriptorgetParentprotected java.lang.Object delegateItemProvider
protected java.util.Map<java.lang.Object,IWrapperItemProvider> childrenMap
protected java.util.Collection<?> delegateChildren
protected java.util.List<IItemPropertyDescriptor> propertyDescriptors
protected IChangeNotifier changeNotifier
public DelegatingWrapperItemProvider(java.lang.Object value,
java.lang.Object owner,
EStructuralFeature feature,
int index,
AdapterFactory adapterFactory)
IChangeNotifier,
a listener is added to it,
so it's important to call dispose().java.lang.IllegalArgumentException - If the specified value is null.@Deprecated
public DelegatingWrapperItemProvider(java.lang.Object value,
java.lang.Object owner,
AdapterFactory adapterFactory)
this form. This constructor will be removed as public API, but remain available as a protected method.java.lang.IllegalArgumentException - If the specified value is null.public void dispose()
dispose in interface IDisposabledispose in class WrapperItemProviderprotected java.lang.Object getDelegateValue()
public java.util.Collection<?> getElements(java.lang.Object object)
getElements in interface IStructuredItemContentProvidergetElements in class WrapperItemProviderpublic java.util.Collection<?> getChildren(java.lang.Object object)
childrenMap, after updating it by calling updateChildren.getChildren in interface IEditingDomainItemProvidergetChildren in interface ITreeItemContentProvidergetChildren in class WrapperItemProviderprotected void updateChildren()
delegateChildren, and to update the childrenMap. New children are wrapped by calling createWrapper and added to the map; Wrappers for children that have been removed are disposed.protected IWrapperItemProvider createWrapper(java.lang.Object value, java.lang.Object owner, AdapterFactory adapterFactory)
public boolean hasChildren(java.lang.Object object)
hasChildren in interface ITreeItemContentProviderhasChildren in class WrapperItemProviderpublic java.lang.String getText(java.lang.Object object)
getText in interface IItemLabelProvidergetText in class WrapperItemProviderpublic java.lang.Object getImage(java.lang.Object object)
getImage in interface IItemLabelProvidergetImage in class WrapperItemProviderpublic java.lang.Object getFont(java.lang.Object object)
getFont in interface IItemFontProvidergetFont in class WrapperItemProviderpublic java.lang.Object getForeground(java.lang.Object object)
getForeground in interface IItemColorProvidergetForeground in class WrapperItemProviderpublic java.lang.Object getBackground(java.lang.Object object)
getBackground in interface IItemColorProvidergetBackground in class WrapperItemProviderpublic java.lang.String getColumnText(java.lang.Object object,
int columnIndex)
getColumnText in interface ITableItemLabelProviderpublic java.lang.Object getColumnImage(java.lang.Object object,
int columnIndex)
getColumnImage in interface ITableItemLabelProviderpublic java.lang.Object getFont(java.lang.Object object,
int columnIndex)
getFont in interface ITableItemFontProviderpublic java.lang.Object getForeground(java.lang.Object object,
int columnIndex)
getForeground in interface ITableItemColorProviderpublic java.lang.Object getBackground(java.lang.Object object,
int columnIndex)
getBackground in interface ITableItemColorProviderpublic java.util.List<IItemPropertyDescriptor> getPropertyDescriptors(java.lang.Object object)
getPropertyDescriptors in interface IItemPropertySourcegetPropertyDescriptors in class WrapperItemProviderpublic java.lang.Object getEditableValue(java.lang.Object object)
getEditableValue in interface IItemPropertySourcegetEditableValue in class WrapperItemProviderpublic java.util.Collection<?> getNewChildDescriptors(java.lang.Object object,
EditingDomain editingDomain,
java.lang.Object sibling)
getNewChildDescriptors in interface IEditingDomainItemProvidergetNewChildDescriptors in class WrapperItemProviderpublic Command createCommand(java.lang.Object object, EditingDomain domain, java.lang.Class<? extends Command> commandClass, CommandParameter commandParameter)
wrapCommand to return an appropriate wrapper-substituting command wrapper for it. Drag and drop commands are
created directly by calling createDragAndDropCommand.createCommand in interface IEditingDomainItemProvidercreateCommand in class WrapperItemProviderprotected Command wrapCommand(Command command, java.lang.Class<? extends Command> commandClass)
DelegatingWrapperItemProvider.AffectedObjectsWrappingCommand or an DelegatingWrapperItemProvider.AffectedObjectsWrappingCommandActionDelegate,
depending on whether the given command implements CommandActionDelegate.public void addListener(INotifyChangedListener listener)
addListener in interface IChangeNotifierpublic void removeListener(INotifyChangedListener listener)
removeListener in interface IChangeNotifierpublic void fireNotifyChanged(Notification notification)
fireNotifyChanged in interface IChangeNotifierpublic void notifyChanged(Notification notification)
delegateItemProvider when it normally fires a notification to it's adapter factory; if the
notification originated from the delegate value, this repeats the notification, using wrapNotification to substitute this wrapper as the operative object.notifyChanged in interface INotifyChangedListenerprotected java.lang.Object getRefreshElement(Notification notification)
IViewerNotification, the element is returned. Otherwise, the
notifier is returned.protected Notification wrapNotification(Notification notification)
ViewerNotification.wrapNotification.