public class IlvListToFlatListModel extends IlvPropertyBasedFlatListModel
IlvFlatListModel
, based on a
Swing ListModel
.
Note: This model supports adding and removing rows if and only if the
underlying ListModel
is an instance of
DefaultListModel
.
BEFORE_COLUMN_REMOVED_MASK, BEFORE_DATA_CHANGE_MASK, BEFORE_OBJECTS_REMOVED_MASK
Constructor and Description |
---|
IlvListToFlatListModel(ListModel model,
IlvPropertyConnector propaccess)
Creates a model backed by a given
ListModel , with zero columns. |
IlvListToFlatListModel(ListModel model,
IlvPropertyConnector propaccess,
IlvDataColumnInfo[] columns)
Creates a model backed by a given
ListModel , with the given columns. |
IlvListToFlatListModel(ListModel model,
IlvPropertyConnector propaccess,
IlvDataColumnInfo[] columns,
int eventsMaskHint)
Creates a model backed by a given
ListModel , with the given columns. |
IlvListToFlatListModel(ListModel model,
IlvPropertyConnector propaccess,
int eventsMaskHint)
Creates a model backed by a given
ListModel , with zero columns. |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all objects from the model.
|
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.
|
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.
|
void |
insertObject(Object object,
int index)
Adds an object to the model at a given index.
|
void |
insertObject(Object object,
Object[] data,
int index)
Adds an object to the model at a given index.
|
void |
insertObjects(Object[] objects,
int index)
Adds some objects to the model at a given index.
|
void |
removeObject(Object object)
Removes an object from the model.
|
void |
removeObjects(Object[] objects,
int firstIndex)
Removes some consecutive objects from the model.
|
void |
setObjects(Collection objects)
Replaces the set of objects in the model.
|
createColumnStorage, getDoubleAt, getValueAt, internalObjectsAdd, internalObjectsRemove, internalObjectsSet, setDoubleAtInternal, setValueAtInternal
addObject, addObject, getIndexOf, getObjectAt, getObjects, isColumnComputed, setDoubleAt, setValueAt
addColumn, addColumn, addColumn, fireModelEvent, getColumn, getColumnCount, getColumns, insertColumn, insertColumn, insertColumn, removeColumn, setColumn, setColumnCount, setColumns
addFlatListModelListener, convertToDouble, endBatch, removeFlatListModelListener, startBatch
public IlvListToFlatListModel(ListModel model, IlvPropertyConnector propaccess)
ListModel
, with zero columns.model
- The underlying model.propaccess
- The mechanism to access properties.public IlvListToFlatListModel(ListModel model, IlvPropertyConnector propaccess, int eventsMaskHint)
ListModel
, with zero columns.model
- The underlying model.propaccess
- The mechanism to access properties.eventsMaskHint
- Desired events mask. This is just a hint; there is
no guarantee that the event types designated by the
mask are supported by this model.public IlvListToFlatListModel(ListModel model, IlvPropertyConnector propaccess, IlvDataColumnInfo[] columns)
ListModel
, with the given columns.model
- The underlying model.propaccess
- The mechanism to access properties.columns
- The list of columns of this model.public IlvListToFlatListModel(ListModel model, IlvPropertyConnector propaccess, IlvDataColumnInfo[] columns, int eventsMaskHint)
ListModel
, with the given columns.model
- The underlying model.propaccess
- The mechanism to access properties.columns
- The list of columns of this model.eventsMaskHint
- Desired events mask. This is just a hint; there is
no guarantee that the event types designated by the
mask are supported by this model.public int getSupportedEventsMask()
This implementation returns BEFORE_COLUMN_REMOVED_MASK
,
intersected with the eventsMaskHint constructor argument.
It may need to be overridden in subclasses.
getSupportedEventsMask
in interface IlvFlatListModel
getSupportedEventsMask
in class IlvPropertyBasedFlatListModel
IlvFlatListModel.BEFORE_DATA_CHANGE_MASK
,
IlvFlatListModel.BEFORE_OBJECTS_REMOVED_MASK
,
IlvFlatListModel.BEFORE_COLUMN_REMOVED_MASK
public void setObjects(Collection objects)
setObjects
in class IlvDefaultFlatListModel
public void insertObject(Object object, int index)
insertObject
in class IlvDefaultFlatListModel
index
- The object desired index. It must be >= 0 and
<= getObjects().size()
.public void insertObjects(Object[] objects, int index)
insertObjects
in class IlvDefaultFlatListModel
index
- The first index of the new object. It must be >= 0 and
<= getObjects().size()
.public void insertObject(Object object, Object[] data, int index)
insertObject
in class IlvDefaultFlatListModel
data
- The initial data of this object. It must be an array of
getColumnCount()
elements.index
- The index of the new object. It must be >= 0 and
<= getObjects().size()
.public void removeObject(Object object)
removeObject
in class IlvDefaultFlatListModel
public void removeObjects(Object[] objects, int firstIndex)
removeObjects
in class IlvDefaultFlatListModel
objects
- The objects that were at indices firstIndex, ...,
firstIndex+objects.length-1 of
getObjects().iterator()
.public void clear()
clear
in class IlvDefaultFlatListModel
public void dispose()
Note: After calling this function, this model is no longer functional.
dispose
in class IlvPropertyBasedFlatListModel
public void disconnect()
Note: After calling this function, and after some changes occurred in the underlying model or columns, this model is no longer functional.
disconnect
in class IlvPropertyBasedFlatListModel
public Object clone()
clone
in class IlvPropertyBasedFlatListModel
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.