public class IlvFilterFlatTableModel extends IlvAbstractFlatTableModel
All the methods on this model are implemented by an indirection to the underlying model. Subclasses will override some of these methods to actually implement filtering or other additional functionalities.
An instance of this class automatically propagates notification events from the underlying model to its own listeners.
BEFORE_COLUMN_REMOVED_MASK, BEFORE_DATA_CHANGE_MASK, BEFORE_ROWS_REMOVED_MASK
Constructor and Description |
---|
IlvFilterFlatTableModel()
Creates a filter model without any underlying model.
|
IlvFilterFlatTableModel(IlvFlatTableModel model)
Creates a filter model.
|
IlvFilterFlatTableModel(int eventsMask)
Creates a filter model without any underlying model.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Returns a copy of this object.
|
void |
disconnect()
Drops references to objects to help garbage collection.
|
void |
dispose()
Cleans up this model and drops references to objects to
help garbage collection.
|
void |
fireBeforeColumnRemoved(int column,
IlvDataColumnInfo columnInfo)
Fires a
BEFORE_COLUMN_REMOVED event. |
void |
fireBeforeDataChange(int firstRow,
int lastRow,
int column)
Fires a
BEFORE_DATA_CHANGE event. |
void |
fireBeforeRowsRemoved(int firstRow,
int lastRow)
Fires a
BEFORE_ROWS_REMOVED event. |
void |
fireColumnAdded(int column,
IlvDataColumnInfo columnInfo)
Fires a
COLUMN_ADDED event. |
void |
fireColumnPropertyChanged(FlatTableModelEvent.Type type,
int column,
Object oldValue,
Object newValue)
Fires an
EMPTY_VALUE_CHANGED or
ENUMERATED_CHANGED or ENUM_VALUES_CHANGED or
MIN_VALUE_CHANGED or MAX_VALUE_CHANGED event. |
void |
fireColumnRemoved(int column,
IlvDataColumnInfo columnInfo)
Fires a
COLUMN_REMOVED event. |
void |
fireDataChanged(int firstRow,
int lastRow,
int column)
Fires a
DATA_CHANGED event. |
void |
fireRowsAdded(int firstRow,
int lastRow)
Fires a
ROWS_ADDED event. |
void |
fireRowsRemoved(int firstRow,
int lastRow)
Fires a
ROWS_REMOVED event. |
IlvDataColumnInfo |
getColumn(int columnIndex)
This method is implemented through a call to the underlying model.
|
int |
getColumnCount()
This method is implemented through a call to the underlying model.
|
double |
getDoubleAt(int rowIndex,
int columnIndex)
This method is implemented through a call to the underlying model.
|
IlvFlatTableModel |
getFilteredModel()
Returns the underlying model.
|
int |
getRowCount()
This method is implemented through a call to the underlying model.
|
int |
getSupportedEventsMask()
Returns a bit mask denoting the optional kinds of events that are guaranteed
to be sent by this model to the registered listeners.
|
Object |
getValueAt(int rowIndex,
int columnIndex)
This method is implemented through a call to the underlying model.
|
void |
noteBeforeColumnRemoved(int column,
IlvDataColumnInfo columnInfo)
Reacts on a
BEFORE_COLUMN_REMOVED event from the underlying model. |
void |
noteBeforeDataChange(int firstRow,
int lastRow,
int column)
Reacts on a
BEFORE_DATA_CHANGE event from the underlying model. |
void |
noteBeforeRowsRemoved(int firstRow,
int lastRow)
Reacts on a
BEFORE_ROWS_REMOVED event from the underlying model. |
void |
noteColumnAdded(int column,
IlvDataColumnInfo columnInfo)
Reacts on a
COLUMN_ADDED event from the underlying model. |
void |
noteColumnPropertyChanged(FlatTableModelEvent.Type type,
int column,
Object oldValue,
Object newValue)
Reacts on a
EMPTY_VALUE_CHANGED or
ENUMERATED_CHANGED or ENUM_VALUES_CHANGED or
MIN_VALUE_CHANGED or MAX_VALUE_CHANGED event
from the underlying model. |
void |
noteColumnRemoved(int column,
IlvDataColumnInfo columnInfo)
Reacts on a
COLUMN_REMOVED event from the underlying model. |
void |
noteDataChanged(int firstRow,
int lastRow,
int column)
Reacts on a
DATA_CHANGED event from the underlying model. |
void |
noteRowsAdded(int firstRow,
int lastRow)
Reacts on a
ROWS_ADDED event from the underlying model. |
void |
noteRowsRemoved(int firstRow,
int lastRow)
Reacts on a
ROWS_REMOVED event from the underlying model. |
void |
setDoubleAt(double value,
int rowIndex,
int columnIndex)
This method is implemented through a call to the underlying model.
|
void |
setFilteredModel(IlvFlatTableModel model)
Sets the underlying model.
|
void |
setValueAt(Object value,
int rowIndex,
int columnIndex)
This method is implemented through a call to the underlying model.
|
addFlatTableModelListener, convertToDouble, endBatch, fireModelEvent, removeFlatTableModelListener, startBatch
public IlvFilterFlatTableModel()
setFilteredModel
in order to specify the
underlying model.public IlvFilterFlatTableModel(int eventsMask)
setFilteredModel
in order to specify the
underlying model.eventsMask
- Required supported events mask for any underlying model.public IlvFilterFlatTableModel(IlvFlatTableModel model)
model
- The underlying model.public int getRowCount()
public int getColumnCount()
public Object getValueAt(int rowIndex, int columnIndex)
public void setValueAt(Object value, int rowIndex, int columnIndex)
value
- The new value.rowIndex
- The row containing the cell whose value is to be changed.columnIndex
- The column containing the cell whose value is to be
changed.public double getDoubleAt(int rowIndex, int columnIndex)
public void setDoubleAt(double value, int rowIndex, int columnIndex)
value
- The new value.rowIndex
- The row containing the cell whose value is to be changed.columnIndex
- The column containing the cell whose value is to be
changed.public IlvDataColumnInfo getColumn(int columnIndex)
columnIndex
- The column.public int getSupportedEventsMask()
This implementation returns the event mask given at construction time. It may need to be overridden in subclasses.
getSupportedEventsMask
in interface IlvFlatTableModel
getSupportedEventsMask
in class IlvAbstractFlatTableModel
IlvFlatTableModel.BEFORE_DATA_CHANGE_MASK
,
IlvFlatTableModel.BEFORE_ROWS_REMOVED_MASK
,
IlvFlatTableModel.BEFORE_COLUMN_REMOVED_MASK
public void fireDataChanged(int firstRow, int lastRow, int column)
DATA_CHANGED
event.firstRow
- First row changed.lastRow
- Last row changed.column
- The column that changed, or -1 for all columns.public void fireBeforeDataChange(int firstRow, int lastRow, int column)
BEFORE_DATA_CHANGE
event.firstRow
- First row that will change.lastRow
- Last row that will change.column
- The column that will change, or -1 for all columns.public void fireRowsAdded(int firstRow, int lastRow)
ROWS_ADDED
event.firstRow
- The first row that was added (index after adding the rows).lastRow
- The last row that was added (index after adding the rows).public void fireRowsRemoved(int firstRow, int lastRow)
ROWS_REMOVED
event.firstRow
- The first row that was removed (index before removing the
rows).lastRow
- The last row that was removed (index before removing the rows).public void fireBeforeRowsRemoved(int firstRow, int lastRow)
BEFORE_ROWS_REMOVED
event.firstRow
- The first row that will be removed (index before removing the
rows).lastRow
- The last row that will be removed (index before removing the rows).public void fireColumnAdded(int column, IlvDataColumnInfo columnInfo)
COLUMN_ADDED
event.column
- The column that was added (index after adding).columnInfo
- The IlvDataColumnInfo
of the column that was
added.public void fireColumnRemoved(int column, IlvDataColumnInfo columnInfo)
COLUMN_REMOVED
event.column
- The column that was removed (index before removing).columnInfo
- The IlvDataColumnInfo
of the column that was
removed.public void fireBeforeColumnRemoved(int column, IlvDataColumnInfo columnInfo)
BEFORE_COLUMN_REMOVED
event.column
- The column that will be removed (index before removing).columnInfo
- The IlvDataColumnInfo
of the column that
will be removed.public void fireColumnPropertyChanged(FlatTableModelEvent.Type type, int column, Object oldValue, Object newValue)
EMPTY_VALUE_CHANGED
or
ENUMERATED_CHANGED
or ENUM_VALUES_CHANGED
or
MIN_VALUE_CHANGED
or MAX_VALUE_CHANGED
event.type
- One of EMPTY_VALUE_CHANGED
,
ENUMERATED_CHANGED
,
ENUM_VALUES_CHANGED
,
MIN_VALUE_CHANGED
,
MAX_VALUE_CHANGED
.column
- The affected column.oldValue
- The old value.newValue
- The new Value.public void noteDataChanged(int firstRow, int lastRow, int column)
DATA_CHANGED
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireDataChanged
.
firstRow
- First row changed.lastRow
- Last row changed.column
- The column that changed, or -1 for all columns.public void noteBeforeDataChange(int firstRow, int lastRow, int column)
BEFORE_DATA_CHANGE
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireBeforeDataChange
.
firstRow
- First row that will change.lastRow
- Last row that will change.column
- The column that will change, or -1 for all columns.public void noteRowsAdded(int firstRow, int lastRow)
ROWS_ADDED
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireRowsAdded
.
firstRow
- The first row that was added (index after adding the rows).lastRow
- The last row that was added (index after adding the rows).public void noteRowsRemoved(int firstRow, int lastRow)
ROWS_REMOVED
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireRowsRemoved
.
firstRow
- The first row that was removed (index before removing the
rows).lastRow
- The last row that was removed (index before removing the rows).public void noteBeforeRowsRemoved(int firstRow, int lastRow)
BEFORE_ROWS_REMOVED
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireBeforeRowsRemoved
.
firstRow
- The first row that will be removed (index before removing the
rows).lastRow
- The last row that will be removed (index before removing the rows).public void noteColumnAdded(int column, IlvDataColumnInfo columnInfo)
COLUMN_ADDED
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireColumnAdded
.
column
- The column that was added (index after adding).columnInfo
- The IlvDataColumnInfo
of the column that was
added.public void noteColumnRemoved(int column, IlvDataColumnInfo columnInfo)
COLUMN_REMOVED
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireColumnRemoved
.
column
- The column that was removed (index before removing).columnInfo
- The IlvDataColumnInfo
of the column that was
removed.public void noteBeforeColumnRemoved(int column, IlvDataColumnInfo columnInfo)
BEFORE_COLUMN_REMOVED
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireBeforeColumnRemoved
.
column
- The column that will be removed (index before removing).columnInfo
- The IlvDataColumnInfo
of the column that
will be removed.public void noteColumnPropertyChanged(FlatTableModelEvent.Type type, int column, Object oldValue, Object newValue)
EMPTY_VALUE_CHANGED
or
ENUMERATED_CHANGED
or ENUM_VALUES_CHANGED
or
MIN_VALUE_CHANGED
or MAX_VALUE_CHANGED
event
from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireColumnPropertyChanged
.
type
- One of EMPTY_VALUE_CHANGED
,
ENUMERATED_CHANGED
,
ENUM_VALUES_CHANGED
,
MIN_VALUE_CHANGED
,
MAX_VALUE_CHANGED
.column
- The affected column.oldValue
- The old value.newValue
- The new Value.public IlvFlatTableModel getFilteredModel()
public void setFilteredModel(IlvFlatTableModel model)
model
- The data model that this model shall refer to.public void dispose()
Note: After calling this function, this model is no longer functional.
public void disconnect()
Note: After calling this function, and after some changes occurred in the underlying model, this model is no longer functional.
public Object clone()
clone
in class IlvAbstractFlatTableModel
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.