Package tripleplay.ui
Class ToggleButton
- All Implemented Interfaces:
Clickable<ToggleButton>
,Togglable<ToggleButton>
public class ToggleButton
extends AbstractTextButton<ToggleButton>
implements Togglable<ToggleButton>
A toggle button that displays text, or an icon, or both. Clicking the button toggles it from
selected to unselected, and vice versa.
-
Nested Class Summary
Nested classes/interfaces inherited from class tripleplay.ui.Element
Element.Take
-
Field Summary
Fields inherited from class tripleplay.ui.AbstractTextButton
icon, text
-
Constructor Summary
ConstructorDescriptionCreates a button with no text or icon.ToggleButton
(String text) Creates a button with the supplied text.ToggleButton
(String text, Icon icon) Creates a button with the supplied text and icon.ToggleButton
(Icon icon) Creates a button with the supplied icon. -
Method Summary
Modifier and TypeMethodDescriptionvoid
click()
Programmatically triggers a click of this element.react.SignalView<ToggleButton>
clicked()
A signal that is emitted when this element is clicked.react.Value<Boolean>
selected()
A value that reflects the current selection state and is updated when said state changes.toString()
Methods inherited from class tripleplay.ui.AbstractTextButton
bindIcon, bindText, setIcon, setText
Methods inherited from class tripleplay.ui.Element
addStyles, addStyles, bindEnabled, bindVisible, bounds, constraint, enabledSlot, hierarchyChanged, isAdded, isEnabled, isShowing, isVisible, location, parent, setConstraint, setEnabled, setStyles, setStyles, setVisible, size, styles, visibleSlot, x, y
-
Constructor Details
-
ToggleButton
public ToggleButton()Creates a button with no text or icon. -
ToggleButton
Creates a button with the supplied text. -
ToggleButton
Creates a button with the supplied icon. -
ToggleButton
Creates a button with the supplied text and icon.
-
-
Method Details
-
selected
Description copied from interface:Togglable
A value that reflects the current selection state and is updated when said state changes.- Specified by:
selected
in interfaceTogglable<ToggleButton>
-
clicked
Description copied from interface:Clickable
A signal that is emitted when this element is clicked.- Specified by:
clicked
in interfaceClickable<ToggleButton>
-
click
public void click()Description copied from interface:Clickable
Programmatically triggers a click of this element.- Specified by:
click
in interfaceClickable<ToggleButton>
-
toString
-