|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
com.ibm.as400.ui.framework.java.PanelTableModel
com.ibm.as400.ui.framework.java.PanelTreeTableModel
public class PanelTreeTableModel extends PanelTableModel implements TreeExpansionListener, TreeModelListener, TreeWillExpandListener
An implementation of TableModel
that uses a two-dimensional
array of objects to store the cell values. The row count will be the
length of the largest array that is supplied on a call to setColumn
.
TableModel
,
Serialized FormModifier and Type | Field and Description |
---|
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor and Description |
---|
PanelTreeTableModel(Vector tableColumns)
Constructs a PanelTreeTableModel . |
Modifier and Type | Method and Description |
---|---|
void |
addRow(Vector rowData)
Adds a row to the end of the model. |
void |
addRow(Vector rowData,
DefaultMutableTreeNode parent)
Adds a row to the end of the model. |
Vector[] |
getRows()
Returns a Vector array. |
Object |
getValueAt(int row,
int column)
Returns an attribute value for the cell at row
and column . |
void |
insertNodeRow(Vector rowData,
DefaultMutableTreeNode nodeParent,
int nodeIndex)
Inserts a node into the renderer tree and then calls insertRow to add the corresponding row to the table model. |
void |
insertRow(int rowIndex,
Vector rowData)
Inserts a row at rowIndex the model. |
boolean |
isCellEditable(int row,
int column)
Returns true if the cell at row and column
is editable. |
void |
removeRow(int rowToRemove)
Removes the row at rowToRemove from the model. |
void |
removeRows(int[] rowsToRemove)
Removes the rows identified in rowsToRemove from the model. |
void |
setCellEditable(boolean editable,
int row,
int column)
Indicates whether the cell at row and column
is editable. |
void |
setColumn(int column,
Object[] items)
Sets the list of values for the column at column . |
void |
setColumn(int column,
Object[] items,
com.ibm.as400.ui.framework.java.ComponentAttributeAssociation caa)
Sets the list of values for the column at column . |
void |
setComponentAttributeAssociation(com.ibm.as400.ui.framework.java.ComponentAttributeAssociation caa)
Sets the ComponentAttributeAssociation associated with this model. |
void |
setRendererTree(JTree tree)
Sets the JTree used to render the tree column cells. |
void |
setRows(Vector[] rowData)
Reassigns all values in the table. |
void |
setTable(PanelTreeTable table)
Sets the PanelTreeTable associated with this model. |
void |
setValueAt(Object value,
int row,
int column)
Sets an attribute value for the record in the cell at row and column . |
void |
treeCollapsed(TreeExpansionEvent event)
|
void |
treeExpanded(TreeExpansionEvent event)
|
void |
treeNodesChanged()
|
void |
treeNodesChanged(TreeModelEvent e)
|
void |
treeNodesInserted(TreeModelEvent e)
|
void |
treeNodesRemoved(TreeModelEvent e)
|
void |
treeStructureChanged(TreeModelEvent e)
|
void |
treeWillCollapse(TreeExpansionEvent event)
|
void |
treeWillExpand(TreeExpansionEvent event)
|
Methods inherited from class com.ibm.as400.ui.framework.java.PanelTableModel |
---|
getColumn, getColumn, getColumnClass, getColumnCount, getColumnIdentifier, getColumnName, getRowCount, toString |
Methods inherited from class javax.swing.table.AbstractTableModel |
---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PanelTreeTableModel(Vector tableColumns)
PanelTreeTableModel
.
tableColumns
- a list of ColumnDescriptors
for the table columnsMethod Detail |
---|
public void setRendererTree(JTree tree)
JTree
used to render the tree column cells.
tree
- the tree to be used as the rendererpublic void setTable(PanelTreeTable table)
PanelTreeTable
associated with this model.
table
- the PanelTreeTable associated with this modelpublic void setComponentAttributeAssociation(com.ibm.as400.ui.framework.java.ComponentAttributeAssociation caa)
ComponentAttributeAssociation
associated with this model.
caa
- the ComponentAttributeAssociation associated with this modelpublic void setColumn(int column, Object[] items, com.ibm.as400.ui.framework.java.ComponentAttributeAssociation caa)
column
.
column
- the column whose values are to be setthe
- list of values at the specified columnPanelTableModel.getColumn(int)
public void setColumn(int column, Object[] items)
column
.
setColumn
in class PanelTableModel
column
- the column whose values are to be setthe
- list of values at the specified columnPanelTableModel.getColumn(int)
public Object getValueAt(int row, int column)
row
and column
.
getValueAt
in interface TableModel
getValueAt
in class PanelTableModel
row
- the row whose value is to be looked upcolumn
- the column whose value is to be looked upsetValueAt(java.lang.Object, int, int)
public boolean isCellEditable(int row, int column)
row
and column
is editable. Otherwise, setValueAt() on the cell will not change
the value of that cell.
isCellEditable
in interface TableModel
isCellEditable
in class PanelTableModel
row
- the row whose editable status is to be looked upcolumn
- the column whose editable status is to be looked upsetCellEditable(boolean, int, int)
public void setCellEditable(boolean editable, int row, int column)
row
and column
is editable. Otherwise, setValueAt() on the cell will not change
the value of that cell.
setCellEditable
in class PanelTableModel
editable
- true if the cell should be editable, false otherwiserow
- the row whose value is to be looked upcolumn
- the column whose value is to be looked upisCellEditable(int, int)
public void setValueAt(Object value, int row, int column)
row
and column
. value
is
the new value.
setValueAt
in interface TableModel
setValueAt
in class PanelTableModel
value
- the new valuerow
- the row whose value is to be changedcolumn
- the column whose value is to be changedgetValueAt(int, int)
public void addRow(Vector rowData)
rowData
is specified. Notification
of the row being added will be generated.
addRow
in class PanelTableModel
rowData
- data of the row being added (may be null)removeRow(int)
public void addRow(Vector rowData, DefaultMutableTreeNode parent)
rowData
is specified. Notification
of the row being added will be generated.
rowData
- data of the row being added (may be null)removeRow(int)
public void insertNodeRow(Vector rowData, DefaultMutableTreeNode nodeParent, int nodeIndex)
nodeRow
- - the row of data to be added. The first element in this vector must be a DefaultMutableTreeNodenodeParent
- - the parent node of the node being addednodeIndex
- - the index of this node in the parent's child arrayinsertRow(int, java.util.Vector)
,
removeRow(int)
public void insertRow(int rowIndex, Vector rowData)
rowData
is specified. Notification
of the row being added will be generated.
rowIndex
- - the row index of the row to be insertedrowData
- - optional data of the row being addedremoveRow(int)
public void setRows(Vector[] rowData)
rowData
is specified. Notification
of the rows being added will be generated.
setRows
in class PanelTableModel
rowData
- array of data for the rows being added (may be null)getRows()
public Vector[] getRows()
getRows
in class PanelTableModel
setRows(java.util.Vector[])
public void removeRow(int rowToRemove)
rowToRemove
from the model. Notification
of the row being removed will be sent to all listeners.
removeRow
in class PanelTableModel
rowToRemove
- the row index of the row to be removedArrayIndexOutOfBoundsException
- if the row was invalidpublic void removeRows(int[] rowsToRemove)
rowsToRemove
from the model. Notification
of the rows being removed will be sent to all listeners.
removeRows
in class PanelTableModel
rowsToRemove
- a list of row indices for the rows to be removedpublic void treeExpanded(TreeExpansionEvent event)
treeExpanded
in interface TreeExpansionListener
public void treeCollapsed(TreeExpansionEvent event)
treeCollapsed
in interface TreeExpansionListener
public void treeWillExpand(TreeExpansionEvent event)
treeWillExpand
in interface TreeWillExpandListener
public void treeWillCollapse(TreeExpansionEvent event)
treeWillCollapse
in interface TreeWillExpandListener
public void treeNodesChanged(TreeModelEvent e)
treeNodesChanged
in interface TreeModelListener
public void treeNodesInserted(TreeModelEvent e)
treeNodesInserted
in interface TreeModelListener
public void treeNodesRemoved(TreeModelEvent e)
treeNodesRemoved
in interface TreeModelListener
public void treeStructureChanged(TreeModelEvent e)
treeStructureChanged
in interface TreeModelListener
public void treeNodesChanged()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |