public class IlvFilterFlatListModel extends IlvAbstractFlatListModel
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_OBJECTS_REMOVED_MASK
Constructor and Description |
---|
IlvFilterFlatListModel()
Creates a filter model without any underlying model.
|
IlvFilterFlatListModel(IlvFlatListModel model)
Creates a filter model.
|
IlvFilterFlatListModel(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(Object object,
int column)
Fires a
BEFORE_DATA_CHANGE event. |
void |
fireBeforeObjectsRemoved(Object[] objects,
int firstIndex)
Fires a
BEFORE_OBJECTS_REMOVED event. |
void |
fireColumnAdded(int column,
IlvDataColumnInfo columnInfo)
Fires a
COLUMN_ADDED event. |
void |
fireColumnPropertyChanged(FlatListModelEvent.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(Object object,
int column)
Fires a
DATA_CHANGED event. |
void |
fireObjectsAdded(Object[] objects,
int firstIndex)
Fires an
OBJECTS_ADDED event. |
void |
fireObjectsRemoved(Object[] objects,
int firstIndex)
Fires an
OBJECTS_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(Object object,
int columnIndex)
This method is implemented through a call to the underlying model.
|
IlvFlatListModel |
getFilteredModel()
Returns the underlying model.
|
List |
getObjects()
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(Object object,
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(Object object,
int column)
Reacts on a
BEFORE_DATA_CHANGE event from the underlying model. |
void |
noteBeforeObjectsRemoved(Object[] objects,
int firstIndex)
Reacts on a
BEFORE_OBJECTS_REMOVED event from the underlying model. |
void |
noteColumnAdded(int column,
IlvDataColumnInfo columnInfo)
Reacts on a
COLUMN_ADDED event from the underlying model. |
void |
noteColumnPropertyChanged(FlatListModelEvent.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(Object object,
int column)
Reacts on a
DATA_CHANGED event from the underlying model. |
void |
noteObjectsAdded(Object[] objects,
int firstIndex)
Reacts on an
OBJECTS_ADDED event from the underlying model. |
void |
noteObjectsRemoved(Object[] objects,
int firstIndex)
Reacts on an
OBJECTS_REMOVED event from the underlying model. |
void |
setDoubleAt(double value,
Object object,
int columnIndex)
This method is implemented through a call to the underlying model.
|
void |
setFilteredModel(IlvFlatListModel model)
Sets the underlying model.
|
void |
setValueAt(Object value,
Object object,
int columnIndex)
This method is implemented through a call to the underlying model.
|
addFlatListModelListener, convertToDouble, endBatch, fireModelEvent, removeFlatListModelListener, startBatch
public IlvFilterFlatListModel()
setFilteredModel
in order to specify the
underlying model.public IlvFilterFlatListModel(int eventsMask)
setFilteredModel
in order to specify the
underlying model.eventsMask
- Required supported events mask for any underlying model.public IlvFilterFlatListModel(IlvFlatListModel model)
model
- The underlying model.public List getObjects()
public int getColumnCount()
public Object getValueAt(Object object, int columnIndex)
object
- The object (row) in which the value is to be looked up.columnIndex
- The column denoting the attribute whose value is to be
looked up.public void setValueAt(Object value, Object object, int columnIndex)
value
- The new value.object
- The object (row) in which the value is to be changed.columnIndex
- The column denoting the attribute whose value is to be
changed.public double getDoubleAt(Object object, int columnIndex)
object
- The object (row) in which the value is to be looked up.columnIndex
- The column denoting the attribute whose value is to be
looked up.public void setDoubleAt(double value, Object object, int columnIndex)
value
- The new value.object
- The object (row) in which the value is to be changed.columnIndex
- The column denoting the attribute 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 IlvFlatListModel
getSupportedEventsMask
in class IlvAbstractFlatListModel
IlvFlatListModel.BEFORE_DATA_CHANGE_MASK
,
IlvFlatListModel.BEFORE_OBJECTS_REMOVED_MASK
,
IlvFlatListModel.BEFORE_COLUMN_REMOVED_MASK
public void fireDataChanged(Object object, int column)
DATA_CHANGED
event.object
- The object whose attributes have changed, or
null
for all objects.column
- The column that changed, or -1 for all columns.public void fireBeforeDataChange(Object object, int column)
BEFORE_DATA_CHANGE
event.object
- The object whose attributes will change, or
null
for all objects.column
- The column that will change, or -1 for all columns.public void fireObjectsAdded(Object[] objects, int firstIndex)
OBJECTS_ADDED
event.objects
- The set of objects that was added, in the same
order as in source.getObjects()
.firstIndex
- The index of the first object (index after adding the
objects). The second object is at firstIndex+1, and so on.public void fireObjectsRemoved(Object[] objects, int firstIndex)
OBJECTS_REMOVED
event.objects
- The set of objects that was removed, in the same
order as in source.getObjects()
.firstIndex
- The index of the first object (index before removing the
objects). The second object was at firstIndex+1, and so on.public void fireBeforeObjectsRemoved(Object[] objects, int firstIndex)
BEFORE_OBJECTS_REMOVED
event.objects
- The set of objects that will be removed, in the same
order as in source.getObjects()
.firstIndex
- The index of the first object (index before removing the
objects). The second object is at firstIndex+1
, and so on.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(FlatListModelEvent.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(Object object, int column)
DATA_CHANGED
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireDataChanged
.
object
- The object whose attributes have changed, or
null
for all objects.column
- Column that changed, or -1 for all columns.public void noteBeforeDataChange(Object object, 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
.
object
- The object whose attributes will change, or
null
for all objects.column
- Column that will change, or -1 for all columns.public void noteObjectsAdded(Object[] objects, int firstIndex)
OBJECTS_ADDED
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireObjectsAdded
.
objects
- The set of objects that was added, in the same
order as in source.getObjects()
.firstIndex
- The index of the first object (index after adding the
objects). The second object is at firstIndex+1, and so on.public void noteObjectsRemoved(Object[] objects, int firstIndex)
OBJECTS_REMOVED
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireObjectsRemoved
.
objects
- The set of objects that was removed, in the same
order as in source.getObjects()
.firstIndex
- The index of the first object (index before removing the
objects). The second object was at firstIndex+1, and so on.public void noteBeforeObjectsRemoved(Object[] objects, int firstIndex)
BEFORE_OBJECTS_REMOVED
event from the underlying model.
This method is meant to be overridden in subclasses. The default
implementation here calls fireBeforeObjectsRemoved
.
objects
- The set of objects that will be removed, in the same
order as in source.getObjects()
.firstIndex
- The index of the first object (index before removing the
objects). The second object is at firstIndex+1
, and so on.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(FlatListModelEvent.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 IlvFlatListModel getFilteredModel()
public void setFilteredModel(IlvFlatListModel 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 IlvAbstractFlatListModel
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.