|
JIDE 3.5.15 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.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 ( TableColumns, 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 model| Method Detail |
|---|
public TableModel getActualModel()
getActualModel in interface TableModelWrapperpublic int getActualColumnAt(int column)
getActualColumnAt in interface ColumnTableModelWrappercolumn - the column on the UI.
public int getVisualColumnAt(int actualColumn)
getVisualColumnAt in interface ColumnTableModelWrapperactualColumn - 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 TableModelsetValueAt in class AbstractTableModelpublic int getRowCount()
getRowCount in interface TableModelpublic int getColumnCount()
getColumnCount in interface TableModelpublic String getColumnName(int column)
getColumnName in interface TableModelgetColumnName in class AbstractTableModelpublic Class<?> getColumnClass(int column)
getColumnClass in interface TableModelgetColumnClass in class AbstractTableModel
public boolean isCellEditable(int row,
int column)
isCellEditable in interface TableModelisCellEditable in class AbstractTableModel
public ConverterContext getConverterContextAt(int row,
int column)
ContextSensitiveTableModel. If not, it will return null.
getConverterContextAt in interface ContextSensitiveTableModelrow - the row index.column - the column index.
public EditorContext getEditorContextAt(int row,
int column)
ContextSensitiveTableModel. If not, it will return null.
getEditorContextAt in interface ContextSensitiveTableModelrow - the row index.column - the column index.
public Class<?> getCellClassAt(int row,
int column)
ContextSensitiveTableModel. If not, it will return null.
getCellClassAt in interface ContextSensitiveTableModelrow - the row index.column - the column index.
public Object getColumnIdentifier(int column)
ColumnIdentifierTableModelJideTable uses this method to get the unique
identifier of this column.
getColumnIdentifier in interface ColumnIdentifierTableModelcolumn - 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 StyleModelrowIndex - 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 SpanModelrowIndex - the row index.columnIndex - the column index.
public boolean isCellSpanOn()
SpanModel
isCellSpanOn in interface SpanModelpublic int getColumnType(int columnIndex)
MultiTableModel
getColumnType in interface MultiTableModelcolumnIndex - the column index
public int getTableIndex(int columnIndex)
MultiTableModel
getTableIndex in interface MultiTableModelcolumnIndex - 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 TableModelListenere - the TableModelEvent representing the change
protected 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 inserted
protected 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 deleted
protected 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 updated
public 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 updated
protected 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()
TableColumns, 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 AbstractTableModelpublic Row getRowAt(int rowIndex)
ITreeTableModelrow.
getRowAt in interface ITreeTableModelrowIndex - 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 ITreeTableModelrow - 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 | ||||||||