Package tripleplay.ui
Class Selector
java.lang.Object
tripleplay.ui.Selector
Maintains a single selected item among a specified set of
Element
instances. The
elements may be added individually, or the children of an Elements
may be tracked
automatically.
A click on a tracked element that implements Clickable
makes it the selected item, or
selected
can be used to manually control the selected item.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionTracks one or more elements.Tracks the children ofelements
for setting the selection.Prevent a deselection (nullselected
.get()) occurring as a result of toggling the currently selected button off.Stops tracking one or more elements.Stops tracking the children ofelements
for setting the selection.
-
Field Details
-
selected
The selected item. May be updated to set the selection manually.
-
-
Constructor Details
-
Selector
public Selector()Create a selector with a null initial selection. -
Selector
Creates a selector containing the children of elements with initialSelection selected.
-
-
Method Details
-
add
Tracks the children ofelements
for setting the selection. Children subsequently added or removed fromelements
are automatically handled appropriately. -
preventDeselection
Prevent a deselection (nullselected
.get()) occurring as a result of toggling the currently selected button off. -
remove
Stops tracking the children ofelements
for setting the selection. -
add
Tracks one or more elements. -
remove
Stops tracking one or more elements.
-