|
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 com.jidesoft.grid.DefaultColumnTableModelWrapper
public class DefaultColumnTableModelWrapper
The default implementation of ColumnTableModelWrapper.
Field Summary | |
---|---|
protected int[] |
_indexes
|
protected TableModel |
_model
|
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Fields inherited from interface com.jidesoft.grid.MultiTableModel |
---|
FOOTER_COLUMN, HEADER_COLUMN, REGULAR_COLUMN |
Constructor Summary | |
---|---|
DefaultColumnTableModelWrapper(TableModel model)
Creates a DefaultColumnTableModelWrapper from any table model. |
Method Summary | |
---|---|
protected CompoundTableModelEvent |
createCompoundTableModelEvent()
Creates a CompoundTableModelEvent instance. |
protected Row |
createWrappedRow(ExpandableRow originalRow)
Creates wrapped row in the wrapped ITreeTableModel. |
void |
fireTableCellsUpdated(int firstRow,
int lastRow,
int column)
Called each time the cells in column in the range [firstRow , lastRow ] are
updated. |
void |
fireTableChanged(TableModelEvent e)
|
int |
getActualColumnAt(int column)
Gets the actual column. |
TableModel |
getActualModel()
Gets the actual table model. |
Class<?> |
getCellClassAt(int row,
int column)
Gets the cell class of the underlying table model. |
CellSpan |
getCellSpanAt(int rowIndex,
int columnIndex)
Gets the cell span at the specified row and column. |
CellStyle |
getCellStyleAt(int rowIndex,
int columnIndex)
Gets the cell style at the specified row and column. |
Class<?> |
getColumnClass(int column)
|
int |
getColumnCount()
|
Object |
getColumnIdentifier(int column)
Returns the identifier of the column in the model. |
String |
getColumnName(int column)
|
int |
getColumnType(int columnIndex)
Checks if the column at the columnIndex is a header column or footer column or just regular column. |
ConverterContext |
getConverterContextAt(int row,
int column)
Gets the converter context of the underlying table model. |
EditorContext |
getEditorContextAt(int row,
int column)
Gets the editor context of the underlying table model. |
int[] |
getIndexes()
Gets the indexes that maps from the visual column index to the actual column index. |
Object |
getRoot()
Gets the root expandable row which has the original rows as children. |
Row |
getRowAt(int rowIndex)
Returns the row at row specified by row . |
int |
getRowCount()
|
int |
getRowIndex(Row row)
Gets the index of the row. |
int |
getTableIndex(int columnIndex)
Gets the table index that this column belongs to. |
Object |
getValueAt(int row,
int column)
|
int |
getVisualColumnAt(int actualColumn)
Gets the visual column. |
boolean |
isCellEditable(int row,
int column)
|
boolean |
isCellSpanOn()
Checks if the span is on. |
boolean |
isCellStyleOn()
Checks if the style is on. |
protected void |
reallocateIndexes()
Resets the index mapping. |
void |
setIndexes(int[] indexes)
Sets the indexes of the column mapping. |
void |
setValueAt(Object value,
int row,
int column)
|
protected void |
tableCellsUpdated(int column,
int firstRow,
int lastRow)
Called each time the cells in column in the range [firstRow , lastRow ] are
updated. |
void |
tableChanged(TableModelEvent e)
Implementation of the TableChangeListener interface. |
protected void |
tableDataChanged()
Called each time all of the data (i.e. |
protected void |
tableDataChanged(CompoundTableModelEvent event)
|
protected void |
tableRowsDeleted(int firstRow,
int lastRow)
Called each time one or more contiguous rows are deleted from the underlying TableModel . |
protected void |
tableRowsInserted(int firstRow,
int lastRow)
Called each time one or more contiguous rows are inserted into the underlying TableModel . |
protected void |
tableRowsUpdated(int firstRow,
int lastRow)
Called each time one or more contiguous rows are updated in the underlying TableModel . |
protected void |
tableStructureChanged()
Called each time the structure ( TableColumn s, etc) of the underlying TableModel
changes. |
Methods inherited from class javax.swing.table.AbstractTableModel |
---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, 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, removeTableModelListener |
Field Detail |
---|
protected TableModel _model
protected int[] _indexes
Constructor Detail |
---|
public DefaultColumnTableModelWrapper(TableModel model)
model
- the table modelMethod Detail |
---|
public TableModel getActualModel()
getActualModel
in interface TableModelWrapper
public int getActualColumnAt(int column)
getActualColumnAt
in interface ColumnTableModelWrapper
column
- the column on the UI.
public int getVisualColumnAt(int actualColumn)
getVisualColumnAt
in interface ColumnTableModelWrapper
actualColumn
- the actual column in actual model.
public Object getValueAt(int row, int column)
getValueAt
in interface TableModel
public void setValueAt(Object value, int row, int column)
setValueAt
in interface TableModel
setValueAt
in class AbstractTableModel
public int getRowCount()
getRowCount
in interface TableModel
public int getColumnCount()
getColumnCount
in interface TableModel
public String getColumnName(int column)
getColumnName
in interface TableModel
getColumnName
in class AbstractTableModel
public Class<?> getColumnClass(int column)
getColumnClass
in interface TableModel
getColumnClass
in class AbstractTableModel
public boolean isCellEditable(int row, int column)
isCellEditable
in interface TableModel
isCellEditable
in class AbstractTableModel
public ConverterContext getConverterContextAt(int row, int column)
ContextSensitiveTableModel
. If not, it will return null.
getConverterContextAt
in interface ContextSensitiveTableModel
row
- the row index.column
- the column index.
public EditorContext getEditorContextAt(int row, int column)
ContextSensitiveTableModel
. If not, it will return null.
getEditorContextAt
in interface ContextSensitiveTableModel
row
- the row index.column
- the column index.
public Class<?> getCellClassAt(int row, int column)
ContextSensitiveTableModel
. If not, it will return null.
getCellClassAt
in interface ContextSensitiveTableModel
row
- the row index.column
- the column index.
public Object getColumnIdentifier(int column)
ColumnIdentifierTableModel
JideTable
uses this method to get the unique
identifier of this column.
getColumnIdentifier
in interface ColumnIdentifierTableModel
column
- the index of the column
protected void reallocateIndexes()
public int[] getIndexes()
public void setIndexes(int[] indexes)
indexes
- the new index array.public CellStyle getCellStyleAt(int rowIndex, int columnIndex)
StyleModel
getCellStyleAt
in interface StyleModel
rowIndex
- the row indexcolumnIndex
- the column index
public boolean isCellStyleOn()
StyleModel
isCellStyleOn
in interface StyleModel
public CellSpan getCellSpanAt(int rowIndex, int columnIndex)
SpanModel
private final CellSpan span = new CellSpan(0,0,1,1);
public CellSpan getCellSpanAt(int row, int col) {
span.setRow(...);
span.setColumn(...);
span.setRowSpan(...);
span.setColumnSpan(...);
return span;
}
For performance consideration, if the cell span has 1 row span and 1 column span, it is better to return null
instead of new CellSpan(row, column, 1, 1).
getCellSpanAt
in interface SpanModel
rowIndex
- the row index.columnIndex
- the column index.
public boolean isCellSpanOn()
SpanModel
isCellSpanOn
in interface SpanModel
public int getColumnType(int columnIndex)
MultiTableModel
getColumnType
in interface MultiTableModel
columnIndex
- the column index
public int getTableIndex(int columnIndex)
MultiTableModel
getTableIndex
in interface MultiTableModel
columnIndex
- the column index
public void tableChanged(TableModelEvent e)
TableChangeListener
interface. Depending on the type of the
TableModelEvent
, this method delegates to one of the following methods based on the contract of the
TableModelEvent
object: tableRowsInserted(int,int)
tableRowsDeleted(int,int)
tableStructureChanged()
tableDataChanged()
tableRowsUpdated(int,int)
tableCellsUpdated(int,int,int)
TableModelEvent
to the listeners on this model. Most Subclasses
will override one or more of the above protected methods to provide custom behavior for particular events.
However, some implementations may wish to override this method instead. Obviously, if this method is overridden,
the above protected methods will not be called unless the overridden implementation does so explicitly.
tableChanged
in interface TableModelListener
e
- the TableModelEvent
representing the changeprotected void tableRowsInserted(int firstRow, int lastRow)
TableModel
. This
default implementation simply fires a corresponding TableModelEvent
to the listeners on this model.
firstRow
- the index of the first row that was insertedlastRow
- the index of the last row that was insertedprotected void tableRowsDeleted(int firstRow, int lastRow)
TableModel
. This
default implementation simply fires a corresponding TableModelEvent
to the listeners on this model.
firstRow
- the index of the first row that was deletedlastRow
- the index of the last row that was deletedprotected void tableRowsUpdated(int firstRow, int lastRow)
TableModel
. simply fires
a corresponding TableModelEvent
to the listeners on this model.
firstRow
- the index of the first row that was updatedlastRow
- the index of the last row that was updatedpublic void fireTableCellsUpdated(int firstRow, int lastRow, int column)
column
in the range [firstRow
, lastRow
] are
updated. This default implementation simply fires a corresponding TableModelEvent
to the listeners
on this model.
firstRow
- the index of the first row in the above column
that was updatedlastRow
- the index of the last row in the above column
that was updatedcolumn
- the index of the column that was updatedprotected void tableCellsUpdated(int column, int firstRow, int lastRow)
column
in the range [firstRow
, lastRow
] are
updated. This default implementation simply fires a corresponding TableModelEvent
to the listeners
on this model.
column
- the index of the column that was updatedfirstRow
- the index of the first row in the above column
that was updatedlastRow
- the index of the last row in the above column
that was updatedprotected void tableDataChanged(CompoundTableModelEvent event)
protected CompoundTableModelEvent createCompoundTableModelEvent()
protected void tableDataChanged()
TableModel
. This
default implementation simply fires a corresponding TableModelEvent
to the listeners on this model.
protected void tableStructureChanged()
TableColumn
s, etc) of the underlying TableModel
changes. This default implementation simply fires a corresponding TableModelEvent
to the listeners
on this model.
public void fireTableChanged(TableModelEvent e)
fireTableChanged
in class AbstractTableModel
public Row getRowAt(int rowIndex)
ITreeTableModel
row
.
getRowAt
in interface ITreeTableModel
rowIndex
- the row whose row is to be queried
protected Row createWrappedRow(ExpandableRow originalRow)
originalRow
- the original row in the wrapped ITreeTableModel
public int getRowIndex(Row row)
ITreeTableModel
getRowIndex
in interface ITreeTableModel
row
- row
public Object getRoot()
ITreeTableModel
getRoot
in interface ITreeTableModel
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |