|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.webtoolkit.jwt.WModelIndex
public class WModelIndex
An index to a data item in a data model.
Indexes are used to indicate a particular item in a WAbstractItemModel. An index points to the item by
identifying its row and column location within a parent model index. Indexes are immutable.
The null index identifies the parent of top level indexes. Thus, a model that specifies only a list or
table of data (but no hierarchical data) would have as indexes only indexes that specify the null as
parent.
Valid indexes are created by the model, within the protected WAbstractItemModel.createIndex(int, int, Object)
method. In this way, models can define an internal pointer or suitable for identifying items in the model.
WAbstractItemModel| Method Summary | |
|---|---|
int |
compareTo(WModelIndex i2)
Implements Comparable.compareTo(Object). |
WModelIndex |
decodeFromRawIndex()
Decodes a raw index (after a layout change). |
static java.util.SortedSet<WModelIndex> |
decodeFromRawIndexes(java.util.SortedSet<WModelIndex> encodedIndexes)
Utility method to decode an entire set of raw indexes. |
void |
encodeAsRawIndex()
Encodes to raw index (before a layout change). |
static void |
encodeAsRawIndexes(java.util.SortedSet<WModelIndex> indexes)
Utility method for converting an entire set of indexes to raw. |
boolean |
equals(java.lang.Object other)
Indicates whether some other object is "equal to" this one. |
WModelIndex |
getChild(int row,
int column)
Returns a model index for a child item. |
int |
getColumn()
Returns the column. |
java.lang.Object |
getData()
Returns the data in the model associated at this index. |
java.lang.Object |
getData(int role)
Returns the data in the model associated at this index. |
java.util.EnumSet<ItemFlag> |
getFlags()
Returns the item flags for the item at this index. |
java.lang.Object |
getInternalPointer()
Returns the internal pointer. |
WAbstractItemModel |
getModel()
Returns the model. |
WModelIndex |
getParent()
Returns the parent index. |
int |
getRow()
Returns the row. |
int |
hashCode()
Returns a hash code value for the object. |
static boolean |
isAncestor(WModelIndex i1,
WModelIndex i2)
Returns whether i2 is an ancestor of i1. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public WModelIndex getParent()
null if the index is a top-level index.public int getRow()
public int getColumn()
public java.lang.Object getInternalPointer()
The internal pointer is used by a specific model implementation to uniquely identify (in conjunction with getRow() and getColumn())
the item to which this index points.
Usually the internal pointer therefore identifies the parent for hierarchical models, or is simply null for tabular models.
public WAbstractItemModel getModel()
public java.lang.Object getData(int role)
WAbstractItemModel.getData(WModelIndex, int).
role - the ItemDataRole role.
null if no data was available for this role.public java.lang.Object getData()
getData(ItemDataRole.DisplayRole).
public WModelIndex getChild(int row,
int column)
This is a convenience method for WAbstractItemModel.getIndex(int, int, WModelIndex).
public boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic int compareTo(WModelIndex i2)
Comparable.compareTo(Object).
Creates a topological ordering of model indexes.
The topological order follows the order in which the indexes would be displayed in a tree table view, from top to bottom followed by left to right.
compareTo in interface java.lang.Comparable<WModelIndex>public java.util.EnumSet<ItemFlag> getFlags()
WAbstractItemModel.getFlags(WModelIndex).
public void encodeAsRawIndex()
WAbstractItemModel.toRawIndex(WModelIndex),
WAbstractItemModel.layoutAboutToBeChanged(),
decodeFromRawIndex()public WModelIndex decodeFromRawIndex()
null if the underlying model did not
support encoding to raw indexes, or, if the item to which the index previously pointed, is no longer part of the
model.
WAbstractItemModel.fromRawIndex(Object),
WAbstractItemModel.layoutChanged(),
encodeAsRawIndex()public static void encodeAsRawIndexes(java.util.SortedSet<WModelIndex> indexes)
indexes - encodeAsRawIndex()public static java.util.SortedSet<WModelIndex> decodeFromRawIndexes(java.util.SortedSet<WModelIndex> encodedIndexes)
decodeFromRawIndex()
public static boolean isAncestor(WModelIndex i1,
WModelIndex i2)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||