public class ToggleGroup
extends java.lang.Object
ToggleModel
Constructor and Description |
---|
ToggleGroup()
Creates an empty toggle group.
|
Modifier and Type | Method and Description |
---|---|
void |
addToggle(ToggleModel toggle)
Adds a toggle to the group.
|
ToggleModel |
getChecked()
Gets the button group's checked toggle, or
null if no toggle is checked. |
java.util.List<ToggleModel> |
getToggles()
Gets the toggles list.
|
void |
removeToggle(ToggleModel toggle)
Removes a toggle from the group.
|
public void addToggle(ToggleModel toggle)
If the given toggle is checked and there is already a checked toggle in the group, the new one is unchecked.
toggle
- the toggle to add to the group.java.lang.NullPointerException
- if the given toggle is null
.public void removeToggle(ToggleModel toggle)
Nothing is modified if the given toggle is null
or not in the group.
toggle
- the button to remove from the group.@Nullable public ToggleModel getChecked()
null
if no toggle is checked.public java.util.List<ToggleModel> getToggles()