|
||||||||||
| 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.WButtonGroup
public class WButtonGroup
A class for grouping radio buttons logically together.
A button group manages a set of radio buttons, making
them exclusive of each other.
It is not a widget, but instead provides only a logical grouping. Radio
buttons are aware of the group in which they have been added, see
WRadioButton#getGroup(). When a button is
deleted, it is automatically removed its button group.
It allows you to associate id's with each button, which you may use to identify a particular button. The special value of -1 is reserved to indicate no button.
WRadioButton| Constructor Summary | |
|---|---|
WButtonGroup()
Creates a new empty button group. |
|
WButtonGroup(WObject parent)
Creates a new empty button group. |
|
| Method Summary | |
|---|---|
void |
addButton(WRadioButton button)
Adds a radio button to the group. |
void |
addButton(WRadioButton button,
int id)
Adds a radio button to the group. |
Signal1<WRadioButton> |
checkedChanged()
Signal emitted when a button was checked. |
WRadioButton |
getButton(int id)
Returns the button for the given id. |
java.util.List<WRadioButton> |
getButtons()
Returns the buttons in this group. |
WRadioButton |
getCheckedButton()
Returns the checked radiobutton. |
int |
getCheckedId()
Returns the id of the checked button. |
int |
getCount()
Returns the number of radiobuttons in this group. |
java.lang.String |
getId()
Returns the (unique) identifier for this object |
int |
getId(WRadioButton button)
Returns the id for the given button. |
int |
getSelectedButtonIndex()
Returns the index of the checked radiobutton. |
void |
removeButton(WRadioButton button)
Removes a radio button from the group. |
void |
setCheckedButton(WRadioButton button)
Sets the currently checked radiobutton. |
void |
setSelectedButtonIndex(int idx)
Sets the currently checked radiobutton. |
| Methods inherited from class eu.webtoolkit.jwt.WObject |
|---|
addChild, 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 WButtonGroup(WObject parent)
public WButtonGroup()
Calls this((WObject)null)
| Method Detail |
|---|
public void addButton(WRadioButton button,
int id)
You can assign an id to the button. If id is -1, then a
unique id will be generated.
removeButton(WRadioButton button)public final void addButton(WRadioButton button)
Calls addButton(button, -
1)
public void removeButton(WRadioButton button)
addButton(WRadioButton button, int id)public WRadioButton getButton(int id)
getId(WRadioButton button),
addButton(WRadioButton button, int id)public int getId(WRadioButton button)
getButton(int id),
addButton(WRadioButton button, int id)public java.lang.String getId()
WObject
For a WWidget, this corresponds to the id of the DOM element that represents the widget. This is not entirely
unique, since a WCompositeWidget shares the same id as its implementation.
By default, the id is auto-generated, unless a custom id is set for a widget using WWidget.setId(String). The
auto-generated id is created by concatenating WObject.getObjectName() with a unique number.
getId in class WObjectpublic java.util.List<WRadioButton> getButtons()
public int getCount()
public int getCheckedId()
Returns the id of the currently checked button, or -1 if no button is currently checked.
public void setCheckedButton(WRadioButton button)
The button button of this group is checked. A value of
null will uncheck all radiobuttons.
Initially, no button is checked.
getCheckedId()public WRadioButton getCheckedButton()
If there is no radiobutton currently checked this function returns
null.
setCheckedButton(WRadioButton button),
getSelectedButtonIndex()public void setSelectedButtonIndex(int idx)
Sets the idx'th radiobutton checked. A value of -1 will
uncheck all radiobuttons.
Initially, no button is checked.
public int getSelectedButtonIndex()
The index reflects the order in which the buttons have been added to the
button group. Use getCheckedId() if
you want to know the id of the button that is currently checked. If there
is no radiobutton selected this function returns -1.
getCheckedId()public Signal1<WRadioButton> checkedChanged()
The argument passed is the new getCheckedButton().
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||