Class WIdentityProxyModel
public class WIdentityProxyModel extends WAbstractProxyModel
A WIdentityProxyModel
simply forwards the structure of the source model, without any
transformation. WIdentityProxyModel
can be used as a base class for implementing proxy
models that reimplement WAbstractProxyModel#getData()
, but retain all other characteristics of the source model.
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WAbstractProxyModel
WAbstractProxyModel.BaseItem
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
Constructor Summary
Constructors Constructor Description WIdentityProxyModel()
Constructor.WIdentityProxyModel(WObject parent)
Constructor. -
Method Summary
Modifier and Type Method Description int
getColumnCount(WModelIndex parent)
Returns the number of columns.WModelIndex
getIndex(int row, int column, WModelIndex parent)
Returns the child index for the given row and column.WModelIndex
getParent(WModelIndex child)
Returns the parent for a model index.int
getRowCount(WModelIndex parent)
Returns the number of rows.boolean
insertColumns(int column, int count, WModelIndex parent)
Inserts one or more columns.boolean
insertRows(int row, int count, WModelIndex parent)
Inserts one or more rows.WModelIndex
mapFromSource(WModelIndex sourceIndex)
Maps a proxy model index to the source model.WModelIndex
mapToSource(WModelIndex proxyIndex)
Maps a source model index to the proxy model.boolean
removeColumns(int column, int count, WModelIndex parent)
Removes columns.boolean
removeRows(int row, int count, WModelIndex parent)
Removes rows.boolean
setHeaderData(int section, Orientation orientation, java.lang.Object value, int role)
Set header data for a column or row.void
setSourceModel(WAbstractItemModel newSourceModel)
Sets the source model.Methods inherited from class eu.webtoolkit.jwt.WAbstractProxyModel
createSourceIndex, dropEvent, endShiftModelIndexes, fromRawIndex, getAcceptDropMimeTypes, getData, getFlags, getHeaderData, getHeaderFlags, getMimeType, getSourceModel, setData, setItemData, startShiftModelIndexes, toRawIndex
Methods inherited from class eu.webtoolkit.jwt.WAbstractItemModel
beginInsertColumns, beginInsertRows, beginRemoveColumns, beginRemoveRows, collapseColumn, columnsAboutToBeInserted, columnsAboutToBeRemoved, columnsInserted, columnsRemoved, createIndex, createIndex, dataChanged, endInsertColumns, endInsertRows, endRemoveColumns, endRemoveRows, expandColumn, getColumnCount, getData, getData, getData, getData, getHeaderData, getHeaderData, getHeaderFlags, getIndex, getItemData, getRowCount, hasChildren, hasIndex, hasIndex, headerDataChanged, insertColumn, insertColumn, insertColumns, insertRow, insertRow, insertRows, layoutAboutToBeChanged, layoutChanged, match, modelReset, removeColumn, removeColumn, removeColumns, removeRow, removeRow, removeRows, reset, rowsAboutToBeInserted, rowsAboutToBeRemoved, rowsInserted, rowsRemoved, setData, setData, setData, setData, setHeaderData, setHeaderData, sort, sort
Methods inherited from class eu.webtoolkit.jwt.WObject
addChild, getId, getObjectName, remove, setFormData, setObjectName, tr
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
WIdentityProxyModel
Constructor. -
WIdentityProxyModel
public WIdentityProxyModel()Constructor.Calls
this((WObject)null)
-
-
Method Details
-
getColumnCount
Returns the number of columns.Translates the parent index to the source model, and returns the number of columns of the source model.
- Specified by:
getColumnCount
in classWAbstractItemModel
- See Also:
WAbstractItemModel.getRowCount(WModelIndex parent)
-
getRowCount
Returns the number of rows.Translates the parent index to the source model, and returns the number of rows of the source model.
- Specified by:
getRowCount
in classWAbstractItemModel
- See Also:
WAbstractItemModel.getColumnCount(WModelIndex parent)
-
getParent
Returns the parent for a model index.Translates the child index to the source model, and translates its parent back to this proxy model.
- Specified by:
getParent
in classWAbstractItemModel
- See Also:
WAbstractItemModel.getIndex(int row, int column, WModelIndex parent)
-
getIndex
Returns the child index for the given row and column.- Specified by:
getIndex
in classWAbstractItemModel
- See Also:
WAbstractItemModel.getParent(WModelIndex index)
-
mapFromSource
Maps a proxy model index to the source model.Returns a model index with the same row and column as the source index. The parent index is mapped recursively.
- Specified by:
mapFromSource
in classWAbstractProxyModel
- See Also:
WAbstractProxyModel.mapToSource(WModelIndex proxyIndex)
-
mapToSource
Maps a source model index to the proxy model.Returns a model index with the same row and column as the proxy index. The parent index is mapped recursively.
- Specified by:
mapToSource
in classWAbstractProxyModel
- See Also:
WAbstractProxyModel.mapFromSource(WModelIndex sourceIndex)
-
setSourceModel
Sets the source model.The source model provides the actual data for the proxy model.
Ownership of the source model is not transferred.
All signals of the source model are forwarded to the proxy model.
- Overrides:
setSourceModel
in classWAbstractProxyModel
-
insertColumns
Inserts one or more columns.Inserts
count
columns at columncolumn
in the source model.Forwards the result indicating success from the source model.
- Overrides:
insertColumns
in classWAbstractProxyModel
- See Also:
WAbstractItemModel.insertRows(int row, int count, WModelIndex parent)
,WAbstractItemModel.removeColumns(int column, int count, WModelIndex parent)
,WAbstractItemModel.beginInsertColumns(WModelIndex parent, int first, int last)
,WAbstractItemModel.endInsertColumns()
-
insertRows
Inserts one or more rows.Inserts
count
rows at rowrow
in the source model.Forwards the result indicating success from the source model.
- Overrides:
insertRows
in classWAbstractItemModel
- See Also:
WAbstractItemModel.insertColumns(int column, int count, WModelIndex parent)
,WAbstractItemModel.removeRows(int row, int count, WModelIndex parent)
,WAbstractItemModel.beginInsertRows(WModelIndex parent, int first, int last)
,WAbstractItemModel.endInsertRows()
-
removeColumns
Removes columns.Removes
count
columns at columncolumn
in the source model.Forwards the result indicating success from the source model.
- Overrides:
removeColumns
in classWAbstractProxyModel
- See Also:
WAbstractItemModel.removeRows(int row, int count, WModelIndex parent)
,WAbstractItemModel.insertColumns(int column, int count, WModelIndex parent)
,WAbstractItemModel.beginRemoveColumns(WModelIndex parent, int first, int last)
,WAbstractItemModel.endRemoveColumns()
-
removeRows
Removes rows.Removes
count
rows at rowrow
in the source model.Forwards the result indicating success from the source model.
- Overrides:
removeRows
in classWAbstractItemModel
- See Also:
WAbstractItemModel.removeColumns(int column, int count, WModelIndex parent)
,WAbstractItemModel.insertRows(int row, int count, WModelIndex parent)
,WAbstractItemModel.beginRemoveRows(WModelIndex parent, int first, int last)
,WAbstractItemModel.endRemoveRows()
-
setHeaderData
public boolean setHeaderData(int section, Orientation orientation, java.lang.Object value, int role)Set header data for a column or row.Sets the header data for a column or row in the source model.
Forwards the result indicating success from the source model.
- Overrides:
setHeaderData
in classWAbstractItemModel
- See Also:
WAbstractItemModel.getHeaderData(int section, Orientation orientation, int role)
-