|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.WAbstractItemDelegate
public abstract class WAbstractItemDelegate
Abstract delegate class for rendering a view item.
Rendering of an item in a WTreeView is delegated to an implementation
of this delegate class. The default implementation used by WTreeView
is WItemDelegate. To provide specialized rendering support, you can
reimplement this class, and indicate to the treeview to use this delegate for
rendering items.
As a delegate is used for rendering multiple items, the class should not keep state about one specific item.
An example of a delegate that always renders the text in a line-edit, and saves the modified value back to the (editable) model.
WAbstractItemView.setItemDelegate(WAbstractItemDelegate delegate),
WAbstractItemView.setItemDelegateForColumn(int column,
WAbstractItemDelegate delegate)| Constructor Summary | |
|---|---|
WAbstractItemDelegate()
Constructor. |
|
WAbstractItemDelegate(WObject parent)
Constructor. |
|
| Method Summary | |
|---|---|
abstract WWidget |
update(WWidget widget,
WModelIndex index,
java.util.EnumSet<ViewItemRenderFlag> flags)
Creates or updates a widget that renders an item. |
WWidget |
update(WWidget widget,
WModelIndex index,
ViewItemRenderFlag flag,
ViewItemRenderFlag... flags)
Creates or updates a widget that renders an item. |
void |
updateModelIndex(WWidget widget,
WModelIndex index)
Updates the model index of a widget. |
| Methods inherited from class eu.webtoolkit.jwt.WObject |
|---|
getId, getObjectName, remove, setObjectName, tr |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WAbstractItemDelegate(WObject parent)
public WAbstractItemDelegate()
Calls this((WObject)null)
| Method Detail |
|---|
public abstract WWidget update(WWidget widget,
WModelIndex index,
java.util.EnumSet<ViewItemRenderFlag> flags)
The item is specified by its model index, which also
indicates the model. If an existing widget already renders the item, but
needs to be updated, it is passed as the widget parameter.
You may decide to create a new widget, in which case you are responsible
to delete the previous widget if it is not reused.
When widget is null, a new widget needs to be
created.
The flags parameter indicates options for rendering the
item.
public final WWidget update(WWidget widget,
WModelIndex index,
ViewItemRenderFlag flag,
ViewItemRenderFlag... flags)
Returns update(widget, index, EnumSet.of(flag, flags))
public void updateModelIndex(WWidget widget,
WModelIndex index)
This method is invoked by the view when due to row/column insertions or removals, an index was modified for a widget.
You should reimplement this method if you are storing the model index
(e.g. for editing purposes) in the widget, which you should
update to the new index.
The default implementation does nothing.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||