public class IlvTreeListToTreeTableModel extends IlvTreeListToTreeModel
TreeTableModel
, 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
).
Note: This class does not implement a particular
IlvTreeListModel
because there are many of them. You need to go
through IlvTreeListToTreeTableModelFactory
.
IlvTreeListToTreeTableModelFactory
Constructor and Description |
---|
IlvTreeListToTreeTableModel(IlvTreeListModel model)
Creates a model backed by a given
IlvTreeListModel . |
Modifier and Type | Method and Description |
---|---|
void |
addTreeTableModelListener(Object listener)
Adds a
TreeTableModel 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.
|
protected void |
fireTableCellsUpdated(int firstRow,
int lastRow,
int column)
Notifies all listeners that the value of the cells at
([firstRow, lastRow], column) has been updated. |
protected void |
fireTableRowsDeleted(int firstRow,
int lastRow)
Notifies all listeners that the objects corresponding to the rows in the
range
[firstRow, lastRow] , inclusive, have been deleted. |
protected void |
fireTableRowsInserted(int firstRow,
int lastRow)
Notifies all listeners that objects corresponding to rows in the range
[firstRow, lastRow] , inclusive, have been inserted. |
protected void |
fireTableRowsUpdated(int firstRow,
int lastRow)
Notifies all listeners that the values of the rows in the range
[firstRow, lastRow] , inclusive, have been updated. |
protected void |
fireTableStructureChanged()
Notifies all listeners that the tree-table structure has changed.
|
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 . |
Class |
getTargetModelClass()
Returns the class of the
TreeTableModel that is used to
display this 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. |
protected void |
noteColumnAdded(int column,
IlvDataColumnInfo columnInfo)
This method is called when a column has been added to 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 |
removeTreeTableModelListener(Object listener)
Removes a
TreeTableModel listener. |
void |
setTargetModelClass(Class targetModelClass)
Sets the class of the
TreeTableModel that is used to display
this model. |
void |
setValueAt(Object newValue,
Object node,
int columnIndex)
Sets the value for node
node , at column number
columnIndex . |
addTreeModelListener, getChild, getChildCount, getIndexOfChild, getRoot, getUnderlyingModel, isLeaf, noteColumnPropertyChanged, removeTreeModelListener, valueForPathChanged
public IlvTreeListToTreeTableModel(IlvTreeListModel model)
IlvTreeListModel
.model
- An IlvTreeListModel
.public int getColumnCount()
getColumnCount
in class IlvTreeListToTreeModel
public String getColumnName(int columnIndex)
columnIndex
.getColumnName
in class IlvTreeListToTreeModel
public Class getColumnClass(int columnIndex)
columnIndex
.getColumnClass
in class IlvTreeListToTreeModel
public Object getValueAt(Object node, int columnIndex)
node
, at column
number columnIndex
.getValueAt
in class IlvTreeListToTreeModel
public void setValueAt(Object newValue, Object node, int columnIndex)
node
, at column number
columnIndex
.setValueAt
in class IlvTreeListToTreeModel
public boolean isCellEditable(Object node, int columnIndex)
node
, at column number
columnIndex
is editable. This default implementation always
returns false
.isCellEditable
in class IlvTreeListToTreeModel
public void addTreeTableModelListener(Object listener)
TreeTableModel
listener. This method does nothing if
the target model does not support TreeTableModel
listeners.public void removeTreeTableModelListener(Object listener)
TreeTableModel
listener. This method does nothing if
the target model does not support TreeTableModel
listeners.protected void fireTableStructureChanged()
protected void fireTableRowsInserted(int firstRow, int lastRow)
[firstRow, lastRow]
, inclusive, have been inserted.firstRow
- The first row.lastRow
- The last row.protected void fireTableRowsUpdated(int firstRow, int lastRow)
[firstRow, lastRow]
, inclusive, have been updated.firstRow
- The first row.lastRow
- The last row.protected void fireTableRowsDeleted(int firstRow, int lastRow)
[firstRow, lastRow]
, inclusive, have been deleted.firstRow
- The first row.lastRow
- The last row.protected void fireTableCellsUpdated(int firstRow, int lastRow, int column)
([firstRow, lastRow], column)
has been updated.firstRow
- The first row.lastRow
- The last row.column
- Column of cells which have been updated.protected void noteDataChanged(Object object, TreePath objectPath, boolean recursive, int column)
noteDataChanged
in class IlvTreeListToTreeModel
protected void noteObjectsChanged(Object parent, TreePath parentPath, Object[] oldObjects, Object[] newObjects, int firstIndex)
noteObjectsChanged
in class IlvTreeListToTreeModel
protected void noteColumnAdded(int column, IlvDataColumnInfo columnInfo)
noteColumnAdded
in class IlvTreeListToTreeModel
protected void noteColumnRemoved(int column, IlvDataColumnInfo columnInfo)
noteColumnRemoved
in class IlvTreeListToTreeModel
public Class getTargetModelClass()
TreeTableModel
that is used to
display this model.TreeTableModel
interface class or null
.public void setTargetModelClass(Class targetModelClass)
TreeTableModel
that is used to display
this model. A column gets added to this model, with name "treenode" and
with the given class as "type". The JTreeTable
handles this
column specially.targetModelClass
- A TreeTableModel
interface class.public void dispose()
Note: After calling this function, this model is no longer functional.
dispose
in class IlvTreeListToTreeModel
public 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 IlvTreeListToTreeModel
public Object clone()
clone
in class IlvTreeListToTreeModel
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.