|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.table.AbstractTableModel javax.swing.table.DefaultTableModel com.jidesoft.grid.DefaultSpanTableModel
public class DefaultSpanTableModel
DefaultSpanTableModel
adds SpanModel
support to DefaultTableModel
. You can use
it as replacement for DefaultTableModel
. Instead of return a cell span programmatically like in AbstractSpanTableModel
, you can use addCellSpan(CellSpan)
or removeCellSpan(int, int)
to control
the cell span.
Field Summary |
---|
Fields inherited from class javax.swing.table.DefaultTableModel |
---|
columnIdentifiers, dataVector |
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
DefaultSpanTableModel()
|
|
DefaultSpanTableModel(int rowCount,
int columnCount)
|
|
DefaultSpanTableModel(Object[][] data,
Object[] columnNames)
|
|
DefaultSpanTableModel(Object[] columnNames,
int rowCount)
|
|
DefaultSpanTableModel(Vector columnNames,
int rowCount)
|
|
DefaultSpanTableModel(Vector data,
Vector columnNames)
|
Method Summary | |
---|---|
void |
addCellSpan(CellSpan cellSpan)
Adds a cell span. |
void |
addSpanModelListener(SpanModelListener l)
Adds a listener to the list that's notified each time a change to the span model occurs. |
void |
fireTableSpanAdded(CellSpan cellSpan)
Notifies all listeners that a cell span is added at cell (row, column) . |
void |
fireTableSpanChanged()
Notifies all listeners that all span values in the table's rows may have changed. |
void |
fireTableSpanChanged(SpanModelEvent e)
Forwards the given notification event to all SpanModelListeners that registered themselves as
listeners for this table model. |
void |
fireTableSpanRemoved(CellSpan cellSpan)
Notifies all listeners that a cell span is removed at cell (row, column) . |
CellSpan |
getCellSpanAt(int rowIndex,
int columnIndex)
Gets the cell span at the specified row and column index. |
SpanModelListener[] |
getSpanModelListeners()
Returns an array of all the table model listeners registered on this model. |
void |
insertRow(int row,
Object[] rowData)
|
void |
insertRow(int row,
Vector rowData)
|
boolean |
isCellSpanOn()
Checks if the span is on. |
void |
moveRow(int start,
int end,
int to)
|
void |
removeAllCellSpans()
Removes all cell spans. |
void |
removeCellSpan(int rowIndex,
int columnIndex)
Removes the cell span. |
void |
removeRow(int row)
|
void |
removeSpanModelListener(SpanModelListener l)
Removes a listener from the list that's notified each time a change to the data model occurs. |
void |
setCellSpanOn(boolean cellSpanOn)
|
void |
setRowCount(int rowCount)
|
Methods inherited from class javax.swing.table.DefaultTableModel |
---|
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, getRowCount, getValueAt, isCellEditable, newDataAvailable, newRowsAdded, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setValueAt |
Methods inherited from class javax.swing.table.AbstractTableModel |
---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.table.TableModel |
---|
addTableModelListener, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, removeTableModelListener, setValueAt |
Constructor Detail |
---|
public DefaultSpanTableModel()
public DefaultSpanTableModel(int rowCount, int columnCount)
public DefaultSpanTableModel(Vector columnNames, int rowCount)
public DefaultSpanTableModel(Object[] columnNames, int rowCount)
public DefaultSpanTableModel(Vector data, Vector columnNames)
public DefaultSpanTableModel(Object[][] data, Object[] columnNames)
Method Detail |
---|
public CellSpan getCellSpanAt(int rowIndex, int columnIndex)
getCellSpanAt
in interface SpanModel
rowIndex
- the row index.columnIndex
- the column index.
public void addCellSpan(CellSpan cellSpan)
getCellSpanAt()
is called.
There is only one cell span allowed on the anchor cell. In the other word, if you try to add another cell span on
the anchor cell, it will remove previous cell span, then add the new one. As long as anchor cells are different,
two cell span can have overlap, even one cell span contains the other one.
cellSpan
- a CellSpan to be added.public void removeCellSpan(int rowIndex, int columnIndex)
rowIndex
- the row index.columnIndex
- the column index.public void removeAllCellSpans()
setCellSpanOn(false)
.
public boolean isCellSpanOn()
SpanModel
isCellSpanOn
in interface SpanModel
public void setCellSpanOn(boolean cellSpanOn)
public void addSpanModelListener(SpanModelListener l)
l
- the SpanModelListenerpublic void removeSpanModelListener(SpanModelListener l)
l
- the SpanModelListenerpublic SpanModelListener[] getSpanModelListeners()
SpanModelListener
s or an empty array if no table model listeners are
currently registeredaddSpanModelListener(com.jidesoft.grid.SpanModelListener)
,
removeSpanModelListener(com.jidesoft.grid.SpanModelListener)
public void fireTableSpanChanged()
JTable
should redraw the table from scratch. The structure of the table (as in
the order of the columns) is assumed to be the same.
SpanModelEvent
,
EventListenerList
public void fireTableSpanAdded(CellSpan cellSpan)
(row, column)
.
cellSpan
- the CellSpan which was just addedSpanModelEvent
public void fireTableSpanRemoved(CellSpan cellSpan)
(row, column)
.
cellSpan
- the CellSpan which was just removedSpanModelEvent
public void fireTableSpanChanged(SpanModelEvent e)
SpanModelListeners
that registered themselves as
listeners for this table model.
e
- the event to be forwardedaddSpanModelListener(com.jidesoft.grid.SpanModelListener)
,
SpanModelEvent
,
EventListenerList
public void insertRow(int row, Object[] rowData)
insertRow
in class DefaultTableModel
public void insertRow(int row, Vector rowData)
insertRow
in class DefaultTableModel
public void moveRow(int start, int end, int to)
moveRow
in class DefaultTableModel
public void removeRow(int row)
removeRow
in class DefaultTableModel
public void setRowCount(int rowCount)
setRowCount
in class DefaultTableModel
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |