CheckBoxWidgetHelper.CheckBoxBuilder
com.jsmacrosce.jsmacros.client.api.helper.screen.CheckBoxWidgetHelper.CheckBoxBuilder
Builder for a checkbox widget; its checked setting determines the widget's initial state.
Nested type declared in CheckBoxWidgetHelper.
Constructors
new CheckBoxWidgetHelper.CheckBoxBuilder
Methods
action
action(MethodWrapper<CheckBoxWidgetHelper, IScreen, Object, ?> action): CheckBoxWidgetHelper.CheckBoxBuilderSince1.8.4#Parameters:
action: callback invoked when the checkbox state changes;nulldisables it
Returns: self for chaining.
checked
Sets the checkbox's initial checked state; it does not constrain later changes.
Parameters:
checked: whether the checkbox is initially checked or not
Returns: self for chaining.
createWidget
createWidget(): CheckBoxWidgetHelper#Creates a checkbox from the configured label, position, checked state, dimensions, and z-index, and connects its value-change callback. The callback forwards the helper and associated screen to the configured action, logging caught exceptions. This does not add the widget to the screen or apply
build()'s alpha, active, and visible flags.Returns: a helper for the newly created checkbox
getAction
Returns: the configured change callback, or
null if none is set.isChecked
Returns whether this builder will create the checkbox initially checked.
Returns:
true if the checkbox is initially checked, false otherwise.