public class IlvPropertyBasedTreeListModel extends IlvDefaultTreeListModel
IlvTreeListModel
interface which stores the objects and the column info objects locally
in this instance. The values are assumed to be properties of the objects.BEFORE_COLUMN_REMOVED_MASK, BEFORE_DATA_CHANGE_MASK, BEFORE_OBJECTS_REMOVED_MASK, DURING_OBJECTS_REMOVED_MASK
Constructor and Description |
---|
IlvPropertyBasedTreeListModel(IlvPropertyConnector propaccess)
Creates an empty model, with zero columns.
|
IlvPropertyBasedTreeListModel(IlvPropertyConnector propaccess,
IlvDataColumnInfo[] columns)
Creates an empty model, with the given columns.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(Object object,
Object[] data,
Object parent)
Adds an object to the list of children of a parent object in the model.
|
protected void |
addColumnStorage(int columnIndex,
int insertedColumnCount)
Adds storage for new columns.
|
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.
|
double |
getDoubleAt(Object object,
int columnIndex)
Returns the value for the attribute number
columnIndex
in the given object. |
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.
|
Object |
getValueAt(Object object,
int columnIndex)
Returns the value for the attribute number
columnIndex
in the given object. |
void |
insertChild(Object object,
Object[] data,
Object parent,
int index)
Adds an object to the list of children of a parent object in the model
at a given index.
|
protected void |
removeColumnStorage(int columnIndex,
int removedColumnCount)
Removes storage for columns that have been dropped.
|
protected boolean |
setDoubleAtInternal(double value,
Object object,
int columnIndex,
boolean forReal)
Does the equivalent of a
setDoubleAt() . |
protected boolean |
setValueAtInternal(Object value,
Object object,
int columnIndex,
boolean forReal)
Does the equivalent of a
setValueAt() . |
addChild, clear, getChildAt, getChildren, getIndexOf, getParent, getPath, getRoot, insertChild, insertChildren, removeAllChildren, removeChild, removeChildren, setChildren, setDoubleAt, setRoot, setValueAt
addColumn, addColumn, fireModelEvent, getColumn, getColumnCount, getColumns, insertColumn, insertColumn, isColumnComputed, removeColumn, setColumn, setColumnCount, setColumns
addTreeListModelListener, convertToDouble, endBatch, postOrderIterator, preOrderIterator, removeTreeListModelListener, startBatch
public IlvPropertyBasedTreeListModel(IlvPropertyConnector propaccess)
public IlvPropertyBasedTreeListModel(IlvPropertyConnector propaccess, IlvDataColumnInfo[] columns)
public Object getValueAt(Object object, int columnIndex)
columnIndex
in the given object.getValueAt
in interface IlvObjectModelWithColumns
getValueAt
in interface IlvTreeListModel
getValueAt
in class IlvDefaultTreeListModel
object
- The object (row) in which the value is to be looked up.columnIndex
- The column denoting the attribute whose value is to be
looked up.public double getDoubleAt(Object object, int columnIndex)
columnIndex
in the given object.
This method should only be used for columns whose type is
Double. For other types of columns, this method will do a conversion
from the object returned by getValueAt
, which may be
inefficient or inaccurate or raise exceptions.
getDoubleAt
in interface IlvObjectModelWithColumns
getDoubleAt
in interface IlvTreeListModel
getDoubleAt
in class IlvDefaultTreeListModel
object
- The object (row) in which the value is to be looked up.columnIndex
- The column denoting the attribute whose value is to be
looked up.protected boolean setValueAtInternal(Object value, Object object, int columnIndex, boolean forReal)
setValueAt()
. Instead of notifying it simply returns
a boolean
indicating whether notification should be done.
If forReal is false
, the value is not actually set, but the
method still returns the same Boolean, indicating whether the given value is
different from the previous one.
If you override this method, you also have to override the methods
addChild(Object, Object[], Object)
and
insertChild(Object, Object[], Object, int)
.
setValueAtInternal
in class IlvDefaultTreeListModel
protected boolean setDoubleAtInternal(double value, Object object, int columnIndex, boolean forReal)
setDoubleAt()
. Instead of notifying it simply returns
a boolean
indicating whether notification should be done.
If forReal is false
, the value is not actually set, but the
method still returns the same Boolean, indicating whether the given value is
different from the previous one.
setDoubleAtInternal
in class IlvDefaultTreeListModel
public int getSupportedEventsMask()
This implementation returns
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 IlvDefaultTreeListModel
IlvTreeListModel.BEFORE_DATA_CHANGE_MASK
,
IlvTreeListModel.BEFORE_OBJECTS_REMOVED_MASK
,
IlvTreeListModel.BEFORE_COLUMN_REMOVED_MASK
public void addChild(Object object, Object[] data, Object parent)
addChild
in class IlvDefaultTreeListModel
object
- object the child object to adddata
- The initial data of this object. It must be an array of
getColumnCount()
elements.parent
- specify where to insert the objectpublic void insertChild(Object object, Object[] data, Object parent, int index)
insertChild
in class IlvDefaultTreeListModel
object
- the child object to adddata
- The initial data of this object. It must be an array of
getColumnCount()
elements.parent
- specify where to insert the objectindex
- the new object's desired index, must be >= 0 and
<= parent.getChildren().size()
protected void addColumnStorage(int columnIndex, int insertedColumnCount)
addColumnStorage
in class IlvDefaultTreeListModel
protected void removeColumnStorage(int columnIndex, int removedColumnCount)
removeColumnStorage
in class IlvDefaultTreeListModel
public void dispose()
Note: After calling this function, this model is no longer functional.
dispose
in class IlvDefaultTreeListModel
public void disconnect()
Note: After calling this function, and after some changes occurred in the underlying columns or in the contained objects, this model is no longer functional.
disconnect
in class IlvBasicTreeListModel
public Object clone()
clone
in class IlvDefaultTreeListModel
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.