public class IlvFilteredTreeListModel extends IlvFilterTreeListModel
IlvTreeListModel
, based on another
IlvTreeListModel
and an IlvFilter
that is used
to select some of the objects. When a tree node is omitted, the entire
tree branch below it is omitted as well.BEFORE_COLUMN_REMOVED_MASK, BEFORE_DATA_CHANGE_MASK, BEFORE_OBJECTS_REMOVED_MASK, DURING_OBJECTS_REMOVED_MASK
Constructor and Description |
---|
IlvFilteredTreeListModel(IlvTreeListModel model,
IlvFilter filter)
Creates a filtered model.
|
IlvFilteredTreeListModel(IlvTreeListModel model,
IlvFilter filter,
int eventsMaskHint)
Creates a filtered model.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Returns a copy of this object.
|
void |
disconnect()
Drops references to objects to help garbage collection.
|
void |
dispose()
Cleans up this model and drops references to objects to
help garbage collection.
|
List |
getChildren(Object parent)
This method is implemented through a call to the underlying model.
|
IlvFilter |
getFilter()
Returns the filter.
|
Object |
getRoot()
This method is implemented through a call to the underlying model.
|
int |
getSupportedEventsMask()
Returns a bit mask denoting the optional kind of events that is guaranteed
to be sent by this model to the registered listeners.
|
void |
noteBeforeColumnRemoved(int column,
IlvDataColumnInfo columnInfo)
Reacts on a
BEFORE_COLUMN_REMOVED event from the underlying model. |
void |
noteBeforeDataChange(Object object,
TreePath objectPath,
boolean recursive,
int column)
Reacts on a
BEFORE_DATA_CHANGE event from the underlying model. |
void |
noteBeforeObjectsRemoved(Object parent,
TreePath parentPath,
Object[] objects,
int firstIndex)
Reacts on a
BEFORE_OBJECTS_REMOVED event from the underlying model. |
void |
noteDataChanged(Object object,
TreePath objectPath,
boolean recursive,
int column)
Reacts on a
DATA_CHANGED event from the underlying model. |
void |
noteDuringObjectsRemoved(Object parent,
TreePath parentPath,
Object[] objects,
int firstIndex)
Reacts on a
DURING_OBJECTS_REMOVED event from the underlying model. |
void |
noteObjectsChanged(Object parent,
TreePath parentPath,
Object[] oldObjects,
Object[] newObjects,
int firstIndex)
Reacts on a
OBJECTS_CHANGED event from the underlying model. |
void |
setFilter(IlvFilter filter)
Sets the filter.
|
fireBeforeColumnRemoved, fireBeforeDataChange, fireBeforeObjectsRemoved, fireColumnAdded, fireColumnPropertyChanged, fireColumnRemoved, fireDataChanged, fireDuringObjectsRemoved, fireObjectsChanged, getColumn, getColumnCount, getDoubleAt, getFilteredModel, getPath, getValueAt, noteColumnAdded, noteColumnPropertyChanged, noteColumnRemoved, setDoubleAt, setFilteredModel, setValueAt
addTreeListModelListener, convertToDouble, endBatch, fireModelEvent, postOrderIterator, preOrderIterator, removeTreeListModelListener, startBatch
public IlvFilteredTreeListModel(IlvTreeListModel model, IlvFilter filter)
model
- The underlying model.filter
- The filter.public IlvFilteredTreeListModel(IlvTreeListModel model, IlvFilter filter, int eventsMaskHint)
model
- The underlying model.filter
- The filter.eventsMaskHint
- Desired events mask. This is just a hint; there is
no guarantee that the event types designated by the
mask are supported by this model.public Object getRoot()
IlvFilterTreeListModel
getRoot
in interface IlvTreeListModel
getRoot
in class IlvFilterTreeListModel
public List getChildren(Object parent)
IlvFilterTreeListModel
getChildren
in interface IlvTreeListModel
getChildren
in class IlvFilterTreeListModel
public int getSupportedEventsMask()
This implementation returns the event mask of the underlying model,
intersected with the eventsMaskHint constructor argument and
with
BEFORE_DATA_CHANGE_MASK | BEFORE_OBJECTS_REMOVED_MASK | DURING_OBJECTS_REMOVED_MASK | BEFORE_COLUMN_REMOVED_MASK
.
It may need to be overridden in subclasses.
getSupportedEventsMask
in interface IlvTreeListModel
getSupportedEventsMask
in class IlvFilterTreeListModel
IlvTreeListModel.BEFORE_DATA_CHANGE_MASK
,
IlvTreeListModel.BEFORE_OBJECTS_REMOVED_MASK
,
IlvTreeListModel.BEFORE_COLUMN_REMOVED_MASK
public void noteDataChanged(Object object, TreePath objectPath, boolean recursive, int column)
DATA_CHANGED
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireDataChanged
.
noteDataChanged
in class IlvFilterTreeListModel
object
- The object whose attributes have changed.objectPath
- The path from the root to the object.recursive
- true
if the attributes of the entire subtree have
changed, false
for a change affecting only the single
object.column
- Column that changed, or -1 for all columns.public void noteBeforeDataChange(Object object, TreePath objectPath, boolean recursive, int column)
BEFORE_DATA_CHANGE
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireBeforeDataChange
.
noteBeforeDataChange
in class IlvFilterTreeListModel
object
- The object whose attributes will change.objectPath
- The path from the root to the object.recursive
- true
if the attributes of the entire subtree will
change, false
for a change affecting only the single
object.column
- Column that will change, or -1 for all columns.public void noteObjectsChanged(Object parent, TreePath parentPath, Object[] oldObjects, Object[] newObjects, int firstIndex)
IlvFilterTreeListModel
OBJECTS_CHANGED
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireObjectsChanged
.
noteObjectsChanged
in class IlvFilterTreeListModel
parent
- The parent object of the set of objects that were changed,
added or removed, or null
for a root change.parentPath
- The path from the root to the parent object, or
null
for a root change.oldObjects
- The set of objects that was in place before the change
(together with their entire subtrees), in the same order
as in source.getChildren(parent)
.newObjects
- The set of objects that is in place after the change
(together with their entire subtrees), in the same order
as in source.getChildren(parent)
.firstIndex
- The index of the first object (index after adding or
before removing the objects) in
source.getChildren(parent)
. The second
object is/was at firstIndex+1
, and so on.public void noteBeforeObjectsRemoved(Object parent, TreePath parentPath, Object[] objects, int firstIndex)
IlvFilterTreeListModel
BEFORE_OBJECTS_REMOVED
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireBeforeObjectsRemoved
.
noteBeforeObjectsRemoved
in class IlvFilterTreeListModel
parent
- The parent object of the set of objects that will be changed
or removed, or null
for a root change.parentPath
- The path from the root to the parent object, or
null
for a root change.objects
- The set of objects that are in place before the change
(together with their entire subtrees), in the same order
as in source.getChildren(parent)
.firstIndex
- The index of the first object (index
before removing the objects) in
source.getChildren(parent)
. The second
object is at firstIndex+1
, and so on.public void noteDuringObjectsRemoved(Object parent, TreePath parentPath, Object[] objects, int firstIndex)
IlvFilterTreeListModel
DURING_OBJECTS_REMOVED
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireDuringObjectsRemoved
.
noteDuringObjectsRemoved
in class IlvFilterTreeListModel
parent
- The parent object of the set of objects that will be changed
or removed, or null
for a root change.parentPath
- The path from the root to the parent object, or
null
for a root change.objects
- The set of objects that are in place before the change
(together with their entire subtrees), in the same order
as in source.getChildren(parent)
.firstIndex
- The index of the first object (index
before removing the objects) in
source.getChildren(parent)
. The second
object is at firstIndex+1
, and so on.public void noteBeforeColumnRemoved(int column, IlvDataColumnInfo columnInfo)
BEFORE_COLUMN_REMOVED
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireBeforeColumnRemoved
.
noteBeforeColumnRemoved
in class IlvFilterTreeListModel
column
- The column that will be removed (index before removing).columnInfo
- The IlvDataColumnInfo
of the column that
will be removed.public IlvFilter getFilter()
public void setFilter(IlvFilter filter)
filter
- A filter that can be applied to the model objects.public void dispose()
Note: After calling this function, this model is no longer functional.
dispose
in class IlvFilterTreeListModel
public void disconnect()
Note: After calling this function, and after some changes occurred in the underlying model or filter, this model is no longer functional.
disconnect
in class IlvFilterTreeListModel
public Object clone()
clone
in class IlvFilterTreeListModel
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.