public interface ICommonViewerMapper
CommonViewer
; instead other model
objects are stored. In addition, it may be the case where the objects that
have changed are not present in the Tree associated with the CommonViewer
because they have not been opened or expanded.
You can use an instance of this class to define a mapping between the current
Tree Items associated with the CommonViewer and the (typically resource) objects
where a change is notified. The change is notified to the
CommonViewer.handleLabelProviderChanged(org.eclipse.jface.viewers.LabelProviderChangedEvent)
.
The mapper object (implementing this interface) is associated with the CommonViewer using
the CommonViewer.setMapper(ICommonViewerMapper)
method.
When this mapper wishes to update the CommonViewer, the
CommonViewer.doUpdateItem(org.eclipse.swt.widgets.Widget)
method is used.Modifier and Type | Method and Description |
---|---|
void |
addToMap(Object element,
Item item)
Adds a new item to the map.
|
void |
clearMap()
Clears the map.
|
boolean |
handlesObject(Object object)
Tests if this mapper handles the specified object.
|
boolean |
isEmpty()
Tests if the map is empty
|
void |
objectChanged(Object object)
Indicates the specified object has changed.
|
void |
removeFromMap(Object element,
Item item)
Removes an element from the map.
|
void addToMap(Object element, Item item)
CommonViewer
when the element is
added to the Tree.element
- Element to mapitem
- The item used for the elementvoid removeFromMap(Object element, Item item)
CommonViewer
when the element is
removed from the Tree.element
- The data elementitem
- The table or tree itemvoid clearMap()
boolean isEmpty()
boolean handlesObject(Object object)
object
- the object that the mapper can handlevoid objectChanged(Object object)
CommonViewer
is notified of the change using the CommonViewer.doUpdateItem(org.eclipse.swt.widgets.Widget)
method so that it can update its state.object
- the object that changed
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.