public class ButtonGroup<T extends Button>
extends java.lang.Object
The canCheck(Button, boolean)
method can be overridden to control if a button check or uncheck is allowed.
Constructor and Description |
---|
ButtonGroup() |
ButtonGroup(T... buttons) |
Modifier and Type | Method and Description |
---|---|
void |
add(T... buttons) |
void |
add(T button) |
protected boolean |
canCheck(T button,
boolean newState)
Called when a button is checked or unchecked.
|
void |
clear() |
Array<T> |
getAllChecked() |
Array<T> |
getButtons() |
T |
getChecked() |
int |
getCheckedIndex() |
void |
remove(T... buttons) |
void |
remove(T button) |
void |
setChecked(java.lang.String text)
Sets the first
TextButton with the specified text to checked. |
void |
setMaxCheckCount(int maxCheckCount)
Sets the maximum number of buttons that can be checked.
|
void |
setMinCheckCount(int minCheckCount)
Sets the minimum number of buttons that must be checked.
|
void |
setUncheckLast(boolean uncheckLast)
If true, when the maximum number of buttons are checked and an additional button is checked, the last button to be checked
is unchecked so that the maximum is not exceeded.
|
void |
uncheckAll()
Sets all buttons'
Button.isChecked() to false, regardless of setMinCheckCount(int) . |
public ButtonGroup()
public ButtonGroup(T... buttons)
public void add(T button)
public void add(T... buttons)
public void remove(T button)
public void remove(T... buttons)
public void clear()
public void setChecked(java.lang.String text)
TextButton
with the specified text to checked.protected boolean canCheck(T button, boolean newState)
public void uncheckAll()
Button.isChecked()
to false, regardless of setMinCheckCount(int)
.public int getCheckedIndex()
public void setMinCheckCount(int minCheckCount)
public void setMaxCheckCount(int maxCheckCount)
public void setUncheckLast(boolean uncheckLast)