LockButtonWidgetHelper.LockButtonBuilder
com.jsmacrosce.jsmacros.client.api.helper.screen.LockButtonWidgetHelper.LockButtonBuilder
Builder for a lock button bound to its screen. It starts unlocked unless the boolean overload of IScreen.lockButtonBuilder() specifies otherwise.
Nested type declared in LockButtonWidgetHelper.
Constructors
new LockButtonWidgetHelper.LockButtonBuilder
Methods
action
action(MethodWrapper<LockButtonWidgetHelper, IScreen, Object, ?> action): LockButtonWidgetHelper.LockButtonBuilderSince1.8.4#Parameters:
action: callback invoked when the button is pressed;nulldisables it
Returns: self for chaining.
createWidget
createWidget(): LockButtonWidgetHelper#Creates the lock-button helper using the configured position, z-index, and initial locked state. If an action is configured, it receives this helper and the associated screen; exceptions are logged. The callback then marks the next release to be skipped only for container screens. This method does not add the widget to the screen or apply the builder's label, size, alpha, active, or visible settings;
build() performs the addition and applies alpha, active, and visible settings.Returns: the helper for the newly created lock button
getAction
Returns: the configured callback, or
null if none is set.isLocked
Returns the initial locked state configured for this builder. The default is unlocked; this does not track the button after it is built.
Returns: the initial state of the lock button.
locked
Sets the button's initial locked state; it does not constrain later changes.
Parameters:
locked: whether to initially lock the button or not
Returns: self for chaining.