public class IlvFilteredTreeSetModel extends IlvFilterTreeSetModel
IlvTreeSetModel
, based on another
IlvTreeSetModel
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 |
---|
IlvFilteredTreeSetModel(IlvTreeSetModel model,
IlvFilter filter)
Creates a filtered model.
|
IlvFilteredTreeSetModel(IlvTreeSetModel 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.
|
Collection |
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_CHANGED event from the underlying model. |
void |
noteBeforeObjectsRemoved(Object parent,
TreePath parentPath,
Object[] objects)
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)
Reacts on a
DURING_OBJECTS_REMOVED event from the underlying model. |
void |
noteObjectsAdded(Object parent,
TreePath parentPath,
Object[] objects)
Reacts on an
OBJECTS_ADDED event from the underlying model. |
void |
noteObjectsRemoved(Object parent,
TreePath parentPath,
Object[] objects)
Reacts on an
OBJECTS_REMOVED event from the underlying model. |
void |
setFilter(IlvFilter filter)
Sets the filter.
|
fireBeforeColumnRemoved, fireBeforeDataChange, fireBeforeObjectsRemoved, fireColumnAdded, fireColumnPropertyChanged, fireColumnRemoved, fireDataChanged, fireDuringObjectsRemoved, fireObjectsAdded, fireObjectsRemoved, getColumn, getColumnCount, getDoubleAt, getFilteredModel, getPath, getValueAt, noteColumnAdded, noteColumnPropertyChanged, noteColumnRemoved, setDoubleAt, setFilteredModel, setValueAt
addTreeSetModelListener, convertToDouble, endBatch, fireModelEvent, postOrderIterator, preOrderIterator, removeTreeSetModelListener, startBatch
public IlvFilteredTreeSetModel(IlvTreeSetModel model, IlvFilter filter)
model
- The underlying model.filter
- The filter.public IlvFilteredTreeSetModel(IlvTreeSetModel 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()
IlvFilterTreeSetModel
getRoot
in interface IlvTreeSetModel
getRoot
in class IlvFilterTreeSetModel
public Collection getChildren(Object parent)
IlvFilterTreeSetModel
getChildren
in interface IlvTreeSetModel
getChildren
in class IlvFilterTreeSetModel
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 IlvTreeSetModel
getSupportedEventsMask
in class IlvFilterTreeSetModel
IlvTreeSetModel.BEFORE_DATA_CHANGE_MASK
,
IlvTreeSetModel.BEFORE_OBJECTS_REMOVED_MASK
,
IlvTreeSetModel.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 IlvFilterTreeSetModel
object
- The object whose attributes have changedobjectPath
- The path from the root to the objectrecursive
- 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_CHANGED
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireBeforeDataChange
.
noteBeforeDataChange
in class IlvFilterTreeSetModel
object
- The object whose attributes will changeobjectPath
- The path from the root to the objectrecursive
- 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 noteObjectsAdded(Object parent, TreePath parentPath, Object[] objects)
OBJECTS_ADDED
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireObjectsAdded
.
noteObjectsAdded
in class IlvFilterTreeSetModel
parent
- The parent object of the set of objects that were
added, 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 was added
(together with their entire subtrees).public void noteObjectsRemoved(Object parent, TreePath parentPath, Object[] objects)
OBJECTS_REMOVED
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireObjectsRemoved
.
noteObjectsRemoved
in class IlvFilterTreeSetModel
parent
- The parent object of the set of objects that were
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 was removed
(together with their entire subtrees).public void noteBeforeObjectsRemoved(Object parent, TreePath parentPath, Object[] objects)
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 IlvFilterTreeSetModel
parent
- The parent object of the set of objects that will be
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 will be removed
(together with their entire subtrees).public void noteDuringObjectsRemoved(Object parent, TreePath parentPath, Object[] objects)
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 IlvFilterTreeSetModel
parent
- The parent object of the set of objects that will be
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 will be removed
(together with their entire subtrees).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 IlvFilterTreeSetModel
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 IlvFilterTreeSetModel
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 IlvFilterTreeSetModel
public Object clone()
clone
in class IlvFilterTreeSetModel
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.