Class MultiLineEditBox

All Implemented Interfaces:
GuiEventListener, Renderable, TabOrderedElement, LayoutElement, NarratableEntry, NarrationSupplier, IAbstractWidgetExtension

public class MultiLineEditBox extends AbstractTextAreaWidget
  • Field Details

  • Constructor Details

    • MultiLineEditBox

      public MultiLineEditBox(Font pFont, int pX, int pY, int pWidth, int pHeight, Component pPlaceholder, Component pMessage)
  • Method Details

    • setCharacterLimit

      public void setCharacterLimit(int pCharacterLimit)
    • setValueListener

      public void setValueListener(Consumer<String> pValueListener)
    • setValue

      public void setValue(String pFullText)
    • getValue

      public String getValue()
    • updateWidgetNarration

      public void updateWidgetNarration(NarrationElementOutput p_259393_)
      Specified by:
      updateWidgetNarration in class AbstractWidget
    • onClick

      public void onClick(double p_388397_, double p_388871_)
      Overrides:
      onClick in class AbstractWidget
    • onDrag

      protected void onDrag(double p_387147_, double p_387062_, double p_388546_, double p_388296_)
      Overrides:
      onDrag in class AbstractWidget
    • keyPressed

      public boolean keyPressed(int p_239433_, int p_239434_, int p_239435_)
      Description copied from interface: GuiEventListener
      Called when a keyboard key is pressed within the GUI element.

      Specified by:
      keyPressed in interface GuiEventListener
      Overrides:
      keyPressed in class AbstractTextAreaWidget
      Parameters:
      p_239433_ - the key code of the pressed key.
      p_239434_ - the scan code of the pressed key.
      p_239435_ - the keyboard modifiers.
      Returns:
      true if the event is consumed, false otherwise.
    • charTyped

      public boolean charTyped(char p_239387_, int p_239388_)
      Description copied from interface: GuiEventListener
      Called when a character is typed within the GUI element.

      Parameters:
      p_239387_ - the code point of the typed character.
      p_239388_ - the keyboard modifiers.
      Returns:
      true if the event is consumed, false otherwise.
    • renderContents

      protected void renderContents(GuiGraphics p_283676_, int p_281538_, int p_283033_, float p_281767_)
      Specified by:
      renderContents in class AbstractTextAreaWidget
    • renderDecorations

      protected void renderDecorations(GuiGraphics p_282551_)
      Overrides:
      renderDecorations in class AbstractTextAreaWidget
    • getInnerHeight

      public int getInnerHeight()
      Specified by:
      getInnerHeight in class AbstractTextAreaWidget
    • scrollRate

      protected double scrollRate()
      Specified by:
      scrollRate in class AbstractScrollArea
    • renderHighlight

      private void renderHighlight(GuiGraphics pGuiGraphics, int pMinX, int pMinY, int pMaxX, int pMaxY)
    • scrollToCursor

      private void scrollToCursor()
    • seekCursorScreen

      private void seekCursorScreen(double pMouseX, double pMouseY)
    • setFocused

      public void setFocused(boolean p_295271_)
      Description copied from interface: GuiEventListener
      Sets the focus state of the GUI element.
      Specified by:
      setFocused in interface GuiEventListener
      Overrides:
      setFocused in class AbstractWidget
      Parameters:
      p_295271_ - true to apply focus, false to remove focus