TextFieldWidgetHelper.TextFieldBuilder
com.jsmacrosce.jsmacros.client.api.helper.screen.TextFieldWidgetHelper.TextFieldBuilder
Builds text-field widgets using the screen's font and configured dimensions.
The configured callback is attached when the widget is built.
Nested type declared in TextFieldWidgetHelper.
Constructors
new TextFieldWidgetHelper.TextFieldBuilder
Methods
action
action(MethodWrapper<String, IScreen, Object, ?> action): TextFieldWidgetHelper.TextFieldBuilderSince1.8.4#Sets the callback for accepted text changes. It receives the new text and the screen used to create this builder; it is attached when the field is built. Scripted TextFieldWidgetHelper.setText(String) changes also invoke it.
Parameters:
action: the callback for when the text is changed
Returns: self for chaining.
createWidget
createWidget(): TextFieldWidgetHelper#Creates a configured text field and helper, attaching the configured callback. The field is not added to the screen and build-time alpha, active, and visible settings are not applied until
build() is called.Returns: the helper for the newly created text field
getAction
Returns the configured text-change callback, or
null if none is set.Returns: the callback for when the text is changed.
getSuggestion
suggestion
Sets the hint drawn while the field is empty; it is not part of the field's value returned by TextFieldWidgetHelper.getText().
Parameters:
suggestion: the suggestion to use
Returns: self for chaining.