1. Domino UI
  2. Forms
  3. Overview

Forms overview

In this overview, we aim to outline the various built-in form elements offered by Domino-ui. We'll illustrate the hierarchical relationship between these elements and offer a concise insight into each component.

forms-fields-diagram
  • AbstractFormElement

    An abstract base class for form elements in the Domino UI framework.

    AbstractFormElement provides common functionality for form elements, including validation, error handling, labeling, and more. It can be extended to create specific form elements with custom behavior.

    Usage Example:

     
     // Create a custom form element by extending AbstractFormElement
     public class MyCustomFormElement extends AbstractFormElement< MyCustomFormElement, String>  {
    
         public MyCustomFormElement() {
             // Initialize and configure the form element
             // ...
         }
    
         // Implement any additional methods and behaviors specific to your custom form element
         // ...
     }
     

    T

    The concrete form element type.

    V

    The type of the form element's value.

    See also :

    • AbstractSuggestBox

      An abstract base class for suggest box elements that provides common functionality and UI components.

      This class allows the creation of suggest boxes for selecting options from a list of suggestions. It provides features like auto-suggest, delayed text input, and a drop-down menu for selecting options.

      Usage Example:

       
       // Create a suggest box with a custom SuggestionsStore
       SuggestionsStore< MyData, IsElement< ?>> suggestionsStore = createCustomSuggestionsStore();
       MySuggestBox suggestBox = new MySuggestBox(suggestionsStore);
       suggestBox.setPlaceholder("Search..."); suggestBox.setAutoSelect(true);
       suggestBox.setTypeAheadDelay(500); suggestBox.addSelectionListener(selectedOption -> { MyData
       selectedData = selectedOption.getValue(); // Handle the selected data });
       

      T

      The data type of the suggest options.

      V

      The value type of the suggest box.

      E

      The type of the suggest box's element, usually an IsElement .

      O

      The type of options that can be selected in the suggest box.

      C

      The concrete suggest box implementation type.

      • MultiSuggestBox

        A multi-select suggestion box that allows users to select multiple options from a list of suggestions.

        V

        The type of data associated with the selected options.

        E

        The type of the suggest box's element.

        O

        The type of the option within the suggest box.

      • SuggestBox

        A single-select suggestion box that allows users to select an option from a list of suggestions.

        V

        The type of data associated with the selected option.

        E

        The type of the suggest box's element.

        O

        The type of the option within the suggest box.

      • TagBox

        A versatile input field that allows users to select multiple tags from a list of suggestions.

        V

        The type of data associated with the selected tags.

    • AbstractSelect

      Represents an abstract select form element which can be used as a base for building dropdown selectors. This abstract class encapsulates common behavior and rendering logic shared by various select components.

      Usage:

       
       // Create a concrete class extending AbstractSelect
       public class MySelect extends AbstractSelect< MyType, String, MyElement, MyOption, MySelect> {
            // implementation details...
       }
       MySelect select = new MySelect();
      
       

      T

      The type of the model.

      V

      The type of the value to be selected.

      E

      The type of the element.

      O

      The type of the option.

      C

      The type of the concrete class extending this abstract class.

      • MultiSelect

        Represents a multi-selection dropdown menu UI component, allowing users to select multiple options.

        Usage example:

         
         MultiSelect< String>  multiSelect = MultiSelect.create("Select Items");
         multiSelect.withValue("Option1", "Option2");
         

        V

        the type of the value represented by each selectable option

        See also :

      • Select

        Represents a dropdown select control allowing the user to choose a single option from a list.

        Usage example:

         
         Select< String>  fruitSelect = Select.create("Choose a fruit");
         fruitSelect.withOption(new SelectOption<> ("Apple"), false);
         fruitSelect.withOption(new SelectOption<> ("Banana"), false);
         

        V

        The type of value associated with each select option.

        See also :

    • InputFormField

      An abstract base class for input form fields in Domino UI. InputFormField represents form fields that accept user input through an HTML input element.

      T

      The concrete type of the InputFormField.

      E

      The type of the HTML input element.

      V

      The type of the input field's value.

      See also :

      • CountableInputFormField

        The CountableInputFormField class is an abstract class that extends the InputFormField class and provides functionality for input fields with character counters, minimum and maximum lengths, and placeholders.

        Usage Example:

         
         // Create a CountableInputFormField for text input
         CountableInputFormField< TextBox, HTMLInputElement, String>  inputField =
             new TextBox()
                 .setPlaceholder("Enter text")
                 .setMaxLength(100)
                 .setMinLength(5)
                 .withCounterElement();
        
         // Set a custom count formatter
         inputField.setCountFormatter((count, maxCount) ->  count + " / " + maxCount);
         

        T

        The type of the implementing subclass.

        E

        The type of the HTML element.

        V

        The type of the field's value.

        • TextInputFormField

          The TextInputFormField class is an abstract class that extends the CountableInputFormField class and provides functionality for text input fields, including prefixes, postfixes, and pattern validation.

          Usage Example:

           
           // Create a TextInputFormField for text input
           TextInputFormField< TextBox, HTMLInputElement, String>  inputField =
               new TextBox()
                   .setPlaceholder("Enter text")
                   .setPattern("[A-Za-z0-9]+", "Only alphanumeric characters are allowed.")
                   .withPrefixElement()
                   .setPrefix("Prefix: ")
                   .withPostfixElement()
                   .setPostfix("Postfix");
           

          T

          The type of the implementing subclass.

          E

          The type of the HTML element.

          V

          The type of the field's value.

          • BaseTextBox

            Represents a base text box component that provides foundational behaviors and attributes for text input form fields.

            Usage example:

             
             BaseTextBox< ?>  boxWithoutLabel = new BaseTextBox<> ();
             BaseTextBox< ?>  boxWithLabel = new BaseTextBox<> ("Input Label:");
             

            T

            the type of the implementing class, used for method chaining

            See also :

            • EmailBox

              Represents an email input form field with optional data list support for autocompletion. This class extends from BaseTextBox and implements the HasInputDataList interface.

              Usage example:

               
               EmailBox defaultEmailBox = new EmailBox();
               EmailBox labeledEmailBox = new EmailBox("Enter your email:");
               

              See also :

            • TextBox

              Represents a text input form field. This class extends from BaseTextBox and provides a simple way to handle text input.

              Usage example:

               
               TextBox defaultTextBox = new TextBox();
               TextBox labeledTextBox = new TextBox("Enter some text:");
               

              See also :

            • PasswordBox

              Represents a password input form field. This class extends from BaseTextBox and is specifically tailored for password input.

              Usage example:

               
               PasswordBox defaultPasswordBox = PasswordBox.create();
               PasswordBox labeledPasswordBox = PasswordBox.create("Enter your password:");
               

              See also :

          • CustomInputBox

            Represents a customizable input box that can be associated with a list of pre-defined options.

            Usage example:

             
             CustomInputBox customInput = new CustomInputBox("Label");
             customInput.setType("text");
             

            T

            the type of the derived class, used for method chaining

            • TelephoneBox

              Represents a telephone input box that accepts telephone numbers.

              Usage example:

               
               TelephoneBox boxWithoutLabel = TelephoneBox.create();
               TelephoneBox boxWithLabel = TelephoneBox.create("Phone Number:");
               

              See also :

          • DateBox

            DateBox is a custom form field for date input with various configuration options. It utilizes a popover with a calendar picker for selecting dates.

            Usage example:

             
             DateBox dateBox = DateBox.create("Birth date);
             
          • TimeBox

            Represents a time input form field with the capability to pick a time.

            Usage example:

             
             TimeBox defaultTimeBox = TimeBox.create();
             TimeBox labeledTimeBox = TimeBox.create("Choose a time:");
             

            See also :

        • TextAreaBox

          The TextAreaBox class is a form field component for text areas, providing features such as prefix and postfix elements, auto-sizing, and value adjustments.

          Usage Example:

           
           // Create a TextAreaBox with auto-sizing
           TextAreaBox textArea = TextAreaBox.create().autoSize().setRows(4);
          
           // Create a TextAreaBox with a label
           TextAreaBox labeledTextArea = TextAreaBox.create("Comments");
           

          See also :

      • CheckBox

        Represents a checkbox input field that allows users to select or deselect an option.

        Example usage:

         
         CheckBox checkBox = CheckBox.create("Enable feature")
              .setChecked(true)
              .onChange(value -> DomGlobal.console.log("Checkbox state changed: " + value));
         

        See also :

      • NumberBox

        An abstract representation of a number input field with various customizations such as min/max values, prefix/postfix elements, and input validation.

        Usage example:

         
         NumberBox< Double, Double> ageBox = new NumberBox< >("Age");
         ageBox.setMinValue(0.0);
         ageBox.setMaxValue(150.0);
         

        T

        Concrete type of the NumberBox

        V

        Value type (Number subclass) that this NumberBox supports

        • LongBox

          A specialized NumberBox for handling long integer values.
        • IntegerBox

          A specialized NumberBox for handling integer values.
        • DoubleBox

          A specialized NumberBox for handling double-precision floating point values.
        • ShortBox

          A specialized NumberBox for handling short integer values.
        • FloatBox

          A specialized NumberBox for handling floating-point values.
        • BigDecimalBox

          A specialized NumberBox for handling arbitrary-precision decimal values. This box allows for input and representation of BigDecimal values.
      • SwitchButton

        A customizable SwitchButton component.

        This component provides a switchable button that can be toggled between ON and OFF states.

         
         Usage:
         SwitchButton button = SwitchButton.create("Label", "Off", "On");
         

        See also :

      • UploadBox

        The UploadBox class represents an input field for uploading files. It extends the InputFormField class and provides the ability to select and display uploaded files.

        Usage Example:

         
         // Create an UploadBox with a label
         UploadBox uploadBox = UploadBox.create("Choose Files:");
        
         // Set the accepted file types (e.g., images)
         uploadBox.setAccepts("image/*");
        
         // Enable multiple file selection
         uploadBox.setMultiple(true);
        
         // Add a change listener to handle file selection changes
         uploadBox.addChangeHandler(event -> {
             List  selectedFiles = event.getTarget().getValue();
             // Handle the selected files
         });
         
    • RadioGroup

      Represents a group of radio buttons, ensuring that only one radio button in the group can be selected at a time.

      This implementation guarantees that radio buttons belonging to the same group have the same name attribute. It provides an API for managing the radio buttons as a group and ensures that selecting one radio deselects others in the same group.

      T

      The type of the value associated with the radio buttons in the group.

API Docs: AbstractFormElement

Constructors

public void AbstractFormElement()
Creates a new instance of AbstractFormElement.

Public methods

public HTMLFieldSetElement element()
Returns the HTML representation of this form element.

Returns:

The HTML fieldset element representing the form element.

public T labelForId(String id)
Sets the "for" attribute of the label element to associate it with an HTML element by its ID.

id

The ID of the HTML element to associate with the label.



Returns:

This form element instance.

public T groupBy(FieldsGrouping fieldsGrouping)
Groups this form element with a FieldsGrouping instance.

fieldsGrouping

The FieldsGrouping instance to group this form element with.



Returns:

This form element instance.

public T ungroup(FieldsGrouping fieldsGrouping)
Ungroups this form element from a FieldsGrouping instance.

fieldsGrouping

The FieldsGrouping instance to ungroup this form element from.



Returns:

This form element instance.

public T appendChild(PrefixAddOn<?> addon)
Appends a prefix add-on to the form element.

addon

The prefix add-on to append.



Returns:

This form element instance.

public T appendChild(PostfixAddOn<?> addon)
Appends a postfix add-on to the form element.

addon

The postfix add-on to append.



Returns:

This form element instance.

public T setAutoValidation(boolean autoValidation)
Sets whether auto-validation is enabled for this form element.

autoValidation

True to enable auto-validation, false to disable it.



Returns:

This form element instance.

public boolean isAutoValidation()
Checks if auto-validation is enabled for this form element.

Returns:

True if auto-validation is enabled, false otherwise.

public T autoValidate()
Performs auto-validation on this form element.

Returns:

This form element instance.

public T pauseValidations()
Pauses form element validations.

Returns:

This form element instance.

public T resumeValidations()
Resumes form element validations.

Returns:

This form element instance.

public boolean isValidationsPaused()
Checks if form element validations are paused.

Returns:

True if validations are paused, false otherwise.

public T togglePauseValidations(boolean toggle)
Toggles pause state for form element validations.

toggle

True to pause validations, false to resume them.



Returns:

This form element instance.

public T pauseFocusValidations()
Pauses focus-based form element validations.

Returns:

This form element instance.

public T resumeFocusValidations()
Resumes focus-based form element validations.

Returns:

This form element instance.

public T togglePauseFocusValidations(boolean toggle)
Toggles pause state for focus-based form element validations.

toggle

True to pause focus validations, false to resume them.



Returns:

This form element instance.

public boolean isFocusValidationsPaused()
Checks if focus-based form element validations are paused.

Returns:

True if focus validations are paused, false otherwise.

public T setHelperText(String helperText)
Sets the helper text for this form element.

helperText

The helper text to set.



Returns:

This form element instance.

public String getHelperText()
Gets the helper text of this form element.

Returns:

The helper text of this form element.

public T setLabel(String label)
Sets the label for this form element.

label

The label to set.



Returns:

This form element instance.

public String getLabel()
Gets the label of this form element.

Returns:

The label of this form element.

public T setLabelFloatLeft(boolean floatLeft)
Sets whether the label should float to the left when a value is entered.

floatLeft

True to make the label float to the left, false otherwise.



Returns:

This form element instance.

public ValidationResult validate(T formElement)
Validates this form element and returns the validation result.

formElement

The form element to validate.



Returns:

The validation result.

public Set<Validator<T>> getValidators()
Gets the set of validators associated with this form element.

Returns:

The set of validators.

public T invalidate(String errorMessage)
Invalidates this form element with a custom error message.

errorMessage

The error message to display.



Returns:

This form element instance.

public T invalidate(List<String> errorMessages)
Invalidates this form element with a list of custom error messages.

errorMessages

The list of error messages to display.



Returns:

This form element instance.

public List<String> getErrors()
Gets the list of error messages associated with this form element.

Returns:

The list of error messages.

public T clearInvalid()
Clears any invalid state and error messages from this form element.

Returns:

This form element instance.

public T setRequired(boolean required)
Sets whether this form element is required.

required

True to make this form element required, false otherwise.



Returns:

This form element instance.

public T setShowRequiredIndicator(boolean state)
Sets whether to show the required indicator for this form element.

state

True to show the required indicator, false to hide it.



Returns:

This form element instance.

public boolean isShowRequiredIndicator()
Checks if the required indicator should be shown for this form element.

Returns:

True if the required indicator is shown, false otherwise.

public T setRequired(boolean required, String message)
Sets whether this form element is required and provides a custom error message for the required validation.

required

True to make this form element required, false otherwise.

message

The custom error message to display when the field is required.



Returns:

This form element instance.

public boolean isRequired()
Checks if this form element is required.

Returns:

True if this form element is required, false otherwise.

public T setRequiredErrorMessage(String requiredErrorMessage)
Sets the error message to display when this form element is required but not filled.

requiredErrorMessage

The required error message.



Returns:

This form element instance.

public String getRequiredErrorMessage()
Gets the error message to display when this form element is required but not filled.

Returns:

The required error message.

public void showErrors(List<EditorError> errors)
Displays errors associated with this form element based on a list of EditorError instances.

errors

The list of EditorError instances.

public T fixErrorsPosition(boolean fixErrorsPosition)
Sets whether error messages should be fixed in position.

fixErrorsPosition

True to fix error messages in position, false otherwise.



Returns:

This form element instance.

public T pauseChangeListeners()
Pauses change listeners for this form element.

Returns:

This form element instance.

public T resumeChangeListeners()
Resumes change listeners for this form element.

Returns:

This form element instance.

public Set<ChangeListener<? super V>> getChangeListeners()
Gets the set of change listeners associated with this form element.

Returns:

The set of change listeners.

public boolean isChangeListenersPaused()
Checks if change listeners for this form element are paused.

Returns:

True if change listeners are paused, false otherwise.

public T togglePauseChangeListeners(boolean toggle)
Toggles pause state for change listeners for this form element.

toggle

True to pause change listeners, false to resume them.



Returns:

This form element instance.

public T pauseClearListeners()
Pauses clear listeners for this form element.

Returns:

This form element instance.

public T resumeClearListeners()
Resumes clear listeners for this form element.

Returns:

This form element instance.

public T togglePauseClearListeners(boolean toggle)
Toggles pause state for clear listeners for this form element.

toggle

True to pause clear listeners, false to resume them.



Returns:

This form element instance.

public Set<ClearListener<? super V>> getClearListeners()
Gets the set of clear listeners associated with this form element.

Returns:

The set of clear listeners.

public boolean isClearListenersPaused()
Checks if clear listeners for this form element are paused.

Returns:

True if clear listeners are paused, false otherwise.

public T setEmptyAsNull(boolean emptyAsNull)
Sets whether empty values should be treated as null values.

emptyAsNull

True to treat empty values as null, false otherwise.



Returns:

This form element instance.

public boolean isEmptyAsNull()
Checks if empty values are treated as null values.

Returns:

True if empty values are treated as null, false otherwise.

public T setDefaultValue(V defaultValue)
Sets the default value for this form element.

defaultValue

The default value to set.



Returns:

This form element instance.

public V getDefaultValue()
Gets the default value for this form element.

Returns:

The default value.

public DivElement getBodyElement()
Gets the body element of this form element.

Returns:

The body element.

public LabelElement getLabelElement()
Gets the label element of this form element.

Returns:

The label element.

public DivElement getWrapperElement()
Gets the wrapper element of this form element.

Returns:

The wrapper element.

public DivElement getMessagesWrapperElement()
Gets the messages wrapper element of this form element.

Returns:

The messages wrapper element.

public SpanElement getHelperTextElement()
Gets the helper text element of this form element.

Returns:

The helper text element.

public T withBody(ChildHandler<T, DivElement> handler)
Applies a custom child handler to the body element of this form element.

handler

The child handler to apply.



Returns:

This form element instance.

public T withLabel()
Initializes and retrieves the label element associated with this form element. Use this method when you want to customize or manipulate the label element.

Returns:

This form element instance.

public T withLabel(ChildHandler<T, LabelElement> handler)
Applies a custom child handler to the label element of this form element.

handler

The child handler to apply.



Returns:

This form element instance.

public T withWrapper(ChildHandler<T, DivElement> handler)
Applies a custom child handler to the wrapper element of this form element.

handler

The child handler to apply.



Returns:

This form element instance.

public T withMessagesWrapper()
Initializes and retrieves the messages wrapper element associated with this form element. Use this method when you want to customize or manipulate the messages wrapper element.

Returns:

This form element instance.

public T withMessagesWrapper(ChildHandler<T, DivElement> handler)
Applies a custom child handler to the messages wrapper element of this form element.

handler

The child handler to apply.



Returns:

This form element instance.

public T withHelperText()
Initializes and retrieves the helper text element associated with this form element. Use this method when you want to customize or manipulate the helper text element.

Returns:

This form element instance.

public T withHelperText(ChildHandler<T, SpanElement> handler)
Applies a custom child handler to the helper text element of this form element.

handler

The child handler to apply.



Returns:

This form element instance.

public LazyChild<DominoElement<HTMLElement>> requiredElement()
Gets the required element associated with this form element.

Returns:

The required element.

public LazyChild<DivElement> messagesWrapper()
Gets the messages wrapper element associated with this form element.

Returns:

The messages wrapper element.

public LazyChild<LabelElement> labelElement()
Gets the label element associated with this form element.

Returns:

The label element.

API Docs: AbstractSuggestBox

Constructors

public void AbstractSuggestBox(SuggestionsStore<T, E, O> store)
Creates an instance of AbstractSuggestBox with the specified suggestions store.

store

The suggestions store providing data for the suggest box.

Public methods

public boolean isAutoSelect()
Checks if auto-select is enabled.

Returns:

true if auto-select is enabled, false otherwise.

public C setAutoSelect(boolean autoSelect)
Sets whether auto-select is enabled or disabled.

autoSelect

true to enable auto-select, false to disable it.



Returns:

The concrete suggest box instance.

public int getTypeAheadDelay()
Gets the type-ahead delay in milliseconds; this will return the value specified using setTypeAheadDelay if greater than 0 otherwise, this will return the value specified in getSuggestBoxTypeAheadDelay .

Returns:

The type-ahead delay in milliseconds.

public void setTypeAheadDelay(int typeAheadDelayInMillis)
Sets the type-ahead delay in milliseconds.

typeAheadDelayInMillis

The type-ahead delay in milliseconds.

public String getPlaceholder()
Gets the placeholder text of the input element.

Returns:

The placeholder text.

public C setPlaceholder(String placeholder)
Sets the placeholder text of the input element.

placeholder

The placeholder text to set.



Returns:

The suggest box instance.

public DominoElement<HTMLInputElement> getInputElement()
Gets the input element of the suggest box as a DominoElement.

Returns:

The input element.

public DivElement getFieldInput()


Returns:

the input element wrapper element of the suggest box

public C withFieldInputWrapper(ChildHandler<C, DivElement> handler)
Applies a function to the input element wrapper of the suggest box.

handler

function to apply



Returns:

same suggestbox instance

public C focus()
Focuses on the suggest box input element.

Returns:

The suggest box instance.

public C unfocus()
Unfocuses (blurs) the suggest box input element.

Returns:

The suggest box instance.

public boolean isFocused()
Checks if the suggest box is currently focused.

Returns:

true if the suggest box is focused, false otherwise.

public boolean isEmpty()
Checks if the suggest box is empty, meaning there are no selected options.

Returns:

true if the suggest box is empty, false otherwise.

public boolean isEmptyIgnoreSpaces()
Checks if the suggest box is empty (ignoring spaces).

Returns:

true if the suggest box is empty or contains only spaces, false otherwise.

public boolean isEnabled()
Checks if the suggest box is enabled.

Returns:

true if the suggest box is enabled, false if disabled.

public C clear()
Clears the current value of the suggest box. This method is used to clear the selected options.

Returns:

The suggest box instance after clearing the value.

public C clear(boolean silent)
Clears the current value of the suggest box. This method is used to clear the selected options.

silent

true to clear the value silently, false to trigger change listeners.



Returns:

The suggest box instance after clearing the value.

public AutoValidator createAutoValidator(ApplyFunction autoValidate)
Creates an auto-validator for the suggest box.

autoValidate

The auto-validation function to apply.



Returns:

An AutoValidator instance.

public C triggerChangeListeners(V oldValue, V newValue)
Triggers change listeners with the old and new values.

oldValue

The old value before the change.

newValue

The new value after the change.



Returns:

The suggest box instance.

public C triggerClearListeners(V oldValue)
Triggers clear listeners with the old value before clearing.

oldValue

The old value before clearing.



Returns:

The suggest box instance.

public String getName()
Gets the name of the suggest box input element.

Returns:

The name of the input element.

public C setName(String name)
Sets the name of the suggest box input element.

name

The name to set for the input element.



Returns:

The suggest box instance after setting the name.

public String getType()
Gets the type of the suggest box input element. It always returns "text" since this is a text input.

Returns:

The input element type ("text").

public C withValue(V value)
Sets the value of the suggest box.

value

The value to set.



Returns:

The suggest box instance after setting the value.

public C withValue(V value, boolean silent)
Sets the value of the suggest box.

value

The value to set.

silent

true to set the value silently, false to trigger change listeners.



Returns:

The suggest box instance after setting the value.

public void setValue(V value)
Sets the value of the suggest box.

value

The value to set.

public C setClearable(boolean clearable)
Sets whether the suggest box is clearable or not.

clearable

true to make the suggest box clearable, false otherwise.



Returns:

The suggest box instance after setting clearability.

public boolean isClearable()
Checks if the suggest box is clearable.

Returns:

true if the suggest box is clearable, false otherwise.

public C setAutoCloseOnSelect(boolean autoClose)
Sets whether the suggest box should auto-close the options menu when an option is selected.

autoClose

true to auto-close the options menu on selection, false otherwise.



Returns:

The suggest box instance after configuring auto-closing behavior.

public boolean isAutoCloseOnSelect()
Checks if the suggest box is configured to auto-close the options menu when an option is selected.

Returns:

true if auto-closing is enabled, false otherwise.

public Menu<T> getOptionsMenu()
Gets the options menu associated with the suggest box.

Returns:

The options menu.

public C withOptionsMenu(ChildHandler<C, Menu<T>> handler)
Configures the suggest box with the provided options menu using the provided handler.

handler

A handler for configuring the suggest box and options menu.



Returns:

The suggest box instance after configuring the options menu.

public C setLoader(Loader loader)
Use to change the default search loader of a suggest box.

loader



Returns:

same component instance

public C withLoader(ChildHandler<C, Loader> handler)
Use to apply a function on search loader of a suggest box.

handler



Returns:

same component instance

public C withLoaderElement(ChildHandler<C, PrimaryAddOn<HTMLElement>> handler)
Use to apply a function on element hosting the suggest box search loader.

handler



Returns:

same component instance

API Docs: SuggestBox

Constructors

public void SuggestBox(SuggestionsStore<V, E, O> store)
Creates a new instance of SuggestBox with the provided SuggestionsStore.

store

The SuggestionsStore that provides suggestions for this single-select suggest box.

public void SuggestBox(String label, SuggestionsStore<V, E, O> store)
Creates a new instance of SuggestBox with a label and the provided SuggestionsStore.

label

The label to display for the single-select suggest box.

store

The SuggestionsStore that provides suggestions for this single-select suggest box.

Static methods

public static SuggestBox<V, E, O> create(SuggestionsStore<V, E, O> store)
Creates a new instance of SuggestBox with the provided SuggestionsStore.

store

The SuggestionsStore that provides suggestions for this single-select suggest box.



Returns:

A new instance of SuggestBox.

public static SuggestBox<V, E, O> create(String label, SuggestionsStore<V, E, O> store)
Creates a new instance of SuggestBox with a label and the provided SuggestionsStore.

label

The label to display for the single-select suggest box.

store

The SuggestionsStore that provides suggestions for this single-select suggest box.



Returns:

A new instance of SuggestBox.

Public methods

public V getValue()
Retrieves the currently selected value.

Returns:

The selected value.

public void onOptionSelected(O option)
Handles the selection of a suggestion option.

option

The suggestion option that was selected.

public SuggestBox<V, E, O> withOption(O option)
Adds a suggestion option to the single-select suggest box.

option

The suggestion option to add.



Returns:

The updated SuggestBox instance.

public SuggestBox<V, E, O> withOption(O option, boolean silent)
Adds a suggestion option to the single-select suggest box.

option

The suggestion option to add.

silent

Whether to trigger change listeners silently.



Returns:

The updated SuggestBox instance.

public void onOptionDeselected(O option)
Handles the deselection of a suggestion option.

option

The suggestion option that was deselected.

public String getStringValue()
Retrieves the string representation of the selected value.

Returns:

The string representation of the selected value.

API Docs: MultiSuggestBox

Constructors

public void MultiSuggestBox(SuggestionsStore<V, E, O> store)
Creates a new instance of MultiSuggestBox with the provided SuggestionsStore.

store

The SuggestionsStore that provides suggestions for this multi-select suggest box.

public void MultiSuggestBox(String label, SuggestionsStore<V, E, O> store)
Creates a new instance of MultiSuggestBox with a label and the provided SuggestionsStore.

label

The label to display for the multi-select suggest box.

store

The SuggestionsStore that provides suggestions for this multi-select suggest box.

Static methods

public static MultiSuggestBox<V, E, O> create(SuggestionsStore<V, E, O> store)
Creates a new MultiSuggestBox instance with the provided SuggestionsStore.

V

The type of data associated with the selected options.

E

The type of the suggest box's element.

O

The type of the option within the suggest box.

store

The SuggestionsStore that provides suggestions for this multi-select suggest box.



Returns:

A new instance of MultiSuggestBox.

public static MultiSuggestBox<V, E, O> create(String label, SuggestionsStore<V, E, O> store)
Creates a new MultiSuggestBox instance with a label and the provided SuggestionsStore.

V

The type of data associated with the selected options.

E

The type of the suggest box's element.

O

The type of the option within the suggest box.

label

The label to display for the multi-select suggest box.

store

The SuggestionsStore that provides suggestions for this multi-select suggest box.



Returns:

A new instance of MultiSuggestBox.

Public methods

public List<V> getValue()
Retrieves the currently selected values as a list.

Returns:

A list of selected values.

public void onOptionSelected(O option)
Handles the selection of a suggestion option.

option

The suggestion option that was selected.

public MultiSuggestBox<V, E, O> withOption(O option)
Adds a suggestion option to the multi-select suggest box.

option

The suggestion option to add.



Returns:

The updated MultiSuggestBox instance.

public MultiSuggestBox<V, E, O> withOption(O option, boolean silent)
Adds a suggestion option to the multi-select suggest box.

option

The suggestion option to add.

silent

Whether to trigger change listeners silently.



Returns:

The updated MultiSuggestBox instance.

public void onOptionDeselected(O option)
Handles the deselection of a suggestion option.

option

The suggestion option that was deselected.

public String getStringValue()
Retrieves the string representation of the selected values.

Returns:

A comma-separated string of selected values.

API Docs: TagBox

Constructors

public void TagBox(SuggestionsStore<V, Chip, TagOption<V>> store)
Creates a new instance of TagBox with the provided SuggestionsStore.

store

The SuggestionsStore that provides suggestions for this TagBox.

public void TagBox(String label, SuggestionsStore<V, Chip, TagOption<V>> store)
Creates a new instance of TagBox with a label and the provided SuggestionsStore.

label

The label to display for the TagBox.

store

The SuggestionsStore that provides suggestions for this TagBox.

Static methods

public static TagBox<V> create(SuggestionsStore<V, Chip, TagOption<V>> store)
Creates a new instance of TagBox with the provided SuggestionsStore.

store

The SuggestionsStore that provides suggestions for this TagBox.



Returns:

A new instance of TagBox.

public static TagBox<V> create(Function<String, V> inputMapper)
Creates a new instance of TagBox with a default input mapper.

inputMapper

A function to map input strings to tag values.



Returns:

A new instance of TagBox.

public static TagBox<V> create(String label, Function<String, V> inputMapper)
Creates a new instance of TagBox with a label and a default input mapper.

label

The label to display for the TagBox.

inputMapper

A function to map input strings to tag values.



Returns:

A new instance of TagBox.

public static TagBox<V> create(String label, SuggestionsStore<V, Chip, TagOption<V>> store)
Creates a new instance of TagBox with a label and the provided SuggestionsStore.

label

The label to display for the TagBox.

store

The SuggestionsStore that provides suggestions for this TagBox.



Returns:

A new instance of TagBox.

Public methods

public TagBox<V> setRemovable(boolean removable)
Sets whether the tags are removable.

removable

true to allow removing tags, false otherwise.



Returns:

The updated TagBox instance.

public boolean isRemovable()
Checks if tags are removable.

Returns:

true if tags are removable, false otherwise.

public List<V> getValue()
Retrieves the list of selected tag values.

Returns:

The list of selected tag values.

public void onOptionSelected(TagOption<V> option)
Handles the selection of a tag option.

option

The tag option that was selected.

public void onOptionDeselected(TagOption<V> option)
Handles the deselection of a tag option.

option

The tag option that was deselected.

public TagBox<V> setReadOnly(boolean readOnly)
Sets the read-only state of the TagBox.

readOnly

true` to set the TagBox as read-only, `false` otherwise.



Returns:

The updated TagBox instance.

public TagBox<V> setDisabled(boolean disabled)
Sets the disabled state of the TagBox.

disabled

`true` to set the TagBox as disabled, `false` otherwise.



Returns:

The updated TagBox instance.

public List<TagOption<V>> getSelectedOptions()
Retrieves a list of selected tag options.

Returns:

The list of selected tag options.

public String getStringValue()
Retrieves the string representation of the selected tag values.

Returns:

The string representation of the selected tag values.

API Docs: RadioGroup

Constructors

public void RadioGroup(String name)
Constructs a radio group with the given name. This name will be set as the name attribute of each radio button in the group.

name

The name attribute for the radio group.

public void RadioGroup(String name, String label)
Constructs a radio group with the given name and label. This name will be set as the name attribute of each radio button in the group.

name

The name attribute for the radio group.

label

The label for the radio group.

Static methods

public static RadioGroup<T> create(String name)
Factory method to create a new RadioGroup with the specified name.

T

The type of the value associated with the radio buttons in the group.

name

The name attribute for the radio group.



Returns:

A new instance of RadioGroup.

public static RadioGroup<T> create(String name, String label)
Factory method to create a new RadioGroup with the specified name and label.

T

The type of the value associated with the radio buttons in the group.

name

The name attribute for the radio group.

label

The label for the radio group.



Returns:

A new instance of RadioGroup.

Public methods

public RadioGroup<T> withGap(boolean withGap)
Configures the gap style for the radio group. When set to true, the radio group will have gaps between the radio border and the selected indicator circle at the middle.

withGap

A boolean flag indicating whether to add gaps between radio the radio border and the selected indicator circle at the middle.



Returns:

The instance of the RadioGroup .

public RadioGroup<T> appendChild(Radio<? extends T> radio)
Appends a radio button to the group, setting its name to match the group's name, and making sure only one radio button is checked at a time.

radio

The Radio to be appended to the group.



Returns:

The instance of the RadioGroup .

public RadioGroup<T> removeRadio(Radio<? extends T> radio, boolean silent)
Removes a specified radio button from the group. The radio button will be unchecked and removed from the DOM.

radio

The Radio to be removed.

silent

A boolean flag indicating if the uncheck action should trigger events.



Returns:

The instance of the RadioGroup .

public RadioGroup<T> removeAllRadios(boolean silent)
Removes all radio buttons from the group.

silent

A boolean flag indicating if the uncheck action for each radio should trigger events.



Returns:

The instance of the RadioGroup .

public RadioGroup<T> clear(boolean silent)
Clears the selection of the radio group. If a default value is set, the radio button with the matching value will be checked, otherwise, the first radio button in the group will be checked.

silent

A boolean flag indicating if the check action should trigger events.



Returns:

The instance of the RadioGroup .

public RadioGroup<T> triggerChangeListeners(T oldValue, T newValue)
Notifies all registered change listeners about a value change in the group.

oldValue

The old value of the group before the change.

newValue

The new value of the group after the change.



Returns:

The instance of the RadioGroup .

public RadioGroup<T> triggerClearListeners(T oldValue)
Notifies all registered clear listeners about a value clear in the group.

oldValue

The old value of the group before the clear action.



Returns:

The instance of the RadioGroup .

public String getType()
Retrieves the type of the form element.

Returns:

A string representation of the form element type, which is "RadioGroup".

public RadioGroup<T> withValue(T value)
Sets the value of the radio group to the specified value, and checks the corresponding radio button with that value. The change listeners will be triggered if they are not paused.

value

The value to set for the radio group.



Returns:

The instance of the RadioGroup .

public RadioGroup<T> withValue(T value, boolean silent)
Sets the value of the radio group to the specified value, and checks the corresponding radio button with that value.

value

The value to set for the radio group.

silent

A boolean flag indicating if the check action should trigger events.



Returns:

The instance of the RadioGroup .

public RadioGroup<T> vertical()
Sets the layout of the radio buttons in the group to be vertical.

Returns:

The instance of the RadioGroup .

public RadioGroup<T> horizontal()
Sets the layout of the radio buttons in the group to be horizontal.

Returns:

The instance of the RadioGroup .

public RadioGroup<T> vertical(boolean vertical)
Toggles the layout of the radio buttons in the group based on the vertical parameter.

vertical

A boolean indicating if the radio buttons should be arranged vertically.



Returns:

The instance of the RadioGroup .

public List<Radio<? extends T>> getRadios()
Retrieves the list of radio buttons that belong to the group.

Returns:

A list of radio buttons.

public RadioGroup<T> withRadios(ChildHandler<RadioGroup<T>, List<Radio<? extends T>>> handler)
Allows manipulation of the list of radio buttons that belong to the group.

handler

A handler to apply changes to the list of radio buttons.



Returns:

The instance of the RadioGroup .

public boolean isSelected()
Checks if any radio button in the group is selected.

Returns:

A boolean indicating if a radio button is selected.

public T getValue()
Retrieves the value of the selected radio button from the group.

Returns:

The value of the selected radio button, or null if no button is selected.

public boolean isEmpty()
Checks if the radio group has no selected value.

Returns:

true if the group has no selected radio button, otherwise false .

public boolean isEmptyIgnoreSpaces()
Checks if the radio group has no selected value, ignoring any spaces. This is functionally identical to isEmpty for radio groups.

Returns:

true if the group has no selected radio button, otherwise false .

public RadioGroup<T> clear()
Clears any selected value in the radio group.

Returns:

The instance of the RadioGroup .

public String getName()
Retrieves the name attribute of the radio group.

Returns:

The name attribute of the radio group.

public RadioGroup<T> setName(String name)
Sets the name attribute for the radio group and all its radio buttons.

name

The new name attribute to set.



Returns:

The instance of the RadioGroup .

public RadioGroup<T> enable()
Enables all radio buttons within the radio group.

Returns:

The instance of the RadioGroup .

public RadioGroup<T> disable()
Disables all radio buttons within the radio group.

Returns:

The instance of the RadioGroup .

public boolean isEnabled()
Checks if the radio group and all its radio buttons are enabled.

Returns:

true if all radio buttons are enabled, otherwise false .

public void setValue(Radio<T> value)
Sets the value for the radio group. This will check the radio button that has the specified value.

value

The value to be set.

public void setValue(T value, boolean silent)
Sets the value for the radio group, with an option to silence any change listeners. This will check the radio button that matches the specified value.

value

The value to be set.

silent

If true, change listeners will not be notified.

public Radio<? extends T> getSelectedRadio()
Gets the radio button that is currently selected in the group.

Returns:

The selected radio button, or null if none is selected.

public AutoValidator createAutoValidator(ApplyFunction autoValidate)
Creates an auto validator for the radio group. The auto validator will automatically validate the radio group based on the provided function.

autoValidate

A function to apply the auto-validation logic.



Returns:

An instance of AutoValidator for the radio group.

API Docs: AbstractSelect

Constructors

public void AbstractSelect()
Default constructor which initializes the underlying structures, sets up event listeners, and styles the select form.

Public methods

public C appendChild(O option)
Appends the specified option to the select.

option

The option to be added to the select.



Returns:

an instance of the concrete class.

public C insertChild(int index, O option)
Insert the specified option in the specified index.

index

The desired location index.

option

The option to be added to the select.



Returns:

an instance of the concrete class.

public C appendOptions(Collection<O> options)
Appends a collection of options to the select.

options

The collection of options to be added to the select.



Returns:

an instance of the concrete class.

public C insertOptions(int index, Collection<O> options)
Insert a collection of options starting from the provided index.

index

The insert starting index

options

The collection of options to be added to the select.



Returns:

an instance of the concrete class.

public C appendOptions(O[] options)
Appends a series of options to the select.

options

The options to be added to the select.



Returns:

an instance of the concrete class.

public C insertOptions(int index, O[] options)
Insert a series of options to the select at the provided index.

index

The starting insert index.

options

The options to be added to the select.



Returns:

an instance of the concrete class.

public C appendItem(Function<I, O> mapper, I item)
Maps the specified item using the provided mapper function and appends it as an option to the select.

mapper

The function to map the item to an option.

item

The item to be mapped and added as an option to the select.



Returns:

an instance of the concrete class.

public C insertItem(int index, Function<I, O> mapper, I item)
Maps the specified item using the provided mapper function and insert it at the provided index

index

The index

mapper

The function to map the item to an option.

item

The item to be mapped and added as an option to the select.



Returns:

an instance of the concrete class.

public C appendItems(Function<I, O> mapper, Collection<I> items)
Maps each item in the provided collection using the given mapper function and appends them as options to the select.

mapper

The function to map each item to an option.

items

The collection of items to be mapped and added as options to the select.



Returns:

an instance of the concrete class.

public C insertItems(int index, Function<I, O> mapper, Collection<I> items)
Maps each item in the provided collection using the given mapper function and insert them starting from the provided index.

index

The starting insert index.

mapper

The function to map each item to an option.

items

The collection of items to be mapped and added as options to the select.



Returns:

an instance of the concrete class.

public C appendItems(Function<I, O> mapper, I[] items)
Maps each item in the provided series using the given mapper function and appends them as options to the select.

mapper

The function to map each item to an option.

items

The items to be mapped and added as options to the select.



Returns:

an instance of the concrete class.

public C insertItems(int index, Function<I, O> mapper, I[] items)
Maps each item in the provided series using the given mapper function and insert them starting from the provided index.

index

insert starting index.

mapper

The function to map each item to an option.

items

The items to be mapped and added as options to the select.



Returns:

an instance of the concrete class.

public C appendChild(Separator separator)
Appends the specified separator to the select.

separator

The separator to be added between options in the select.



Returns:

an instance of the concrete class.

public C insertChild(int index, Separator separator)
insert the specified separator to the select at the provided index.

index

the insert index.

separator

The separator to be added between options in the select.



Returns:

an instance of the concrete class.

public String getPlaceholder()
Retrieves the current placeholder text from the select.

Returns:

The placeholder text.

public C setPlaceholder(String placeholder)
Sets the placeholder text for the select.

placeholder

The text to be used as a placeholder.



Returns:

an instance of the concrete class.

public DominoElement<HTMLInputElement> getInputElement()
Retrieves the input element associated with the select.

Returns:

The input element.

public String getStringValue()
Returns the string representation of the currently selected value(s) in the select.

Returns:

The string representation of the selected value(s).

public C focus()
Focuses on the input element associated with the select.

Returns:

an instance of the concrete class.

public C unfocus()
Removes focus from the input element associated with the select.

Returns:

an instance of the concrete class.

public boolean isFocused()
Checks if the input element associated with the select currently has focus.

Returns:

true if the element is focused, false otherwise.

public boolean isEmpty()
Determines if the select currently has a value.

Returns:

true if the select is empty, false otherwise.

public boolean isEmptyIgnoreSpaces()
Determines if the select currently has a value while ignoring spaces.

Note: This method currently has the same implementation as isEmpty .

Returns:

true if the select is empty, false otherwise.

public boolean isEnabled()
Checks if the select is enabled.

Returns:

true if the select is enabled, false otherwise.

public C clear()
Clears the current value of the select.

Returns:

an instance of the concrete class.

public C clear(boolean silent)
Clears the current value of the select with the option to notify listeners of the change.

silent

if true , listeners will not be notified of the change.



Returns:

an instance of the concrete class.

public AutoValidator createAutoValidator(ApplyFunction autoValidate)
Creates an AutoValidator for the select element.

autoValidate

The function to be applied for auto-validation.



Returns:

an instance of AutoValidator .

public C triggerChangeListeners(V oldValue, V newValue)
Triggers all registered change listeners with the specified old and new values.

oldValue

The old value.

newValue

The new value.



Returns:

an instance of the concrete class.

public C triggerClearListeners(V oldValue)
Triggers all registered clear listeners with the specified old value.

oldValue

The old value.



Returns:

an instance of the concrete class.

public String getName()
Retrieves the name attribute of the input element associated with the select.

Returns:

The name attribute of the input element.

public C setName(String name)
Sets the name attribute for the input element associated with the select.

name

The name to set.



Returns:

an instance of the concrete class.

public String getType()
Retrieves the type attribute of the input element. For this implementation, it always returns "text".

Returns:

The string "text".

public C withValue(V value)
Sets the value for the select. Whether to notify listeners is determined by the current state of change listeners.

value

The new value to set.



Returns:

an instance of the concrete class.

public C addOptionsGroup(Collection<O> options, MenuItemsGroupHandler<T, AbstractMenuItem<T>> groupHandler)
Adds a group of options to the select menu with a provided group handler.

options

The collection of options to add to the group.

groupHandler

The handler for the options group.



Returns:

an instance of the concrete class.

public C group(MenuItemsGroupHandler<T, AbstractMenuItem<T>> groupHandler, Collection<O> options)
Convenience method to group a set of options using a provided group handler. Internally uses addOptionsGroup .

groupHandler

The handler for the options group.

options

The collection of options to group.



Returns:

an instance of the concrete class.

public C withValue(V value, boolean silent)
Sets the value for the select. Optionally, it can notify listeners based on the provided silent flag.

value

The new value to set.

silent

If true, change listeners will not be notified.



Returns:

an instance of the concrete class.

public C withOption(O option)
Appends an option to the select. Whether to notify listeners is determined by the current state of change listeners.

option

The option to add.



Returns:

an instance of the concrete class.

public void setValue(V value)
Sets the value of the select component.

value

The new value to set.

public C selectOption(O option)
Selects a given option within the select component.

option

The option to select.



Returns:

an instance of the concrete class.

public int getSelectedIndex()
Retrieves the index of the currently selected option within the select component. If no option is selected, it returns -1.

Returns:

The index of the selected option, or -1 if no option is selected.

public Optional<O> findOption(O option)
Searches for a specific option within the select component.

option

The option to search for.



Returns:

An Optional containing the matched option or empty if not found.

public Optional<O> findOptionByKey(String key)
Searches for an option by its key within the select component.

key

The key of the option to search for.



Returns:

An Optional containing the matched option or empty if not found.

public Optional<O> findOptionByValue(T value)
Searches for an option by its value within the select component.

value

The value of the option to search for.



Returns:

An Optional containing the matched option or empty if not found.

public Optional<O> findOptionByIndex(int index)
Searches for an option by its index within the select component.

index

The index of the option to search for.



Returns:

An Optional containing the matched option or empty if the index is out of bounds or not found.

public C selectAt(int index)
Selects the option at the specified index within the select component.

index

The index of the option to select.



Returns:

an instance of the concrete class.

public C selectAt(int[] indices)
Selects the option at the specified Indices within the select component.

indices

The Indices of the options to select.



Returns:

an instance of the concrete class.

public C selectAt(int index, boolean silent)
Selects the option at the specified index within the select component. Optionally, it can notify listeners based on the provided silent flag.

index

The index of the option to select.

silent

If true, change listeners will not be notified.



Returns:

an instance of the concrete class.

public C selectAt(boolean silent, int[] indices)
Selects the option at the specified Indices within the select component. Optionally, it can notify listeners based on the provided silent flag.

indices

The Indices of the option to select.

silent

If true, change listeners will not be notified.



Returns:

an instance of the concrete class.

public C selectByKey(String key)
Selects the option associated with the specified key within the select component. Note: This method erroneously calls onOptionDeselected instead of onOptionSelected.

key

The key of the option to select.



Returns:

an instance of the concrete class.

public C selectByKey(String key, boolean silent)
Selects the option associated with the specified key within the select component. Note: This method erroneously calls onOptionDeselected instead of onOptionSelected. Optionally, it can notify listeners based on the provided silent flag.

key

The key of the option to select.

silent

If true, change listeners will not be notified.



Returns:

an instance of the concrete class.

public C selectByValue(T value)
Selects the option with the specified value within the select component.

value

The value of the option to select.



Returns:

an instance of the concrete class.

public C selectByValue(T value, boolean silent)
Selects the option with the specified value within the select component. Optionally, it can notify listeners based on the provided silent flag.

value

The value of the option to select.

silent

If true, change listeners will not be notified.



Returns:

an instance of the concrete class.

public C deselectAt(int index)
Deselects the option at the specified index within the select component.

index

The index of the option to deselect.



Returns:

an instance of the concrete class.

public C deselectAt(int index, boolean silent)
Deselects the option at the specified index within the select component. Optionally, it can notify listeners based on the provided silent flag.

index

The index of the option to deselect.

silent

If true, change listeners will not be notified.



Returns:

an instance of the concrete class.

public C deselectByKey(String key)
Deselects the option associated with the specified key within the select component. Optionally, it can notify listeners based on the provided silent flag.

key

The key of the option to deselect.



Returns:

an instance of the concrete class.

public C deselectByKey(String key, boolean silent)
Deselects the option associated with the specified key within the select component. Optionally, it can notify listeners based on the provided silent flag.

key

The key of the option to deselect.

silent

If true, change listeners will not be notified.



Returns:

an instance of the concrete class.

public C deselectByValue(T value)
Deselects the option with the specified value within the select component.

value

The value of the option to deselect.



Returns:

an instance of the concrete class.

public C deselectByValue(T value, boolean silent)
Deselects the option with the specified value within the select component. Optionally, it can notify listeners based on the provided silent flag.

value

The value of the option to deselect.

silent

If true, change listeners will not be notified.



Returns:

an instance of the concrete class.

public boolean containsKey(String key)
Checks if the select component contains an option with the specified key.

key

The key to search for.



Returns:

true if the option is found, otherwise false .

public boolean containsValue(T value)
Checks if the select component contains an option with the specified value.

value

The value to search for.



Returns:

true if the option is found, otherwise false .

public C setClearable(boolean clearable)
Sets whether the select component can be cleared.

clearable

true if the select should be clearable, otherwise false .



Returns:

an instance of the concrete class.

public boolean isClearable()
Checks if the select component can be cleared.

Returns:

true if the select is clearable, otherwise false .

public C setAutoCloseOnSelect(boolean autoClose)
Configures whether the select component should automatically close upon selecting an option.

autoClose

true if the select should automatically close after selection, otherwise false .



Returns:

an instance of the concrete class.

public boolean isAutoCloseOnSelect()
Checks if the select component is set to automatically close upon selecting an option.

Returns:

true if the select auto-closes on select, otherwise false .

public C setSearchable(boolean searchable)
Configures whether the select component should provide a search functionality for its options.

searchable

true if the select should provide search functionality, otherwise false .



Returns:

an instance of the concrete class.

public boolean isSearchable()
Checks if the select component provides a search functionality.

Returns:

true if the select is searchable, otherwise false .

public boolean isAllowCreateMissing()
Checks if the select component allows creation of missing options.

Returns:

true if the select allows creating missing options, otherwise false .

public Menu<T> getOptionsMenu()
Retrieves the options menu associated with the select component.

Returns:

The options menu.

public C withOptionsMenu(ChildHandler<C, Menu<T>> handler)
Applies a handler to the options menu of the select component.

handler

The handler to apply.



Returns:

an instance of the concrete class.

public C setMissingItemHandler(MissingOptionHandler<C, E, T, O> missingOptionHandler)
Sets the handler for missing options in the select component.

missingOptionHandler

The handler for missing options.



Returns:

an instance of the concrete class.

public C removeOption(O option)
Removes a specified option from the select component.

option

The option to remove.



Returns:

an instance of the concrete class.

public C removeOptionAt(int index)
Removes a specified option from the select component.

index

the index of the option to be removed.



Returns:

an instance of the concrete class.

public C removeOptions(Collection<O> options)
Removes a collection of options from the select component.

options

The collection of options to remove.



Returns:

an instance of the concrete class.

public C removeOptions(O[] options)
Removes an array of options from the select component.

options

The array of options to remove.



Returns:

an instance of the concrete class.

public C removeAllOptions()
Removes all options from the select component.

Returns:

an instance of the concrete class.

public C hide()
Hides the select component. If the options menu is open, it will be closed before hiding.

Returns:

an instance of the concrete class.

public boolean isTypeToSelect()
is the select component selectable by typing.

Returns:

true if the select component is selectable when start typing

public C setTypeToSelect(boolean typeToSelect)
Sets the select component to be selectable by typing.

typeToSelect

true if the select component should be selectable when start typing

public List<O> getOptions()
Retrieves a list of options by processing the flat menu items from the options menu. The method filters and maps each menu item's metadata into a corresponding option.

Returns:

a list of options collected from the menu items

public C withOptions(ChildHandler<C, List<O>> handler)
Configures the current instance with the provided options handler.

handler

the handler responsible for applying additional options to the current instance and its associated list of options



Returns:

the current instance with the applied options

public C withFieldInput(ChildHandler<C, DivElement> handler)
Processes the provided handler with the current instance and the fieldInput element.

handler

a ChildHandler that performs actions using the current instance and the fieldInput element



Returns:

the current instance after the handler is applied

API Docs: MultiSelect

Constructors

public void MultiSelect()
Default constructor initializing the options menu for multi-selection.
public void MultiSelect(String label)
Constructor with a predefined label.

label

the label for the MultiSelect

Static methods

public static MultiSelect<V> create()
Creates a new instance of MultiSelect without any predefined label.

V

the type of the value



Returns:

a new instance of MultiSelect

public static MultiSelect<V> create(String label)
Creates a new instance of MultiSelect with a predefined label.

label

the label for the MultiSelect

V

the type of the value



Returns:

a new instance of MultiSelect

Public methods

public MultiSelect<V> withValue(V[] value)
Sets the value(s) of this MultiSelect .

value

the values to set



Returns:

the current MultiSelect instance for chaining

public MultiSelect<V> withValue(boolean silent, V[] value)
Sets the value(s) for this MultiSelect with the ability to silence the change listeners.

This method allows specifying multiple values and whether the change should notify listeners or not.

Usage example:

 
 MultiSelect< String>  multiSelect = MultiSelect.create("Select Items");
 multiSelect.withValue(true, "Option1", "Option2"); // silent set
 multiSelect.withValue(false, "Option3", "Option4"); // non-silent set
 

silent

if true , change listeners will not be triggered; if false , they will be triggered

value

the array of values to set



Returns:

the current MultiSelect instance for chaining

See also :

public MultiSelect<V> withOption(SelectOption<V> option, boolean silent)
Adds an option to the MultiSelect .

option

the option to add

silent

if true, change listeners will not be triggered



Returns:

the current MultiSelect instance for chaining

public List<V> getValue()
Retrieves a list of values representing all the selected options.

Returns:

a list of selected values

See also :

public MultiSelect<V> setWrapSelection(boolean wrapSelection)
Sets whether the selection should wrap or not.

If wrapSelection is true , the selection will wrap. Otherwise, it will be forced to stay on a single line using a no-wrap CSS class.

wrapSelection

true to allow wrapping, false to prevent wrapping



Returns:

this MultiSelect instance for method chaining

public MultiSelect<V> setShowSelectionCount(boolean showSelectionCount)
Sets whether the selection count badge should be visible.

If showSelectionCount is true , the selection count badge will be shown. Otherwise, it will be hidden using the appropriate CSS class.

showSelectionCount

true to display the selection count badge, false to hide it



Returns:

this MultiSelect instance for method chaining

API Docs: Select

Constructors

public void Select()
Default constructor creating a Select instance without a label.
public void Select(String label)
Constructor to create a Select instance with the specified label.

label

The label to be set for the select control.

Static methods

public static Select<V> create()
Creates a new instance of Select without a label.

V

the type of value for the select options



Returns:

a new instance of Select

public static Select<V> create(String label)
Creates a new instance of Select with a specified label.

label

The label to be set for the select control.

V

the type of value for the select options



Returns:

a new instance of Select with the specified label.

Public methods

public Select<V> withOption(SelectOption<V> option, boolean silent)
Adds an option to the Select dropdown. If the option value is different from the current selected value, it updates the selected option.

option

The option to be added.

silent

If true, does not trigger change listeners after setting the option.



Returns:

The current Select instance.

public V getValue()
Retrieves the value of the currently selected option.

Returns:

the value of the currently selected option or null if no option is selected.

API Docs: InputFormField

Constructors

public void InputFormField()
Constructs a new InputFormField instance. Initializes and configures the HTML input element for user input.

Public methods

public DominoElement<E> getInputElement()
Retrieves the HTML input element associated with this form field.

Returns:

The HTML input element.

public boolean isEmpty()
Checks if the input field is empty (has no value).

Returns:

true if the input field is empty, false otherwise.

public boolean isEmptyIgnoreSpaces()
Checks if the input field is empty when ignoring leading and trailing spaces.

Returns:

true if the input field is empty, false otherwise.

public T clear()
Clears the input field's value.

Returns:

This InputFormField instance.

public T clear(boolean silent)
Clears the input field's value.

silent

true to clear the field silently without triggering listeners, false otherwise.



Returns:

This InputFormField instance.

public AutoValidator createAutoValidator(ApplyFunction autoValidate)
Creates and returns an InputAutoValidator for automatic input validation.

autoValidate

The function to apply for auto-validation.



Returns:

An InputAutoValidator instance.

public T triggerChangeListeners(V oldValue, V newValue)
Triggers change listeners when the input field's value changes.

oldValue

The old value before the change.

newValue

The new value after the change.



Returns:

This InputFormField instance.

public T triggerClearListeners(V oldValue)
Triggers clear listeners when the input field's value is cleared.

oldValue

The old value before clearing.



Returns:

This InputFormField instance.

public T withValue(V value)
Sets the value of the input field.

value

The value to set.



Returns:

This InputFormField instance.

public T withValue(V value, boolean silent)
Sets the value of the input field and optionally triggers change listeners.

value

The value to set.

silent

true to set the value silently without triggering change listeners, false otherwise.



Returns:

This InputFormField instance.

public boolean isEnabled()
Checks if the input field is enabled.

Returns:

true if the input field is enabled, false if disabled.

public boolean isDisabled()
Checks if the input field is disabled.

Returns:

true if the input field is disabled, false if enabled.

public T setReadOnly(boolean readOnly)
Sets the input field to read-only mode.

readOnly

true to set the input field as read-only, false to make it editable.



Returns:

This InputFormField instance.

public boolean isReadOnly()
Checks if the input field is in read-only mode.

Returns:

true if the input field is in read-only mode, false if it is editable.

public void setValue(V value)
Sets the value of the input field.

value

The value to set.

public T focus()
Focuses on the input field.

Returns:

This InputFormField instance.

public T unfocus()
Removes focus from the input field.

Returns:

This InputFormField instance.

public boolean isFocused()
Checks if the input field is currently focused.

Returns:

true if the input field is focused, false otherwise.

public T withInputElement(ChildHandler<T, DominoElement<E>> handler)
Allows customization and manipulation of the input element.

handler

The handler function for customizing the input element.



Returns:

This InputFormField instance.

API Docs: UploadBox

Constructors

public void UploadBox()
Constructs a new UploadBox instance with default settings.
public void UploadBox(String label)
Constructs a new UploadBox instance with a specified label.

label

The label for the UploadBox .

Static methods

public static UploadBox create()
Creates a new UploadBox instance with default settings.

Returns:

A new UploadBox instance.

public static UploadBox create(String label)
Creates a new UploadBox instance with a specified label.

label

The label for the UploadBox .



Returns:

A new UploadBox instance.

Public methods

public UploadBox setPostfix(String postfix)
Sets the postfix text for the UploadBox .

postfix

The text to be displayed as a postfix.



Returns:

This UploadBox instance.

public String getPostfix()
Gets the postfix text of the UploadBox .

Returns:

The postfix text of the UploadBox .

public UploadBox setPrefix(String prefix)
Sets the prefix text for the UploadBox .

prefix

The text to be displayed as a prefix.



Returns:

This UploadBox instance.

public String getPrefix()
Gets the prefix text of the UploadBox .

Returns:

The prefix text of the UploadBox .

public PrefixElement getPrefixElement()
Gets the prefix element of the UploadBox .

Returns:

The prefix element as a DivElement .

public UploadBox withPrefixElement()
Initializes and retrieves the prefix element of the UploadBox .

Returns:

This UploadBox instance.

public UploadBox withPostfixElement()
Initializes and retrieves the postfix element of the UploadBox .

Returns:

This UploadBox instance.

public String getName()
Gets the name attribute of the UploadBox .

Returns:

The name attribute.

public UploadBox setName(String name)
Sets the name attribute of the UploadBox .

name

The name attribute to set.



Returns:

This UploadBox instance.

public String getStringValue()
Gets the string representation of the selected files' names, separated by commas.

Returns:

The selected files' names as a string.

public String getType()
Gets the type of the input element, which is always "file" for the UploadBox .

Returns:

The input element type.

public List<File> getValue()
Gets the list of selected files in the UploadBox .

Returns:

A list of selected File objects.

public UploadBox setAccepts(String[] accepts)
Sets the accepted file types for the UploadBox .

accepts

The file types to accept (e.g., "image/*").



Returns:

This UploadBox instance.

public String getAccepts()
Gets the accepted file types for the UploadBox .

Returns:

The accepted file types.

public UploadBox setMultiple(boolean multiple)
Enables or disables multiple file selection for the UploadBox .

multiple

true to enable multiple file selection, false to disable it.



Returns:

This UploadBox instance.

public boolean getMultiple()
Checks if multiple file selection is enabled for the UploadBox .

Returns:

true if multiple file selection is enabled, false otherwise.

API Docs: CountableInputFormField

Constructors

public void CountableInputFormField()
Creates a new `CountableInputFormField` instance.

Public methods

public T updateCounter(int count, int maxCount)
Updates the character counter based on the current input length and maximum count.

count

The current input length.

maxCount

The maximum input length allowed.



Returns:

This `CountableInputFormField` instance.

public T setCountFormatter(CountFormatter formatter)
Sets a custom formatter for the character counter.

formatter

The custom formatter for the character counter.



Returns:

This `CountableInputFormField` instance.

public int getMaxLength()
Gets the maximum character count allowed for the input field.

Returns:

The maximum character count allowed.

public T setMaxLength(int maxLength)
Sets the maximum character count allowed for the input field.

maxLength

The maximum character count allowed.



Returns:

This `CountableInputFormField` instance.

public int getLength()
Gets the current input length.

Returns:

The current input length.

public int getMinLength()
Gets the minimum character count allowed for the input field.

Returns:

The minimum character count allowed.

public T setMinLength(int minLength)
Sets the minimum character count allowed for the input field.

minLength

The minimum character count allowed.



Returns:

This `CountableInputFormField` instance.

public int getMaxCount()
Gets the maximum character count allowed for the input field (alias for getMaxLength).

Returns:

The maximum character count allowed.

public String getPlaceholder()
Gets the placeholder text for the input field.

Returns:

The placeholder text.

public T setPlaceholder(String placeholder)
Sets the placeholder text for the input field.

placeholder

The placeholder text to set.



Returns:

This `CountableInputFormField` instance.

public T clear(boolean silent)
Clears the input field's value and updates the character counter.

silent

true to clear the field silently, false otherwise.



Returns:

This `CountableInputFormField` instance.

public SpanElement getCounterElement()
Gets the character counter element associated with the input field.

Returns:

The character counter element as a `SpanElement`.

public T withCounterElement()
Initializes and retrieves the character counter element for the input field.

Returns:

This `CountableInputFormField` instance.

public T withCounterElement(ChildHandler<T, SpanElement> handler)
Initializes and retrieves the character counter element for the input field and applies the specified handler to it.

handler

The handler to apply to the character counter element.



Returns:

This `CountableInputFormField` instance.

API Docs: TextInputFormField

Constructors

public void TextInputFormField()
Creates a new TextInputFormField instance with default values.

Public methods

public T setPostfix(String postfix)
Sets a postfix element for the text input field.

postfix

The postfix text or content.



Returns:

This TextInputFormField instance.

public String getPostfix()
Gets the postfix text or content of the text input field.

Returns:

The postfix text or content.

public T setPrefix(String prefix)
Sets a prefix element for the text input field.

prefix

The prefix text or content.



Returns:

This TextInputFormField` instance.

public String getPrefix()
Gets the prefix text or content of the text input field.

Returns:

The prefix text or content.

public PrefixElement getPrefixElement()
Gets the prefix element associated with the text input field.

Returns:

The prefix element as a `DivElement`.

public PostfixElement getPostfixElement()
Gets the postfix element associated with the text input field.

Returns:

The postfix element as a `DivElement`.

public T withPrefixElement()
Initializes and retrieves the prefix element for the text input field.

Returns:

This `TextInputFormField` instance.

public T withPostfixElement()
Initializes and retrieves the postfix element for the text input field.

Returns:

This `TextInputFormField` instance.

public String getName()
Gets the name attribute of the text input field.

Returns:

The name attribute value.

public T setName(String name)
Sets the name attribute for the text input field.

name

The name attribute value to set.



Returns:

This `TextInputFormField` instance.

public T setPattern(String pattern)
Sets a regular expression pattern for the text input field.

pattern

The regular expression pattern.



Returns:

This `TextInputFormField` instance.

public T setPattern(String pattern, String errorMessage)
Sets a regular expression pattern for the text input field and specifies a custom error message to display when the pattern is not matched.

pattern

The regular expression pattern.

errorMessage

The custom error message to display.



Returns:

This `TextInputFormField` instance.

public String getPattern()
Gets the regular expression pattern of the text input field.

Returns:

The regular expression pattern.

public T setInvalidPatternErrorMessage(String invalidPatternErrorMessage)
Sets a custom error message for the "invalid pattern" validation.

invalidPatternErrorMessage

The custom error message to display.



Returns:

This `TextInputFormField` instance.

public String getInvalidPatternErrorMessage()
Gets the error message for the "invalid pattern" validation.

Returns:

The error message for invalid pattern.

public T setTypeMismatchErrorMessage(String typeMismatchErrorMessage)
Sets a custom error message for the "type mismatch" validation.

typeMismatchErrorMessage

The custom error message to display.



Returns:

This `TextInputFormField` instance.

API Docs: DateBox

Constructors

public void DateBox()
Creates a new DateBox with the current date and default configuration.
public void DateBox(String label)
Creates a new DateBox with a label and the current date using default configuration.

label

The label for the DateBox

public void DateBox(Date date)
Creates a new DateBox with the specified date using default configuration.

date

The initial date value for the DateBox

public void DateBox(String label, Date date)
Creates a new DateBox with a label and the specified date using default configuration.

label

The label for the DateBox

date

The initial date value for the DateBox

public void DateBox(Date date, CalendarInitConfig calendarInitConfig)
Creates a new DateBox with the specified date and calendar initialization configuration.

date

The initial date value for the DateBox

calendarInitConfig

The calendar initialization configuration

public void DateBox(String label, Date date, CalendarInitConfig calendarInitConfig)
Creates a new DateBox with a label, the specified date, and calendar initialization configuration.

label

The label for the DateBox

date

The initial date value for the DateBox

calendarInitConfig

The calendar initialization configuration

public void DateBox(String label, Date date, DateTimeFormatInfo dateTimeFormatInfo, CalendarInitConfig calendarInitConfig)
Creates a new DateBox with a label, the specified date, date-time format information, and calendar initialization configuration.

label

The label for the DateBox

date

The initial date value for the DateBox

dateTimeFormatInfo

The date-time format information

calendarInitConfig

The calendar initialization configuration

public void DateBox(Date date, DateTimeFormatInfo dateTimeFormatInfo, CalendarInitConfig calendarInitConfig)
Creates a new DateBox with the specified date, date-time format information, and calendar initialization configuration.

date

The initial date value for the DateBox

dateTimeFormatInfo

The date-time format information

calendarInitConfig

The calendar initialization configuration

Static methods

public static DateBox empty()
Creates a new DateBox with the current date and default configuration.

Returns:

A new DateBox instance

public static DateBox create()
Creates a new DateBox with the current date and default configuration.

Returns:

A new DateBox instance

public static DateBox create(String label)
Creates a new DateBox with a label and the current date using default configuration.

label

The label for the DateBox



Returns:

A new DateBox instance

public static DateBox create(Date date)
Creates a new DateBox with the specified date using default configuration.

date

The initial date value for the DateBox



Returns:

A new DateBox instance

public static DateBox create(String label, Date date)
Creates a new DateBox with a label and the specified date using default configuration.

label

The label for the DateBox

date

The initial date value for the DateBox



Returns:

A new DateBox instance

public static DateBox create(Date date, CalendarInitConfig calendarInitConfig)
Creates a new DateBox with the specified date and calendar initialization configuration.

date

The initial date value for the DateBox

calendarInitConfig

The calendar initialization configuration



Returns:

A new DateBox instance

public static DateBox create(String label, Date date, CalendarInitConfig calendarInitConfig)
Creates a new DateBox with a label, the specified date, and calendar initialization configuration.

label

The label for the DateBox

date

The initial date value for the DateBox

calendarInitConfig

The calendar initialization configuration



Returns:

A new DateBox instance

public static DateBox create(Date date, DateTimeFormatInfo dateTimeFormatInfo, CalendarInitConfig calendarInitConfig)
Creates a new DateBox with a specified date, date-time format information, and calendar initialization configuration.

date

The initial date value for the DateBox

dateTimeFormatInfo

The date-time format information

calendarInitConfig

The calendar initialization configuration



Returns:

A new DateBox instance

public static DateBox create(DateTimeFormatInfo dateTimeFormatInfo)
Creates a new DateBox with default date-time format information and the current date.

dateTimeFormatInfo

The date-time format information



Returns:

A new DateBox instance

public static DateBox create(String label, DateTimeFormatInfo dateTimeFormatInfo)
Creates a new DateBox with a label, default date-time format information, and the current date.

label

The label for the DateBox

dateTimeFormatInfo

The date-time format information



Returns:

A new DateBox instance

public static DateBox create(String label, Date date, DateTimeFormatInfo dateTimeFormatInfo, CalendarInitConfig calendarInitConfig)
Creates a new DateBox with a label, specified date, date-time format information, and calendar initialization configuration.

label

The label for the DateBox

date

The initial date value for the DateBox

dateTimeFormatInfo

The date-time format information

calendarInitConfig

The calendar initialization configuration



Returns:

A new DateBox instance

Public methods

public DateBox close()
Closes the popover associated with this DateBox.

Returns:

This DateBox instance with the popover closed

public DateBox setPattern(Pattern pattern)
Sets the date pattern for formatting the displayed date value based on a predefined pattern.

The predefined patterns are:

  • FULL: Full date pattern
  • LONG: Long date pattern
  • MEDIUM: Medium date pattern
  • SHORT: Short date pattern

pattern

The predefined pattern for formatting the date value



Returns:

This DateBox instance with the new date pattern applied

public DateBox setPattern(String pattern)
Sets the custom date pattern for formatting the displayed date value.

The date pattern should follow the conventions of the date format used in the DateTimeFormatInfo associated with this DateBox.

pattern

The custom date pattern (e.g., "MM/dd/yyyy")



Returns:

This DateBox instance with the new custom date pattern applied

public DateBox setPopoverPosition(DropDirection position)
Sets the position of the popover when it opens.

position

The desired position of the popover



Returns:

This DateBox instance with the popover position set

public DateBox withOpenOnFocusToggleListeners(boolean toggle, Handler<DateBox> handler)
Adds a listener to toggle the "openOnFocus" behavior of this DateBox when it receives focus.

toggle

If true, the "openOnFocus" behavior will be enabled; if false, it will be disabled.

handler

A handler that will be invoked when the toggle state changes.



Returns:

This DateBox instance with the listener added.

public DateBox withPausedOpenOnFocusListeners(boolean toggle, AsyncHandler<DateBox> handler)
Adds a listener to toggle the "openOnFocus" behavior of this DateBox when it receives focus, with the option to pause the toggle state temporarily.

toggle

If true, the "openOnFocus" behavior will be enabled; if false, it will be disabled.

handler

An asynchronous handler that will be invoked when the toggle state changes.



Returns:

This DateBox instance with the listener added.

@throws Exception If an exception occurs during the asynchronous handler execution.
public String getStringValue()
Check super implementation documentation. Returns the string value of the underlying input element.

Returns:

The string value of the input element.

public String getType()
Check super implementation documentation. Returns the type of the input element, which is always "text" for a DateBox.

Returns:

The string "text."

public Date getValue()
Check super implementation documentation. Returns the selected date value of this DateBox.

Returns:

The selected date value.

public void onDateSelectionChanged(Date date)
Check super implementation documentation. Called when the date selection in the calendar view changes. It clears any validation errors, sets the selected date value, and closes the popover.

date

The selected date.

public DateTimeFormatInfo getDateTimeFormat()
Retrieves the date-time format information associated with this DateBox.

Returns:

The date-time format information

public DateBox setDateTimeFormat(DateTimeFormatInfo dateTimeFormatInfo)
Sets the date-time format information for this DateBox.

dateTimeFormatInfo

The date-time format information to set



Returns:

This DateBox instance with the new date-time format information

public void onDateTimeFormatInfoChanged(DateTimeFormatInfo dateTimeFormatInfo)
Check super implementation documentation. Called when the date-time format information is changed. It updates the string value of the input element according to the new date-time format information.

dateTimeFormatInfo

The new date-time format information.

public boolean isOpenOnFocus()
Checks if the DateBox is set to open the popover on focus.

Returns:

True if the popover opens on focus, false otherwise

public DateBox setOpenOnFocus(boolean openOnFocus)
Sets whether the DateBox should open the popover on focus.

openOnFocus

True to open the popover on focus, false to disable



Returns:

This DateBox instance with the updated setting

public boolean isParseStrict()
Checks if the DateBox is set to parse date values strictly.

Returns:

True if strict date parsing is enabled, false otherwise

public DateBox setParseStrict(boolean parseStrict)
Sets whether the DateBox should parse date values strictly.

parseStrict

True to enable strict date parsing, false to disable



Returns:

This DateBox instance with the updated setting

public boolean isOpenOnClick()
Checks if the DateBox is set to open the popover on click.

Returns:

True if the popover opens on click, false otherwise

public DateBox setOpenOnClick(boolean openOnClick)
Sets whether the DateBox should open the popover on click.

openOnClick

True to open the popover on click, false to disable



Returns:

This DateBox instance with the updated setting

public DateBox withCalendar(ChildHandler<DateBox, Calendar> handler)
Provides access to the DateBox's calendar for additional customization.

handler

The handler to apply to the calendar



Returns:

This DateBox instance with the calendar configured

public DateBox withPopover(ChildHandler<DateBox, Popover> handler)
Provides access to the DateBox's popover for additional customization.

handler

The handler to apply to the popover



Returns:

This DateBox instance with the popover configured

API Docs: TimeBox

Constructors

public void TimeBox()
Constructs a TimeBox with the current date set.
public void TimeBox(String label)
Constructs a TimeBox with the given label and current date set.

label

the label for the time box

public void TimeBox(Date date)
Constructs a TimeBox with the specified date set.

date

the initial date to be set

public void TimeBox(String label, Date date)
Constructs a TimeBox with the specified label and date.

label

the label for the time box

date

the initial date to be set

public void TimeBox(String label, Date date, DateTimeFormatInfo dateTimeFormatInfo)
Constructs a TimeBox with the specified label, date, and date format information.

label

the label for the time box

date

the initial date to be set

dateTimeFormatInfo

the date format information

public void TimeBox(Date date, DateTimeFormatInfo dateTimeFormatInfo)
Constructs a TimeBox with the specified date and date format information.

date

the initial date to be set

dateTimeFormatInfo

the date format information

Static methods

public static TimeBox empty()
Creates and returns an empty TimeBox instance with a null Date.

Returns:

a new TimeBox instance with a null Date.

public static TimeBox create()
Factory method to create a new instance of TimeBox with the current date set.

Returns:

a new instance of TimeBox

public static TimeBox create(String label)
Factory method to create a new instance of TimeBox with the specified label and current date set.

label

the label for the time box



Returns:

a new instance of TimeBox

public static TimeBox create(Date date)
Factory method to create a new instance of TimeBox with the specified date.

date

the date to set



Returns:

a new instance of TimeBox

public static TimeBox create(String label, Date date)
Factory method to create a new instance of TimeBox with the specified label and date.

label

the label for the time box

date

the date to set



Returns:

a new instance of TimeBox

public static TimeBox create(Date date, DateTimeFormatInfo dateTimeFormatInfo)
Factory method to create a new instance of TimeBox with the specified date and date format information.

date

the date to set

dateTimeFormatInfo

the date format information



Returns:

a new instance of TimeBox

public static TimeBox create(DateTimeFormatInfo dateTimeFormatInfo)
Factory method to create a new instance of TimeBox with the specified date format information.

dateTimeFormatInfo

the date format information



Returns:

a new instance of TimeBox

public static TimeBox create(String label, DateTimeFormatInfo dateTimeFormatInfo)
Factory method to create a new instance of TimeBox with the specified label and date format information.

label

the label for the time box

dateTimeFormatInfo

the date format information



Returns:

a new instance of TimeBox

public static TimeBox create(String label, Date date, DateTimeFormatInfo dateTimeFormatInfo)
Factory method to create a new instance of TimeBox with the specified label, date, and date format information.

label

the label for the time box

date

the date to set

dateTimeFormatInfo

the date format information



Returns:

a new instance of TimeBox

Public methods

public TimeBox close()
Closes the associated popover.

Returns:

the current instance of TimeBox

public TimeBox setPattern(Pattern pattern)
Sets the pattern for time formatting.

pattern

the Pattern to set



Returns:

the current instance of TimeBox

public TimeBox setPattern(String pattern)
Sets the custom pattern for time formatting.

pattern

the custom pattern string



Returns:

the current instance of TimeBox

public TimeBox setPopoverPosition(DropDirection position)
Sets the position of the popover.

position

the DropDirection position



Returns:

the current instance of TimeBox

public TimeBox withOpenOnFocusToggleListeners(boolean toggle, Handler<TimeBox> handler)
Temporarily toggles the "open on focus" state and applies the given handler.

toggle

desired temporary state

handler

the handler to be applied



Returns:

the current instance of TimeBox

public TimeBox withPausedOpenOnFocusListeners(boolean toggle, AsyncHandler<TimeBox> handler)
Temporarily toggles the "open on focus" state, applies the asynchronous handler, and then reverts to the original state once the handler has completed.

toggle

desired temporary state

handler

the asynchronous handler to be applied



Returns:

the current instance of TimeBox

public String getStringValue()
Retrieves the string representation of the current value in the input field.

Returns:

the string value

public String getType()
Retrieves the type of the input field.

Returns:

the string "text"

public Date getValue()
Retrieves the current date value set in the TimeBox.

Returns:

the current date value

public void onTimeSelectionChanged(Date date)
Handles changes in time selection.

date

the newly selected date

public DateTimeFormatInfo getDateTimeFormat()
Retrieves the current date-time format information.

Returns:

the current DateTimeFormatInfo

public TimeBox setDateTimeFormat(DateTimeFormatInfo dateTimeFormatInfo)
Sets the date-time format information for the TimeBox.

dateTimeFormatInfo

the DateTimeFormatInfo to set



Returns:

the current instance of TimeBox

public void onDateTimeFormatInfoChanged(DateTimeFormatInfo dateTimeFormatInfo)
Handles changes in the date-time format information and updates the string value.

dateTimeFormatInfo

the updated DateTimeFormatInfo

public boolean isOpenOnFocus()
Checks if the TimeBox is set to open on focus.

Returns:

true if set to open on focus, false otherwise.

public TimeBox setOpenOnFocus(boolean openOnFocus)
Configures the TimeBox to open on focus.

openOnFocus

true to open on focus, false otherwise.



Returns:

the current instance of TimeBox

public boolean isParseStrict()
Checks if parsing is strict.

Returns:

true if strict parsing, false otherwise.

public TimeBox setParseStrict(boolean parseStrict)
Configures whether parsing should be strict.

parseStrict

true for strict parsing, false otherwise.



Returns:

the current instance of TimeBox

public boolean isOpenOnClick()
Checks if the TimeBox is set to open on click.

Returns:

true if the TimeBox opens on click, false otherwise.

public TimeBox setOpenOnClick(boolean openOnClick)
Sets the behavior of the TimeBox to open on click or not.

openOnClick

true if the TimeBox should open on click, false otherwise.



Returns:

the current instance of TimeBox

public TimeBox withTimePicker(ChildHandler<TimeBox, TimePicker> handler)
Applies a handler to the TimePicker associated with this TimeBox.

handler

the handler to be applied to the TimePicker



Returns:

the current instance of TimeBox

public TimeBox withPopover(ChildHandler<TimeBox, Popover> handler)
Applies a handler to the Popover associated with this TimeBox.

handler

the handler to be applied to the Popover



Returns:

the current instance of TimeBox

API Docs: CustomInputBox

Constructors

public void CustomInputBox()
Default constructor that initializes the data list element and its options.
public void CustomInputBox(String label)
Constructor that initializes the input box with the given label.

label

the label for the input box

Public methods

public String getValue()
Retrieves the value of the custom input box. Check super implementation documentation.
public T setType(String type)
Sets the type for the input element.

type

the type for the input element



Returns:

the current instance, allowing for method chaining

public String getStringValue()
Retrieves the string representation of the value in the custom input box. Check super implementation documentation.
public T setEmptyAsNull(boolean emptyAsNull)
Determines whether to consider an empty value as null.

emptyAsNull

true if an empty value should be considered null; false otherwise



Returns:

the current instance, allowing for method chaining

public boolean isEmptyAsNull()
Checks if the custom input box considers an empty value as null.

Returns:

true if an empty value is considered null; false otherwise

public AutoValidator createAutoValidator(ApplyFunction autoValidate)
Creates an auto-validator for the custom input box. Check super implementation documentation.
public DataListElement getDataListElement()
Retrieves the data list element associated with the custom input box. Check super implementation documentation.
public Map<String, OptionElement> getDataListOptions()
Retrieves the data list options for the custom input box. Check super implementation documentation.

API Docs: TelephoneBox

Constructors

public void TelephoneBox()
Default constructor to create a telephone input box without any label.
public void TelephoneBox(String label)
Constructor that initializes the telephone input box with the given label.

label

the label for the telephone input box

Static methods

public static TelephoneBox create()
Static factory method to create a telephone input box without any label.

Returns:

a new instance of TelephoneBox

public static TelephoneBox create(String label)
Static factory method to create a telephone input box with the given label.

label

the label for the telephone input box



Returns:

a new instance of TelephoneBox with the specified label

Public methods

public String getType()
Retrieves the type of the input box, which is set to "tel" to accept telephone numbers. Check super implementation documentation.

API Docs: BaseTextBox

Constructors

public void BaseTextBox()
Default constructor to create a base text box with a default empty value.
public void BaseTextBox(String label)
Constructor that initializes the base text box with the given label.

label

the label for the base text box

Public methods

public String getStringValue()
Retrieves the string value of the base text box, which is the text input from the user. Check super implementation documentation.

Returns:

the current value of the base text box

public String getValue()
Retrieves the value of the base text box. If the value is empty and is set to be treated as null, this method will return null.



Returns:

the current value of the base text box or null if the value is empty and treated as null

API Docs: EmailBox

Constructors

public void EmailBox()
Default constructor. Initializes the email box with data list support.
public void EmailBox(String label)
Constructor that initializes the email box with the given label and data list support.

label

the label for the email box

Static methods

public static EmailBox create()
Factory method to create a new instance of EmailBox .

Returns:

a new instance of EmailBox

public static EmailBox create(String label)
Factory method to create a new instance of EmailBox with a label.

label

the label for the email box



Returns:

a new instance of EmailBox with the provided label

Public methods

public String getType()
Retrieves the input type for the email box, which is "email". Check super implementation documentation.

Returns:

the string "email"

public EmailBox setMultiple(boolean multiple)
Sets the "multiple" attribute for the email input element. This allows multiple email addresses.

multiple

true to allow multiple email addresses, false otherwise



Returns:

the current EmailBox instance for method chaining

public DataListElement getDataListElement()
Retrieves the data list element associated with the email box. Check super implementation documentation.

Returns:

the DataListElement instance for the email box

public Map<String, OptionElement> getDataListOptions()
Retrieves the data list options for the email box. Check super implementation documentation.

Returns:

a map containing the options for the email box's data list

API Docs: TextBox

Constructors

public void TextBox()
Default constructor. Initializes the text box.
public void TextBox(String label)
Constructor that initializes the text box with the given label.

label

the label for the text box

Static methods

public static TextBox create()
Factory method to create a new instance of TextBox .

Returns:

a new instance of TextBox

public static TextBox create(String label)
Factory method to create a new instance of TextBox with a label.

label

the label for the text box



Returns:

a new instance of TextBox with the provided label

Public methods

public String getType()
Retrieves the input type for the text box, which is "text". Check super implementation documentation.

Returns:

the string "text"

API Docs: PasswordBox

Constructors

public void PasswordBox()
Default constructor. Initializes the password box.
public void PasswordBox(String label)
Constructor that initializes the password box with the given label.

label

the label for the password box

Static methods

public static PasswordBox create()
Factory method to create a new instance of PasswordBox .

Returns:

a new instance of PasswordBox

public static PasswordBox create(String label)
Factory method to create a new instance of PasswordBox with a label.

label

the label for the password box



Returns:

a new instance of PasswordBox with the provided label

Public methods

public String getType()
Retrieves the input type for the password box, which is "password". Check super implementation documentation.

Returns:

the string "password"

API Docs: TextAreaBox

Constructors

public void TextAreaBox()
Creates a new TextAreaBox instance with default values.
public void TextAreaBox(String label)
Creates a new TextAreaBox instance with the specified label.

label

The label text for the TextAreaBox.

Static methods

public static TextAreaBox create()
Factory method to create a new instance of TextAreaBox .

Returns:

a new instance of TextAreaBox

public static TextAreaBox create(String label)
Factory method to create a new instance of TextAreaBox with a label.

label

the label for the text area



Returns:

a new instance of TextAreaBox with the provided label

Public methods

public TextAreaBox setRows(int rows)
Sets the number of rows for the text area.

rows

The number of rows to set.



Returns:

This `TextAreaBox` instance.

public String getStringValue()
Gets the string value of this TextAreaBox, which is equivalent to its current value.

Returns:

The string value of this TextAreaBox.

public TextAreaBox autoSize()
Enables auto-sizing for the text area, allowing it to adjust its height automatically as the content grows.

Returns:

This `TextAreaBox` instance.

public TextAreaBox fixedSize()
Disables auto-sizing for the text area, fixing its height to the specified number of rows.

Returns:

This `TextAreaBox` instance.

public String getType()
Gets the type of the text area field.

Returns:

The type, which is always "text".

public String getName()
Gets the name attribute of the text area.

Returns:

The name attribute value.

public TextAreaBox setName(String name)
Sets the name attribute for the text area.

name

The name attribute value to set.



Returns:

This `TextAreaBox` instance.

API Docs: SwitchButton

Constructors

public void SwitchButton(String label, String offTitle, String onTitle)
Constructor to initialize the SwitchButton with a label, off title, and on title.

label

the label of the switch button

offTitle

the title when switch is OFF

onTitle

the title when switch is ON

public void SwitchButton(String label, String onOffTitle)
Constructor to initialize the SwitchButton with a label and on/off title.

label

the label of the switch button

onOffTitle

the title for both ON and OFF states

public void SwitchButton(String label)
Constructor to initialize the SwitchButton with a label.

label

the label of the switch button

public void SwitchButton()
Default constructor to initialize the SwitchButton with default settings.

Static methods

public static SwitchButton create(String label, String offTitle, String onTitle)
Factory method to create a SwitchButton with specified label, off and on titles.

label

the label of the switch button

offTitle

the title when switch is OFF

onTitle

the title when switch is ON



Returns:

a new SwitchButton instance

public static SwitchButton create(String label, String onOffTitle)
Factory method to create a SwitchButton with specified label and on/off title.

label

the label of the switch button

onOffTitle

the title for both ON and OFF states



Returns:

a new SwitchButton instance

public static SwitchButton create()
Factory method to create a SwitchButton with no initial settings.

Returns:

a new SwitchButton instance

Public methods

public String getType()
Returns the type of the SwitchButton as a "checkbox".

Returns:

String representing the type "checkbox".

public Optional<Consumer<Event>> onChange()
Provides an event consumer for handling change events.

Returns:

Optional containing a Consumer for the change event.

public SwitchButton toggleChecked(boolean silent)
Toggles the checked state of the SwitchButton.

silent

if true, does not notify the change listeners.



Returns:

the current instance of SwitchButton .

public SwitchButton toggleChecked()
Toggles the checked state of the SwitchButton.

Returns:

the current instance of SwitchButton .

public SwitchButton toggleChecked(boolean checkedState, boolean silent)
Sets the checked state of the SwitchButton to the provided state.

checkedState

desired checked state.

silent

if true, does not notify the change listeners.



Returns:

the current instance of SwitchButton .

public Boolean getDefaultValue()
Returns the default value for the SwitchButton.

Returns:

the default value which is false if null.

public SwitchButton withValue(Boolean value, boolean silent)
Sets the value of the SwitchButton.

value

the desired value.

silent

if true, does not notify the change listeners.



Returns:

the current instance of SwitchButton .

public SwitchButton check()
Sets the SwitchButton to a checked state.

Returns:

the current instance of SwitchButton .

public SwitchButton uncheck()
Sets the SwitchButton to an unchecked state.

Returns:

the current instance of SwitchButton .

public SwitchButton check(boolean silent)
Sets the SwitchButton to a checked state.

silent

if true, does not notify the change listeners.



Returns:

the current instance of SwitchButton .

public SwitchButton uncheck(boolean silent)
Sets the SwitchButton to an unchecked state.

silent

if true, does not notify the change listeners.



Returns:

the current instance of SwitchButton .

public SwitchButton setOnTitle(String onTitle)
Sets the title for the "on" state of the SwitchButton.

onTitle

the title to be set for the "on" state.



Returns:

the current instance of SwitchButton .

public SwitchButton setOffTitle(String offTitle)
Sets the title for the "off" state of the SwitchButton.

offTitle

the title to be set for the "off" state.



Returns:

the current instance of SwitchButton .

public LazyChild<LabelElement> getOffLabelElement()
Gets a lazy child representing the "off" label element of the SwitchButton.

Returns:

the LazyChild for the "off" label element.

public LazyChild<LabelElement> getOnLabelElement()
Gets a lazy child representing the "on" label element of the SwitchButton.

Returns:

the LazyChild for the "on" label element.

public AutoValidator createAutoValidator(ApplyFunction autoValidate)
Creates an auto validator for the SwitchButton.

autoValidate

the ApplyFunction to be applied for auto-validation.



Returns:

an instance of AutoValidator for the SwitchButton.

public Boolean getValue()
Gets the value of the SwitchButton as a Boolean.

Returns:

the Boolean value representing the checked state of the SwitchButton.

public boolean isChecked()
Checks if the SwitchButton is in a checked state.

Returns:

true if the SwitchButton is checked, false otherwise.

public boolean isEmpty()
Checks if the SwitchButton is empty (unchecked).

Returns:

true if the SwitchButton is empty, false otherwise.

public boolean isEmptyIgnoreSpaces()
Checks if the SwitchButton is empty, ignoring spaces.

Returns:

true if the SwitchButton is empty, false otherwise.

public String getStringValue()
Gets the value of the SwitchButton as a string.

Returns:

a string representation of the Boolean value.

public SwitchButton grow()
Adds a CSS class to make the SwitchButton grow in size.

Returns:

the current instance of SwitchButton .

public SwitchButton ungrow()
Removes the CSS class that makes the SwitchButton grow in size.

Returns:

the current instance of SwitchButton .

public SwitchButton grow(boolean grow)
Adds or removes the CSS class to make the SwitchButton grow in size based on the provided boolean.

grow

true to add the CSS class and make the SwitchButton grow, false to remove it.



Returns:

the current instance of SwitchButton .

public SwitchButton condenseLabels()
Adds a CSS class to condense the labels of the SwitchButton.

Returns:

the current instance of SwitchButton .

public SwitchButton uncondenseLabels()
Removes the CSS class that condenses the labels of the SwitchButton.

Returns:

the current instance of SwitchButton .

public SwitchButton condenseLabels(boolean grow)
Adds or removes the CSS class to condense the labels of the SwitchButton based on the provided boolean.

grow

true to add the CSS class and condense the labels, false to remove it.



Returns:

the current instance of SwitchButton .

public String getName()
Gets the name attribute of the SwitchButton's input element.

Returns:

the name attribute value.

public SwitchButton setName(String name)
Sets the name attribute of the SwitchButton's input element.

name

the name attribute to be set.



Returns:

the current instance of SwitchButton .

API Docs: CheckBox

Constructors

public void CheckBox()
Initializes a new CheckBox instance.
public void CheckBox(String checkLabel)
Creates a CheckBox instance with a check label.

checkLabel

The label text displayed next to the checkbox.

public void CheckBox(String label, String checkLabel)
Creates a CheckBox instance with labels for both the checkbox field and the check label.

label

The label text for the checkbox field.

checkLabel

The label text displayed next to the checkbox.

Static methods

public static CheckBox create(String checkLabel)
Creates a CheckBox instance.

checkLabel

The label text displayed next to the checkbox.

public static CheckBox create(String label, String checkLabel)
Creates a CheckBox instance with an additional label.

label

The label text for the checkbox field.

checkLabel

The label text displayed next to the checkbox.

public static CheckBox create()
Creates a CheckBox instance without any labels.

Public methods

public Optional<Consumer<Event>> onChange()
Check super implementation documentation.

Returns an optional Consumer of Event that listens for change events on this CheckBox. When a change event occurs, this method checks if the CheckBox is enabled and not read-only. If both conditions are met, it updates the CheckBox's value based on its checked state.

Returns:

An optional Consumer of Event to handle change events on this CheckBox.

public CheckBox setCheckLabel(String checkLabel)
Sets the label text displayed next to the checkbox.

checkLabel

The label text for the checkbox.



Returns:

This CheckBox instance.

public CheckBox setCheckLabel(Node checkLabel)
Sets the label content displayed next to the checkbox using a DOM Node.

checkLabel

The DOM Node to be used as the label content.



Returns:

This CheckBox instance.

public CheckBox setCheckLabel(IsElement<?> checkLabel)
Sets the label content displayed next to the checkbox using an IsElement .

checkLabel

The IsElement to be used as the label content.



Returns:

This CheckBox instance.

public String getType()
Check super implementation documentation.

Gets the type of this input field, which is always "checkbox" for CheckBox instances.

Returns:

The type of this input field, which is "checkbox."

public CheckBox toggleChecked(boolean silent)
Toggles the checkbox's checked state, optionally without triggering change listeners.

silent

If true , change listeners will not be triggered; otherwise, they will.



Returns:

This CheckBox instance.

public CheckBox toggleChecked()
Toggles the checkbox's checked state and triggers change listeners.

Returns:

This CheckBox instance.

public CheckBox toggleChecked(boolean checkedState, boolean silent)
Toggles the checkbox's checked state, optionally without triggering change listeners.

checkedState

The desired checked state.

silent

If true , change listeners will not be triggered; otherwise, they will.



Returns:

This CheckBox instance.

public Boolean getDefaultValue()
Check super implementation documentation.

This method returns the default value for the CheckBox, which is false if no default value has been set.

Returns:

The default value of the CheckBox (false if not set).

public CheckBox withValue(Boolean value, boolean silent)
Check super implementation documentation.

This method sets the value of the CheckBox and allows the option to perform the operation silently (without triggering change listeners).

If the provided value is null , it will use the default value instead (if set).

value

The value to set.

silent

True to perform the operation silently, false otherwise.



Returns:

This CheckBox instance.

public CheckBox indeterminate()
Check super implementation documentation.

This method sets the CheckBox to an indeterminate state.

Returns:

This CheckBox instance.

public CheckBox determinate()
Check super implementation documentation.

This method sets the CheckBox to a determinate state.

Returns:

This CheckBox instance.

public CheckBox toggleIndeterminate(boolean indeterminate)
Check super implementation documentation.

This method toggles the indeterminate state of the CheckBox.

indeterminate

True to set to an indeterminate state, false otherwise.



Returns:

This CheckBox instance.

public CheckBox toggleIndeterminate()
Check super implementation documentation.

This method toggles the indeterminate state of the CheckBox.

Returns:

This CheckBox instance.

public CheckBox check()
Check super implementation documentation.

Checks the CheckBox, setting its value to true . If the CheckBox is currently paused for change listeners, the check operation can be silent. If not paused, it will trigger change listeners if any are registered.

Returns:

This CheckBox instance after the check operation.

public CheckBox uncheck()
Check super implementation documentation.

Unchecks the CheckBox, setting its value to false . If the CheckBox is currently paused for change listeners, the uncheck operation can be silent. If not paused, it will trigger change listeners if any are registered.

Returns:

This CheckBox instance after the uncheck operation.

public CheckBox check(boolean silent)
Check super implementation documentation.

This method checks the CheckBox, optionally allowing the operation to be performed silently (without triggering change listeners). It also sets the CheckBox to a determinate state.

silent

True to perform the operation silently, false otherwise.



Returns:

This CheckBox instance.

public CheckBox uncheck(boolean silent)
Check super implementation documentation.

This method unchecks the CheckBox, optionally allowing the operation to be performed silently (without triggering change listeners). It also sets the CheckBox to a determinate state.

silent

True to perform the operation silently, false otherwise.



Returns:

This CheckBox instance.

public boolean isChecked()
Check super implementation documentation.

This method checks whether the CheckBox is in a checked state.

Returns:

True if the CheckBox is checked, false otherwise.

public CheckBox filledIn()
Adds CSS class to style the CheckBox as filled in.

Returns:

This CheckBox instance.

public CheckBox filledOut()
Adds CSS class to style the CheckBox as filled out.

Returns:

This CheckBox instance.

public CheckBox setFilled(boolean filled)
Sets the filled state of the CheckBox, adding or removing the CSS class accordingly.

filled

True to style the CheckBox as filled in, false to style it as filled out.



Returns:

This CheckBox instance.

public Boolean getValue()
Check super implementation documentation.

This method returns the value of the CheckBox, which is the same as whether it's checked or not.

Returns:

True if the CheckBox is checked, false otherwise.

public boolean isEmpty()
Check super implementation documentation.

This method checks whether the CheckBox is empty, meaning it is not checked.

Returns:

True if the CheckBox is empty (unchecked), false otherwise.

public boolean isEmptyIgnoreSpaces()
Check super implementation documentation.

This method checks whether the CheckBox is empty, ignoring spaces.

Returns:

True if the CheckBox is empty (unchecked), false otherwise.

public String getStringValue()
Check super implementation documentation.

This method returns the string representation of the CheckBox's value, which is either "true" if checked or "false" if not checked.

Returns:

The string representation of the CheckBox's value.

public AutoValidator createAutoValidator(ApplyFunction autoValidate)
Check super implementation documentation.

This method creates an AutoValidator instance for the CheckBox, which is used to automatically validate the CheckBox's value.

autoValidate

The function to apply for auto-validation.



Returns:

An AutoValidator instance for the CheckBox.

public String getName()
Check super implementation documentation.

This method returns the name of the CheckBox.

Returns:

The name of the CheckBox.

public CheckBox setName(String name)
Check super implementation documentation.

This method sets the name attribute of the CheckBox's input element.

name

The name to set.



Returns:

This CheckBox instance.

public CheckBox withLabel(ChildHandler<CheckBox, LabelElement> handler)
Applies the given handler to the label element associated with this CheckBox. This allows you to customize the label element.

handler

The handler to apply to the label element.



Returns:

This CheckBox instance.

public CheckBox withLabelTextElement(ChildHandler<CheckBox, SpanElement> handler)
Applies the given handler to the label text element associated with this CheckBox. This allows you to customize the label text element.

handler

The handler to apply to the label text element.



Returns:

This CheckBox instance.

public LabelElement getCheckLabelElement()
Retrieves the label element associated with this CheckBox.

Returns:

The label element of this CheckBox.

public LazyChild<SpanElement> getCheckLabelTextElement()
Retrieves the lazy child element representing the label text associated with this CheckBox.

Returns:

The lazy child element of the label text associated with this CheckBox.

API Docs: NumberBox

Constructors

public void NumberBox()
Initializes the number box with default configurations.
public void NumberBox(String label)
Initializes the number box with a given label.

label

The label for the number box.

Public methods

public String getType()
Returns the type of the input field. In this case, a telephone input type is returned.

Returns:

String representation of the input type.

public V getValue()
Retrieves the current value of this number box. If the value cannot be parsed into a valid number format, the field is invalidated with an appropriate error message.

Returns:

The current numeric value or null if the value is not a valid number.

public V getValueOr(V defaultValue)
Retrieves the value if it is not null; otherwise, returns the provided default value.

defaultValue

the value to return if the actual value is null



Returns:

the actual value if present, or the default value if the actual value is null

public boolean isEmpty()
Determines if the current value of the input element is empty.

Returns:

true if the value is empty, false otherwise.

public boolean isEmptyIgnoreSpaces()
Determines if the current value of the input element is empty or just contains white spaces.

Returns:

true if the value is empty or contains only white spaces, false otherwise.

public String getStringValue()
Retrieves the current value of this number box as a string.

Returns:

The current string value of the input element.

public T setMinValue(V minValue)
Sets the minimum allowed value for this number box. The provided value will be formatted and set as the min attribute of the input element.

minValue

The numeric value to set as the minimum allowable value.



Returns:

This instance, to facilitate method chaining.

public T setMaxValue(V maxValue)
Sets the maximum allowed value for this number box. The provided value will be formatted and set as the max attribute of the input element.

maxValue

The numeric value to set as the maximum allowable value.



Returns:

This instance, to facilitate method chaining.

public T setStep(V step)
Sets the step value, which determines the legal number intervals, for this number box. The provided value will be formatted and set as the step attribute of the input element.

step

The numeric value to set as the step value.



Returns:

This instance, to facilitate method chaining.

public V getMaxValue()
Retrieves the maximum value allowed for this number box.

Returns:

The current maximum numeric value, or the default maximum value if not set.

public V getMinValue()
Retrieves the minimum value allowed for this number box.

Returns:

The current minimum numeric value, or the default minimum value if not set.

public V getStep()
Retrieves the current step value of this number box, which determines the legal number intervals.

Returns:

The current step numeric value or null if not set.

public T setMaxValueErrorMessage(String maxValueErrorMessage)
Sets a custom error message to be displayed when the entered number exceeds the maximum allowed value.

maxValueErrorMessage

The custom error message.



Returns:

This instance, to facilitate method chaining.

public T setMinValueErrorMessage(String minValueErrorMessage)
Sets a custom error message to be displayed when the entered number is below the minimum allowed value.

minValueErrorMessage

The custom error message.



Returns:

This instance, to facilitate method chaining.

public T setInvalidFormatMessage(String invalidFormatMessage)
Sets a custom error message to be displayed when the entered number format is invalid.

invalidFormatMessage

The custom error message.



Returns:

This instance, to facilitate method chaining.

public String getMaxValueErrorMessage()
Retrieves the custom error message set for exceeding the maximum value or provides a default message.

Returns:

The custom or default error message.

public String getMinValueErrorMessage()
Retrieves the custom error message set for being below the minimum value or provides a default message.

Returns:

The custom or default error message.

public String getInvalidFormatMessage()
Retrieves the custom error message set for invalid number format or provides a default message.

Returns:

The custom or default error message.

public T enableFormatting()
Enables the formatting of numbers displayed in the NumberBox.

Returns:

This instance, to facilitate method chaining.

public T disableFormatting()
Disables the formatting of numbers displayed in the NumberBox.

Returns:

This instance, to facilitate method chaining.

public T setNumberFormat(NumberFormatSupplier numberFormatSupplier)
Sets a supplier to use to get a custom number format to be used by this NumberBox. if null is provided, then use default supplier.

Returns:

same component.

public String getPattern()
Retrieves the custom pattern used for number formatting in this NumberBox, if any.

Returns:

The custom pattern string, or null if none has been set.

public T setPattern(String pattern)
Sets a custom pattern for number formatting in this NumberBox. After setting the pattern, the current value will be reformatted according to the new pattern.

pattern

The custom pattern string.



Returns:

This instance, to facilitate method chaining.

public double parseDouble(String value)
Attempts to parse a given string into a double value, using the current number format. If parsing fails with the current format and a custom pattern is set, it will try to parse using the default decimal format.

value

The string to parse.



Returns:

The parsed double value.

@throws NumberFormatException if the string cannot be parsed into a double.
public String getPlaceholder()
Retrieves the placeholder text displayed in the NumberBox when it is empty.

Returns:

The placeholder text.

public T setPlaceholder(String placeholder)
Sets the placeholder text to be displayed in the NumberBox when it is empty.

placeholder

The desired placeholder text.



Returns:

This instance, to facilitate method chaining.

public T setValueParser(Function<String, V> valueParser)
Sets a custom parser function to parse string values into the numeric type (V) of this NumberBox. If the provided parser is null, the current parser remains unchanged.

valueParser

The custom value parsing function.



Returns:

This instance, to facilitate method chaining.

public AutoValidator createAutoValidator(ApplyFunction autoValidate)
Creates an automatic validator for the NumberBox input.

autoValidate

A function to be called when automatic validation is triggered.



Returns:

A new instance of the InputAutoValidator for this NumberBox.

public T setPostfix(String postfix)
Sets the text content for the postfix element.

postfix

The desired postfix string.



Returns:

This instance, to facilitate method chaining.

public String getPostfix()
Retrieves the text content of the postfix element.

Returns:

The postfix text.

public T setPrefix(String prefix)
Sets the text content for the prefix element.

prefix

The desired prefix string.



Returns:

This instance, to facilitate method chaining.

public String getPrefix()
Retrieves the text content of the prefix element.

Returns:

The prefix text.

public T withPrefixElement()
Ensures the prefix element is initialized.

Returns:

This instance, to facilitate method chaining.

public T withPostfixElement()
Ensures the postfix element is initialized.

Returns:

This instance, to facilitate method chaining.

public String getName()
Retrieves the name attribute of the input element.

The name attribute specifies the name for an ` ` element. The name attribute is used to reference elements in a JavaScript, or to reference form data after a form is submitted.

Returns:

The name attribute value.

public T setName(String name)
Sets the name attribute for the input element.

The name attribute specifies the name for an ` ` element. This can be beneficial when sending data to the server or referencing it in scripts.

name

The desired name attribute value.



Returns:

This instance, to facilitate method chaining.

API Docs: LongBox

Constructors

public void LongBox()
Default constructor. Sets the default value of the box to 0.
public void LongBox(String label)
Constructor with a label.

label

The label to be used for the LongBox.

Static methods

public static LongBox create()
Creates a new instance of LongBox with default value set to 0.

Returns:

A new instance of LongBox.

public static LongBox create(String label)
Creates a new instance of LongBox with the given label.

label

The label to be used for the LongBox.



Returns:

A new instance of LongBox.

API Docs: IntegerBox

Constructors

public void IntegerBox()
Default constructor. Sets the default value of the box to 0.
public void IntegerBox(String label)
Constructor with a label.

label

The label to be used for the IntegerBox.

Static methods

public static IntegerBox create()
Creates a new instance of IntegerBox with default value set to 0.

Returns:

A new instance of IntegerBox.

public static IntegerBox create(String label)
Creates a new instance of IntegerBox with the given label.

label

The label to be used for the IntegerBox.



Returns:

A new instance of IntegerBox.

API Docs: DoubleBox

Constructors

public void DoubleBox()
Default constructor. Sets the default value of the box to 0.0.
public void DoubleBox(String label)
Constructor with a label.

label

The label to be used for the DoubleBox.

Static methods

public static DoubleBox create()
Creates a new instance of DoubleBox with a default value set to 0.0.

Returns:

A new instance of DoubleBox.

public static DoubleBox create(String label)
Creates a new instance of DoubleBox with the given label.

label

The label to be used for the DoubleBox.



Returns:

A new instance of DoubleBox.

API Docs: ShortBox

Constructors

public void ShortBox()
Default constructor. Sets the default value of the box to 0.
public void ShortBox(String label)
Constructor with a label.

label

The label to be used for the ShortBox.

Static methods

public static ShortBox create()
Creates a new instance of ShortBox with a default value set to 0.

Returns:

A new instance of ShortBox.

public static ShortBox create(String label)
Creates a new instance of ShortBox with the given label.

label

The label to be used for the ShortBox.



Returns:

A new instance of ShortBox.

API Docs: FloatBox

Constructors

public void FloatBox()
Default constructor. Sets the default value of the box to 0.0F.
public void FloatBox(String label)
Constructor with a label.

label

The label to be used for the FloatBox.

Static methods

public static FloatBox create()
Creates a new instance of FloatBox with a default value set to 0.0F.

Returns:

A new instance of FloatBox.

public static FloatBox create(String label)
Creates a new instance of FloatBox with the given label.

label

The label to be used for the FloatBox.



Returns:

A new instance of FloatBox.

API Docs: BigDecimalBox

Constructors

public void BigDecimalBox()
Default constructor. Sets the default value of the box to ZERO .
public void BigDecimalBox(String label)
Constructor with a label.

label

The label to be used for the BigDecimalBox.

Static methods

public static BigDecimalBox create()
Creates a new instance of BigDecimalBox with a default value set to ZERO .

Returns:

A new instance of BigDecimalBox.

public static BigDecimalBox create(String label)
Creates a new instance of BigDecimalBox with the given label.

label

The label to be used for the BigDecimalBox.



Returns:

A new instance of BigDecimalBox.

We are a group of passionate people who love what we do

Donate & Support Us