public class IlvTreeListToTreeModel extends Object implements TreeModel, Cloneable
TreeModel
, based on an
IlvTreeListModel
.
Note: This model does not support adding and removing objects. You should
use the underlying IlvTreeListModel
for this purpose (assuming
it is an instance of IlvDefaultTreeListModel
).
IlvTreeListToTreeTableModel
Constructor and Description |
---|
IlvTreeListToTreeModel(IlvTreeListModel model)
Creates a model backed by a given
IlvTreeListModel . |
Modifier and Type | Method and Description |
---|---|
void |
addTreeModelListener(TreeModelListener listener) |
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 |
getChild(Object parent,
int index) |
int |
getChildCount(Object parent) |
Class |
getColumnClass(int columnIndex)
Returns the type for column number
columnIndex . |
int |
getColumnCount()
Returns the number of available columns.
|
String |
getColumnName(int columnIndex)
Returns the name for column number
columnIndex . |
int |
getIndexOfChild(Object parent,
Object child) |
Object |
getRoot() |
IlvTreeListModel |
getUnderlyingModel()
Returns the underlying model.
|
Object |
getValueAt(Object node,
int columnIndex)
Returns the value to be displayed for node
node ,
at column number columnIndex . |
boolean |
isCellEditable(Object node,
int columnIndex)
Indicates whether the value for node
node ,
at column number columnIndex is editable. |
boolean |
isLeaf(Object node)
This method returns
true if and only if the node has no children. |
protected void |
noteColumnAdded(int column,
IlvDataColumnInfo columnInfo)
This method is called when a column has been added to the underlying
model.
|
protected void |
noteColumnPropertyChanged(TreeListModelEvent.Type type,
int column,
Object oldValue,
Object newValue)
This method is called when column properties have changed in the
underlying model.
|
protected void |
noteColumnRemoved(int column,
IlvDataColumnInfo columnInfo)
This method is called when a column has been removed from the underlying
model.
|
protected void |
noteDataChanged(Object object,
TreePath objectPath,
boolean recursive,
int column)
This method is called when the values for some objects and some columns
have changed in the underlying model.
|
protected void |
noteObjectsChanged(Object parent,
TreePath parentPath,
Object[] oldObjects,
Object[] newObjects,
int firstIndex)
This method is called when some objects (rows) have been added or removed
in the underlying model.
|
void |
removeTreeModelListener(TreeModelListener listener) |
void |
setValueAt(Object newValue,
Object node,
int columnIndex)
Sets the value for node
node ,
at column number columnIndex . |
void |
valueForPathChanged(TreePath path,
Object newValue)
This method does nothing.
|
public IlvTreeListToTreeModel(IlvTreeListModel model)
IlvTreeListModel
.model
- An IlvTreeListModel
.public void addTreeModelListener(TreeModelListener listener)
addTreeModelListener
in interface TreeModel
public void removeTreeModelListener(TreeModelListener listener)
removeTreeModelListener
in interface TreeModel
public int getChildCount(Object parent)
getChildCount
in interface TreeModel
public boolean isLeaf(Object node)
true
if and only if the node has no children.
It should be overridden in subclasses if there are nodes without children
that are not leaves.public void valueForPathChanged(TreePath path, Object newValue)
valueForPathChanged
in interface TreeModel
path
- Path to the node that the user has altered.newValue
- The new value from the TreeCellEditor
.public int getIndexOfChild(Object parent, Object child)
getIndexOfChild
in interface TreeModel
public int getColumnCount()
public String getColumnName(int columnIndex)
columnIndex
.public Class getColumnClass(int columnIndex)
columnIndex
.public Object getValueAt(Object node, int columnIndex)
node
,
at column number columnIndex
.public void setValueAt(Object newValue, Object node, int columnIndex)
node
,
at column number columnIndex
.public boolean isCellEditable(Object node, int columnIndex)
node
,
at column number columnIndex
is editable.
This default implementation always returns false
.protected void noteDataChanged(Object object, TreePath objectPath, boolean recursive, int column)
protected void noteObjectsChanged(Object parent, TreePath parentPath, Object[] oldObjects, Object[] newObjects, int firstIndex)
protected void noteColumnAdded(int column, IlvDataColumnInfo columnInfo)
protected void noteColumnRemoved(int column, IlvDataColumnInfo columnInfo)
protected void noteColumnPropertyChanged(TreeListModelEvent.Type type, int column, Object oldValue, Object newValue)
public IlvTreeListModel getUnderlyingModel()
IlvTreeListModel
passed to the constructor.public void dispose()
Note: After calling this function, this model is no longer functional.
public void disconnect()
Note: After calling this function, and after some changes occurred in the underlying model, this model is no longer functional.
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.