Class UITextBox

All Implemented Interfaces:
UIContextActions, UICopy, UIFocus, UIKeyFocus, UIMouseFocus, UIPaste, UITabFocus, LXLoopTask
Direct Known Subclasses:
UIFileNameBox

public class UITextBox extends UIInputBox implements UICopy, UIPaste
  • Constructor Details

    • UITextBox

      public UITextBox()
    • UITextBox

      public UITextBox(float w, float h)
    • UITextBox

      public UITextBox(float x, float y, float w, float h)
    • UITextBox

      public UITextBox(float w, float h, StringParameter parameter)
    • UITextBox

      public UITextBox(float x, float y, float w, float h, StringParameter parameter)
  • Method Details

    • getParameter

      public LXParameter getParameter()
      Specified by:
      getParameter in class UIParameterComponent
    • setParameter

      public UITextBox setParameter(StringParameter parameter)
    • getDescription

      public String getDescription()
      Description copied from class: UIObject
      Objects are encouraged to override this method providing a helpful String displayed to the user explaining the function of this UI component. If no help is available, return null rather than an empty String.
      Overrides:
      getDescription in class UIObject
      Returns:
      Helpful contextual string explaining function of this element
    • getValue

      public String getValue()
    • getValueString

      protected String getValueString()
      Specified by:
      getValueString in class UIInputBox
    • getInitialEditBufferValue

      protected String getInitialEditBufferValue()
      Overrides:
      getInitialEditBufferValue in class UIInputBox
    • setEmptyValueAllowed

      public UITextBox setEmptyValueAllowed(boolean isEmptyValueAllowed)
    • setValue

      public UITextBox setValue(String value)
    • setValue

      public UITextBox setValue(String value, boolean pushToParameter)
    • onValueChange

      protected void onValueChange(String value)
      Subclasses may override to handle value changes
      Parameters:
      value - New value being set
    • saveEditBuffer

      protected void saveEditBuffer(String editBuffer)
      Specified by:
      saveEditBuffer in class UIInputBox
    • setValidCharacters

      public UITextBox setValidCharacters(String validCharacters)
      Set a custom list of valid characters for this text box
      Parameters:
      validCharacters - Valid characters
      Returns:
      this
    • isValidTextCharacter

      public static boolean isValidTextCharacter(char keyChar)
    • isValidCharacter

      public boolean isValidCharacter(char keyChar)
      Specified by:
      isValidCharacter in class UIInputBox
    • onMousePressed

      protected void onMousePressed(MouseEvent mouseEvent, float mx, float my)
      Description copied from class: UIEventHandler
      Subclasses override to receive mouse events
      Overrides:
      onMousePressed in class UIInputBox
      Parameters:
      mouseEvent - Mouse event
      mx - x-coordinate
      my - y-coordinate
    • focusKeyPress

      public void focusKeyPress(KeyEvent keyEvent, char keyChar, int keyCode)
      Gives the text box focus and processes the key event which just occurred which would give it focus
      Parameters:
      keyEvent - Key Event
      keyChar - Key character
      keyCode - Key code
    • onCopy

      public LXClipboardItem onCopy()
      Specified by:
      onCopy in interface UICopy
    • onPaste

      public void onPaste(LXClipboardItem item)
      Specified by:
      onPaste in interface UIPaste
    • dispose

      public void dispose()
      Overrides:
      dispose in class UIObject