Package eu.webtoolkit.jwt
Class WReadOnlyProxyModel
java.lang.Object
eu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.WAbstractItemModel
eu.webtoolkit.jwt.WAbstractProxyModel
eu.webtoolkit.jwt.WReadOnlyProxyModel
public class WReadOnlyProxyModel extends WAbstractProxyModel
A read-only wrapper for a source model.
This is a simple proxy model which provides a read-only view on a source model. This is convenient for situations where you want to share a common read-only source model between different sessions.
-
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 WReadOnlyProxyModel()
Constructor.WReadOnlyProxyModel(WObject parent)
Constructor. -
Method Summary
Modifier and Type Method Description void
dropEvent(WDropEvent e, DropAction action, int row, int column, WModelIndex parent)
Has no effect.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 index)
Returns the parent for a model index.int
getRowCount(WModelIndex parent)
Returns the number of rows.boolean
insertColumns(int column, int count, WModelIndex parent)
Always returnsfalse
and has no effect.WModelIndex
mapFromSource(WModelIndex sourceIndex)
Maps a source model index to the proxy model.WModelIndex
mapToSource(WModelIndex proxyIndex)
Maps a proxy model index to the source model.boolean
removeColumns(int column, int count, WModelIndex parent)
Always returnsfalse
and has no effect.boolean
setData(WModelIndex index, java.lang.Object value, int role)
Always returnsfalse
and has no effect.boolean
setHeaderData(int section, Orientation orientation, java.lang.Object value, int role)
Always returnsfalse
and has no effect.boolean
setItemData(WModelIndex index, java.util.SortedMap<java.lang.Integer,java.lang.Object> values)
Always returnsfalse
and has no effect.Methods inherited from class eu.webtoolkit.jwt.WAbstractProxyModel
createSourceIndex, endShiftModelIndexes, fromRawIndex, getAcceptDropMimeTypes, getData, getFlags, getHeaderData, getHeaderFlags, getMimeType, getSourceModel, setSourceModel, 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, insertRows, layoutAboutToBeChanged, layoutChanged, match, modelReset, removeColumn, removeColumn, removeColumns, removeRow, removeRow, removeRows, 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
-
WReadOnlyProxyModel
Constructor. -
WReadOnlyProxyModel
public WReadOnlyProxyModel()Constructor.Calls
this((WObject)null)
-
-
Method Details
-
mapFromSource
Maps a source model index to the proxy model.Returns the sourceIndex unmodified.
- Specified by:
mapFromSource
in classWAbstractProxyModel
- See Also:
WAbstractProxyModel.mapToSource(WModelIndex proxyIndex)
-
mapToSource
Maps a proxy model index to the source model.Returns the proxyIndex unmodified.
- Specified by:
mapToSource
in classWAbstractProxyModel
- See Also:
WAbstractProxyModel.mapFromSource(WModelIndex sourceIndex)
-
getColumnCount
Returns the number of columns.This returns the column count of the source model.
- Specified by:
getColumnCount
in classWAbstractItemModel
- See Also:
WAbstractItemModel.getRowCount(WModelIndex parent)
-
getRowCount
Returns the number of rows.This returns the row count of the source model.
- Specified by:
getRowCount
in classWAbstractItemModel
- See Also:
WAbstractItemModel.getColumnCount(WModelIndex parent)
-
getParent
Returns the parent for a model index.Returns the parent of the given index in the source 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.Returns the index in the source model.
- Specified by:
getIndex
in classWAbstractItemModel
- See Also:
WAbstractItemModel.getParent(WModelIndex index)
-
setData
Always returnsfalse
and has no effect.- Overrides:
setData
in classWAbstractProxyModel
- See Also:
WAbstractItemModel.getData(WModelIndex index, int role)
-
setItemData
public boolean setItemData(WModelIndex index, java.util.SortedMap<java.lang.Integer,java.lang.Object> values)Always returnsfalse
and has no effect.- Overrides:
setItemData
in classWAbstractProxyModel
- See Also:
WAbstractItemModel.setData(WModelIndex index, Object value, int role)
-
setHeaderData
public boolean setHeaderData(int section, Orientation orientation, java.lang.Object value, int role)Always returnsfalse
and has no effect.- Overrides:
setHeaderData
in classWAbstractItemModel
- See Also:
WAbstractItemModel.getHeaderData(int section, Orientation orientation, int role)
-
insertColumns
Always returnsfalse
and has no effect.- 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()
-
removeColumns
Always returnsfalse
and has no effect.- 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()
-
dropEvent
Has no effect.- Overrides:
dropEvent
in classWAbstractProxyModel
- See Also:
WAbstractItemModel.getMimeType()
,WItemSelectionModel
-