|
||||||||||
| 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.WWidget
eu.webtoolkit.jwt.WWebWidget
eu.webtoolkit.jwt.WInteractWidget
eu.webtoolkit.jwt.WFormWidget
eu.webtoolkit.jwt.WComboBox
eu.webtoolkit.jwt.WSelectionBox
public class WSelectionBox
A selection box allows selection from a list of options.
By default, a selection box may be used to let the user select one item from
a list. This may be changed to multiple selection mode using
setSelectionMode().
The current selection may be set and read using
WComboBox#setCurrentIndex() and
WComboBox#getCurrentIndex(), for
SingleSelection mode, or
setSelectedIndexes()
and getSelectedIndexes() for
SelectionMode.ExtendedSelection mode. The
WComboBox#activated() and
WComboBox#sactivated() signals are not emited
in the SelectionMode.ExtendedSelection mode, use the
WFormWidget#changed() signal
WFormWidget#changed().
WSelectionBox is an MVC view class, using a simple string list model by
default. The model may be populated using
WComboBox#addItem() or
WComboBox#insertItem() and the contents can be cleared through
WComboBox#clear(). These methods manipulate the
underlying WComboBox#getModel().
To use the selectionbox with a custom model instead of the default
WStringListModel, use
WComboBox#setModel().
WSelectionBox is an inline widget.
The widget corresponds to the HTML <select> tag and does
not provide styling. It can be styled using inline or external CSS as
appropriate.
| Constructor Summary | |
|---|---|
WSelectionBox()
Constructor. |
|
WSelectionBox(WContainerWidget parent)
Constructor. |
|
| Method Summary | |
|---|---|
void |
clearSelection()
Clears the current selection. |
java.util.Set<java.lang.Integer> |
getSelectedIndexes()
Returns the current selection (in SelectionMode.ExtendedSelection
mode). |
SelectionMode |
getSelectionMode()
Returns the selection mode. |
int |
getVerticalSize()
Sets the number of items that are visible. |
void |
setSelectedIndexes(java.util.Set<java.lang.Integer> selection)
Sets the selection (in SelectionMode.ExtendedSelection mode). |
void |
setSelectionMode(SelectionMode mode)
Sets the selection mode. |
void |
setVerticalSize(int items)
Returns the number of items that are visible. |
| Methods inherited from class eu.webtoolkit.jwt.WComboBox |
|---|
activated, addItem, clear, findText, getCount, getCurrentIndex, getCurrentText, getItemText, getModel, getValueText, insertItem, refresh, removeItem, sactivated, setCurrentIndex, setItemText, setModel, setModelColumn, setValueText |
| Methods inherited from class eu.webtoolkit.jwt.WFormWidget |
|---|
blurred, changed, enableAjax, focussed, getEmptyText, getLabel, getTabIndex, getValidator, hasFocus, isReadOnly, propagateSetEnabled, remove, render, selected, setEmptyText, setEnabled, setFocus, setFocus, setHidden, setReadOnly, setTabIndex, setValidator, validate, validated |
| Methods inherited from class eu.webtoolkit.jwt.WInteractWidget |
|---|
clicked, doubleClicked, enterPressed, escapePressed, gestureChanged, gestureEnded, gestureStarted, isEnabled, keyPressed, keyWentDown, keyWentUp, load, mouseDragged, mouseMoved, mouseWentDown, mouseWentOut, mouseWentOver, mouseWentUp, mouseWheel, setDraggable, setDraggable, setDraggable, setDraggable, touchEnded, touchMoved, touchStarted |
| Methods inherited from class eu.webtoolkit.jwt.WWidget |
|---|
acceptDrops, acceptDrops, addCssRule, addCssRule, addStyleClass, animateHide, animateShow, boxBorder, boxPadding, containsExposed, disable, dropEvent, enable, getDrop, getJsRef, getParent, hide, htmlText, isLayoutSizeAware, layoutSizeChanged, positionAt, positionAt, removeStyleClass, resize, setClearSides, setHeight, setHidden, setLayoutSizeAware, setMargin, setMargin, setMargin, setMargin, setMargin, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setToolTip, setVerticalAlignment, setWidth, show, stopAcceptDrops, toggleStyleClass, toggleStyleClass, tr |
| Methods inherited from class eu.webtoolkit.jwt.WObject |
|---|
addChild, getObjectName, setObjectName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WSelectionBox(WContainerWidget parent)
public WSelectionBox()
Calls this((WContainerWidget)null)
| Method Detail |
|---|
public int getVerticalSize()
If more items are available, a scroll-bar is provided.
public void setVerticalSize(int items)
public void setSelectionMode(SelectionMode mode)
The default selection mode is SingleSelection. You can change to
SelectionMode.ExtendedSelection to allow selection of multiple
items.
public SelectionMode getSelectionMode()
setSelectionMode(SelectionMode mode)public java.util.Set<java.lang.Integer> getSelectedIndexes()
SelectionMode.ExtendedSelection
mode).
Get the list of currently selected items. This method is only defined
when getSelectionMode() is
SelectionMode.ExtendedSelection. Otherwise, you should use
WComboBox#getCurrentIndex() to get
item currently selected.
WComboBox.getCurrentIndex()public void setSelectedIndexes(java.util.Set<java.lang.Integer> selection)
SelectionMode.ExtendedSelection mode).
For an SelectionMode.ExtendedSelection mode, set the list of
currently selected items.
getSelectedIndexes()public void clearSelection()
Clears the current selection.
WComboBox.setCurrentIndex(int index),
setSelectedIndexes(Set selection)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||