Skip to content

CheckBoxWidgetHelper.CheckBoxBuilder ​

com.jsmacrosce.jsmacros.client.api.helper.screen.CheckBoxWidgetHelper.CheckBoxBuilder

Since1.8.4

Builder for a checkbox widget; its checked setting determines the widget's initial state.

Nested type declared in CheckBoxWidgetHelper.

Constructors ​

new CheckBoxWidgetHelper.CheckBoxBuilder ​

new CheckBoxWidgetHelper.CheckBoxBuilder(IScreen screen)#
Associates this builder with the screen to which build() adds the widget.

Parameters:

  • screen: the screen used by build() to add the widget

Methods ​

action ​

Parameters:

  • action: callback invoked when the checkbox state changes; null disables it
Returns: self for chaining.

checked ​

checked(boolean checked): CheckBoxWidgetHelper.CheckBoxBuilderSince1.8.4#
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 ​

getAction(): MethodWrapper<CheckBoxWidgetHelper, IScreen, Object, ?>Since1.8.4#
Returns: the configured change callback, or null if none is set.

isChecked ​

isChecked(): booleanSince1.8.4#
Returns whether this builder will create the checkbox initially checked.
Returns: true if the checkbox is initially checked, false otherwise.