Class WIdentityProxyModel
- java.lang.Object
-
- eu.webtoolkit.jwt.WObject
-
- eu.webtoolkit.jwt.WAbstractItemModel
-
- eu.webtoolkit.jwt.WAbstractProxyModel
-
- eu.webtoolkit.jwt.WIdentityProxyModel
-
public class WIdentityProxyModel extends WAbstractProxyModel
A proxy model that proxies its source model unmodified.A
WIdentityProxyModelsimply forwards the structure of the source model, without any transformation.WIdentityProxyModelcan be used as a base class for implementing proxy models that reimplement data(), 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetColumnCount(WModelIndex parent)Returns the number of columns.WModelIndexgetIndex(int row, int column, WModelIndex parent)Returns the child index for the given row and column.WModelIndexgetParent(WModelIndex child)Returns the parent for a model index.intgetRowCount(WModelIndex parent)Returns the number of rows.booleaninsertColumns(int column, int count, WModelIndex parent)Inserts one or more columns.booleaninsertRows(int row, int count, WModelIndex parent)Inserts one or more rows.WModelIndexmapFromSource(WModelIndex sourceIndex)Maps a proxy model index to the source model.WModelIndexmapToSource(WModelIndex proxyIndex)Maps a source model index to the proxy model.booleanremoveColumns(int column, int count, WModelIndex parent)Removes columns.booleanremoveRows(int row, int count, WModelIndex parent)Removes rows.booleansetHeaderData(int section, Orientation orientation, java.lang.Object value, ItemDataRole role)Set header data for a column or row.voidsetSourceModel(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, copyData, createIndex, createIndex, dataChanged, dropEvent, 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
getId, getObjectName, remove, setFormData, setObjectName, tr
-
-
-
-
Method Detail
-
getColumnCount
public int getColumnCount(WModelIndex parent)
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:
getColumnCountin classWAbstractItemModel- See Also:
WAbstractItemModel.getRowCount(WModelIndex parent)
-
getRowCount
public int getRowCount(WModelIndex parent)
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:
getRowCountin classWAbstractItemModel- See Also:
WAbstractItemModel.getColumnCount(WModelIndex parent)
-
getParent
public WModelIndex getParent(WModelIndex child)
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:
getParentin classWAbstractItemModel- See Also:
WAbstractItemModel.getIndex(int row, int column, WModelIndex parent)
-
getIndex
public WModelIndex getIndex(int row, int column, WModelIndex parent)
Returns the child index for the given row and column.- Specified by:
getIndexin classWAbstractItemModel- See Also:
WAbstractItemModel.getParent(WModelIndex index)
-
mapFromSource
public WModelIndex mapFromSource(WModelIndex sourceIndex)
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:
mapFromSourcein classWAbstractProxyModel- See Also:
WAbstractProxyModel.mapToSource(WModelIndex proxyIndex)
-
mapToSource
public WModelIndex mapToSource(WModelIndex proxyIndex)
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:
mapToSourcein classWAbstractProxyModel- See Also:
WAbstractProxyModel.mapFromSource(WModelIndex sourceIndex)
-
setSourceModel
public void setSourceModel(WAbstractItemModel newSourceModel)
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:
setSourceModelin classWAbstractProxyModel
-
insertColumns
public boolean insertColumns(int column, int count, WModelIndex parent)Inserts one or more columns.Inserts
countcolumns at columncolumnin the source model.Forwards the result indicating success from the source model.
- Overrides:
insertColumnsin classWAbstractProxyModel- See Also:
WAbstractItemModel.insertRows(int column, int count, WModelIndex parent),WAbstractItemModel.removeColumns(int column, int count, WModelIndex parent),WAbstractItemModel.beginInsertColumns(WModelIndex parent, int first, int last),WAbstractItemModel.endInsertColumns()
-
insertRows
public boolean insertRows(int row, int count, WModelIndex parent)Inserts one or more rows.Inserts
countrows at rowrowin the source model.Forwards the result indicating success from the source model.
- Overrides:
insertRowsin classWAbstractItemModel- See Also:
WAbstractItemModel.insertColumns(int column, int count, WModelIndex parent),WAbstractItemModel.removeRows(int column, int count, WModelIndex parent),WAbstractItemModel.beginInsertRows(WModelIndex parent, int first, int last),WAbstractItemModel.endInsertRows()
-
removeColumns
public boolean removeColumns(int column, int count, WModelIndex parent)Removes columns.Removes
countcolumns at columncolumnin the source model.Forwards the result indicating success from the source model.
- Overrides:
removeColumnsin classWAbstractProxyModel- See Also:
WAbstractItemModel.removeRows(int column, int count, WModelIndex parent),WAbstractItemModel.insertColumns(int column, int count, WModelIndex parent),WAbstractItemModel.beginRemoveColumns(WModelIndex parent, int first, int last),WAbstractItemModel.endRemoveColumns()
-
removeRows
public boolean removeRows(int row, int count, WModelIndex parent)Removes rows.Removes
countrows at rowrowin the source model.Forwards the result indicating success from the source model.
- Overrides:
removeRowsin classWAbstractItemModel- See Also:
WAbstractItemModel.removeColumns(int column, int count, WModelIndex parent),WAbstractItemModel.insertRows(int column, 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, ItemDataRole 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:
setHeaderDatain classWAbstractItemModel- See Also:
WAbstractItemModel.getHeaderData(int section, Orientation orientation, ItemDataRole role)
-
-