public class IlvSubTreeListModel extends IlvFilterTreeListModel
IlvTreeListModel.
It is specified through a node of the given model called the "focus";
this node becomes the root of this model. If the focus node is not
contained in the original model, this model is empty.BEFORE_COLUMN_REMOVED_MASK, BEFORE_DATA_CHANGE_MASK, BEFORE_OBJECTS_REMOVED_MASK, DURING_OBJECTS_REMOVED_MASK| Constructor and Description |
|---|
IlvSubTreeListModel(IlvTreeListModel model,
Object focus)
Creates a subtree model.
|
IlvSubTreeListModel(IlvTreeListModel model,
Object focus,
int eventsMaskHint)
Creates a subtree 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.
|
Object |
getFocus()
Returns the focus.
|
TreePath |
getPath(Object object)
Returns the path from the root to the given object.
|
Object |
getRoot()
This method is implemented through a call to the underlying model.
|
int |
getSupportedEventsMask()
Returns a bit mask denoting the optional kinds of events that are 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. |
fireBeforeColumnRemoved, fireBeforeDataChange, fireBeforeObjectsRemoved, fireColumnAdded, fireColumnPropertyChanged, fireColumnRemoved, fireDataChanged, fireDuringObjectsRemoved, fireObjectsChanged, getChildren, getColumn, getColumnCount, getDoubleAt, getFilteredModel, getValueAt, noteColumnAdded, noteColumnPropertyChanged, noteColumnRemoved, setDoubleAt, setFilteredModel, setValueAtaddTreeListModelListener, convertToDouble, endBatch, fireModelEvent, postOrderIterator, preOrderIterator, removeTreeListModelListener, startBatchpublic IlvSubTreeListModel(IlvTreeListModel model, Object focus)
model - The original model.focus - The root of the subtree.public IlvSubTreeListModel(IlvTreeListModel model, Object focus, int eventsMaskHint)
model - The original model.focus - The root of the subtree.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()
getRoot in interface IlvTreeListModelgetRoot in class IlvFilterTreeListModelpublic TreePath getPath(Object object)
getPath in interface IlvTreeListModelgetPath in class IlvFilterTreeListModelobject - An object in the model.TreePath whose first component is
getRoot() and whose last component is the given
object.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 IlvTreeListModelgetSupportedEventsMask in class IlvFilterTreeListModelIlvTreeListModel.BEFORE_DATA_CHANGE_MASK,
IlvTreeListModel.BEFORE_OBJECTS_REMOVED_MASK,
IlvTreeListModel.BEFORE_COLUMN_REMOVED_MASKpublic 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 IlvFilterTreeListModelobject - 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 IlvFilterTreeListModelobject - 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)
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 IlvFilterTreeListModelparent - 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)
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 IlvFilterTreeListModelparent - 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)
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 IlvFilterTreeListModelparent - 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 IlvFilterTreeListModelcolumn - The column that will be removed (index before removing).columnInfo - The IlvDataColumnInfo of the column that
will be removed.public Object getFocus()
public void dispose()
Note: After calling this function, this model is no longer functional.
dispose in class IlvFilterTreeListModelpublic void disconnect()
Note: After calling this function, and after some changes occurred in the underlying model, this model is no longer functional.
disconnect in class IlvFilterTreeListModelpublic Object clone()
clone in class IlvFilterTreeListModel© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.