|
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.TableModelWrapperImpl
public class TableModelWrapperImpl
The default implementation of TableModelWrapper.
Note: This class should be named as DefaultTableModelWrapper but the name was taken and is too much trouble to change.
Field Summary | |
---|---|
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 |
Fields inherited from interface com.jidesoft.grid.EditorStyleTableModel |
---|
EDITOR_STYLE_EDITABLE, EDITOR_STYLE_NORMAL, EDITOR_STYLE_READ_ONLY, EDITOR_STYLE_SELECT_ONLY |
Constructor Summary | |
---|---|
TableModelWrapperImpl(TableModel model)
Creates a DefaultTableModelWrapper from any table model. |
Method Summary | |
---|---|
void |
addIndexChangeListener(IndexChangeListener l)
Add IndexChangelistener. |
protected CompoundTableModelEvent |
createCompoundTableModelEvent()
Creates a CompoundTableModelEvent instance. |
protected void |
fireIndexChanged(int eventSerialNumber)
Tells the TableModeWrapper that indexes is changed. |
protected int |
fireIndexChanging()
Tells the TableModeWrapper that indexes is going to be changed. |
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)
|
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 cell span of the underlying table model. |
CellStyle |
getCellStyleAt(int row,
int column)
Returns null all the time unless you override this method to return a cell style. |
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 |
getEditorStyleAt(int rowIndex,
int columnIndex)
Gets editor style at the cell. |
IndexChangeListener[] |
getIndexChangeListeners()
Returns an array of all the IndexChangeListener s |
int |
getRowCount()
|
int |
getTableIndex(int columnIndex)
Gets the table index that this column belongs to. |
Object |
getValueAt(int row,
int column)
|
boolean |
isCellEditable(int row,
int column)
|
boolean |
isCellSpanOn()
Delegates to underlying table model for cell span information. |
boolean |
isCellStyleOn()
Returns false all the time unless you override this method to return true. |
boolean |
isNavigableAt(int rowIndex,
int columnIndex)
it return true by default. |
boolean |
isNavigationOn()
It returns false. |
void |
removeIndexChangeListener(IndexChangeListener l)
Remove IndexChangelistener. |
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)
Called if it receives a table data changed event however the event is an instance of CompoundTableModelEvent . |
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
Constructor Detail |
---|
public TableModelWrapperImpl(TableModel model)
model
- the actual table model.Method Detail |
---|
public void addIndexChangeListener(IndexChangeListener l)
IndexChangeEventGenerator
addIndexChangeListener
in interface IndexChangeEventGenerator
l
- the listenerpublic void removeIndexChangeListener(IndexChangeListener l)
IndexChangeEventGenerator
removeIndexChangeListener
in interface IndexChangeEventGenerator
l
- the listenerpublic IndexChangeListener[] getIndexChangeListeners()
IndexChangeEventGenerator
IndexChangeListener
s
getIndexChangeListeners
in interface IndexChangeEventGenerator
IndexChangeListener
s added or an empty array if no listeners have been addedIndexChangeEventGenerator.addIndexChangeListener(com.jidesoft.grid.IndexChangeListener)
protected int fireIndexChanging()
protected void fireIndexChanged(int eventSerialNumber)
eventSerialNumber
- the serial number indicating where this method is invoked, to be pair with
fireIndexChangingpublic TableModel getActualModel()
getActualModel
in interface TableModelWrapper
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 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
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 underlying model's
getColumnClass(column).
getCellClassAt
in interface ContextSensitiveTableModel
row
- the row index.column
- the column index.
public CellStyle getCellStyleAt(int row, int column)
getCellStyleAt
in interface StyleModel
row
- the row index.column
- the column index.
public boolean isCellStyleOn()
isCellStyleOn
in interface StyleModel
public boolean isNavigableAt(int rowIndex, int columnIndex)
isNavigableAt
in interface NavigableModel
rowIndex
- the row index.columnIndex
- the column index.
public boolean isNavigationOn()
isNavigationOn
in interface NavigableModel
public CellSpan getCellSpanAt(int rowIndex, int columnIndex)
getCellSpanAt
in interface SpanModel
rowIndex
- the row indexcolumnIndex
- the column index.
public boolean isCellSpanOn()
isCellSpanOn
in interface SpanModel
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 CompoundTableModelEvent createCompoundTableModelEvent()
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 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)
CompoundTableModelEvent
.
event
- the received CompoundTableModelEventprotected 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 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 int getEditorStyleAt(int rowIndex, int columnIndex)
EditorStyleTableModel
getEditorStyleAt
in interface EditorStyleTableModel
rowIndex
- the row indexcolumnIndex
- the column index
public void fireTableChanged(TableModelEvent e)
fireTableChanged
in class AbstractTableModel
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |