Class GeneralMultilineEditorCopy

java.lang.Object
net.minecraft.client.gui.widget.ClickableWidget
io.github.zhengzhengyiyi.gui.widget.AbstractEditor
io.github.zhengzhengyiyi.gui.widget.GeneralMultilineEditorCopy
All Implemented Interfaces:
net.minecraft.client.gui.Drawable, net.minecraft.client.gui.Element, net.minecraft.client.gui.Narratable, net.minecraft.client.gui.navigation.Navigable, net.minecraft.client.gui.Selectable, net.minecraft.client.gui.widget.Widget

public class GeneralMultilineEditorCopy extends AbstractEditor
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.minecraft.client.gui.Selectable

    net.minecraft.client.gui.Selectable.SelectionType
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
     
    static int
     
     
     

    Fields inherited from class net.minecraft.client.gui.widget.ClickableWidget

    active, alpha, height, hovered, visible, width
  • Constructor Summary

    Constructors
    Constructor
    Description
    GeneralMultilineEditorCopy(int x, int y, int width, int height, net.minecraft.text.Text message)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    appendClickableNarrations(net.minecraft.client.gui.screen.narration.NarrationMessageBuilder builder)
     
    boolean
    charTyped(net.minecraft.client.input.CharInput input)
     
    void
    Ends the current search operation.
    void
    Finds the next search match.
    void
    Finds the previous search match.
    int
    Gets the current search match index (1-based).
    int
    Gets the current cursor position.
     
     
    int
    Gets the number of search matches found.
    Gets the current text content of the editor.
    void
    Inserts text at the current cursor position.
    boolean
    Checks if a search is currently active.
    boolean
    keyPressed(net.minecraft.client.input.KeyInput input)
     
    boolean
    mouseClicked(net.minecraft.client.gui.Click click, boolean doubled)
     
    boolean
    mouseDragged(net.minecraft.client.gui.Click click, double offsetX, double offsetY)
     
    boolean
    mouseReleased(net.minecraft.client.gui.Click click)
     
    boolean
    mouseScrolled(double mouseX, double mouseY, double amount)
     
    boolean
    mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount)
     
    protected void
    renderWidget(net.minecraft.client.gui.DrawContext context, int mouseX, int mouseY, float delta)
     
    void
    Sets the listener for text change events.
    void
    setCursorPosition(int position)
    Sets the cursor position.
    void
    setEditable(boolean editable)
    Sets whether the editor is editable.
    void
     
    void
    Sets the text content of the editor.
    void
    Starts a text search with the given query.

    Methods inherited from class net.minecraft.client.gui.widget.ClickableWidget

    appendDefaultNarrations, appendNarrations, drawScrollableText, drawScrollableText, drawScrollableText, forEachChild, getBottom, getHeight, getMessage, getNarrationMessage, getNarrationMessage, getNavigationFocus, getNavigationOrder, getNavigationPath, getRight, getType, getWidth, getX, getY, isFocused, isHovered, isInteractable, isMouseOver, isSelected, isValidClickButton, onClick, onDrag, onRelease, playClickSound, playDownSound, render, setAlpha, setDimensions, setDimensionsAndPosition, setFocused, setHeight, setMessage, setNavigationOrder, setTooltip, setTooltipDelay, setWidth, setX, setY

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.client.gui.Element

    getBorder, getFocusedPath, isClickable, keyReleased, mouseMoved

    Methods inherited from interface net.minecraft.client.gui.Selectable

    getNarratedParts

    Methods inherited from interface net.minecraft.client.gui.widget.Widget

    setPosition
  • Field Details

    • text

      public String text
    • maxVisibleLines

      public static int maxVisibleLines
    • lastCursorX

      public int lastCursorX
    • searchQuery

      public String searchQuery
  • Constructor Details

    • GeneralMultilineEditorCopy

      public GeneralMultilineEditorCopy(int x, int y, int width, int height, net.minecraft.text.Text message)
  • Method Details

    • getFileTypeFromName

      public FileType getFileTypeFromName(String fileName)
    • renderWidget

      protected void renderWidget(net.minecraft.client.gui.DrawContext context, int mouseX, int mouseY, float delta)
      Specified by:
      renderWidget in class net.minecraft.client.gui.widget.ClickableWidget
    • mouseClicked

      public boolean mouseClicked(net.minecraft.client.gui.Click click, boolean doubled)
      Specified by:
      mouseClicked in interface net.minecraft.client.gui.Element
      Overrides:
      mouseClicked in class net.minecraft.client.gui.widget.ClickableWidget
    • mouseScrolled

      public boolean mouseScrolled(double mouseX, double mouseY, double amount)
    • mouseScrolled

      public boolean mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount)
    • keyPressed

      public boolean keyPressed(net.minecraft.client.input.KeyInput input)
    • charTyped

      public boolean charTyped(net.minecraft.client.input.CharInput input)
    • appendClickableNarrations

      protected void appendClickableNarrations(net.minecraft.client.gui.screen.narration.NarrationMessageBuilder builder)
      Specified by:
      appendClickableNarrations in class net.minecraft.client.gui.widget.ClickableWidget
    • getText

      public String getText()
      Description copied from class: AbstractEditor
      Gets the current text content of the editor.
      Specified by:
      getText in class AbstractEditor
      Returns:
      the text content
    • setText

      public void setText(String text)
      Description copied from class: AbstractEditor
      Sets the text content of the editor.
      Specified by:
      setText in class AbstractEditor
      Parameters:
      text - the new text content
    • setEditable

      public void setEditable(boolean editable)
      Description copied from class: AbstractEditor
      Sets whether the editor is editable.
      Specified by:
      setEditable in class AbstractEditor
      Parameters:
      editable - true if the editor should be editable
    • setChangedListener

      public void setChangedListener(Consumer<String> changedListener)
      Description copied from class: AbstractEditor
      Sets the listener for text change events.
      Specified by:
      setChangedListener in class AbstractEditor
      Parameters:
      changedListener - the consumer to call when text changes
    • insertTextAtCursor

      public void insertTextAtCursor(String text)
      Description copied from class: AbstractEditor
      Inserts text at the current cursor position.
      Specified by:
      insertTextAtCursor in class AbstractEditor
      Parameters:
      text - the text to insert
    • getCursorPosition

      public int getCursorPosition()
      Description copied from class: AbstractEditor
      Gets the current cursor position.
      Specified by:
      getCursorPosition in class AbstractEditor
      Returns:
      the cursor position
    • setCursorPosition

      public void setCursorPosition(int position)
      Description copied from class: AbstractEditor
      Sets the cursor position.
      Specified by:
      setCursorPosition in class AbstractEditor
      Parameters:
      position - the new cursor position
    • setFileName

      public void setFileName(String v)
    • getFileName

      public String getFileName()
    • startSearch

      public void startSearch(String query)
      Description copied from class: AbstractEditor
      Starts a text search with the given query.
      Specified by:
      startSearch in class AbstractEditor
      Parameters:
      query - the search query
    • findNext

      public void findNext()
      Description copied from class: AbstractEditor
      Finds the next search match.
      Specified by:
      findNext in class AbstractEditor
    • findPrevious

      public void findPrevious()
      Description copied from class: AbstractEditor
      Finds the previous search match.
      Specified by:
      findPrevious in class AbstractEditor
    • endSearch

      public void endSearch()
      Description copied from class: AbstractEditor
      Ends the current search operation.
      Specified by:
      endSearch in class AbstractEditor
    • isSearching

      public boolean isSearching()
      Description copied from class: AbstractEditor
      Checks if a search is currently active.
      Specified by:
      isSearching in class AbstractEditor
      Returns:
      true if searching
    • getSearchMatchCount

      public int getSearchMatchCount()
      Description copied from class: AbstractEditor
      Gets the number of search matches found.
      Specified by:
      getSearchMatchCount in class AbstractEditor
      Returns:
      the match count
    • getCurrentSearchIndex

      public int getCurrentSearchIndex()
      Description copied from class: AbstractEditor
      Gets the current search match index (1-based).
      Specified by:
      getCurrentSearchIndex in class AbstractEditor
      Returns:
      the current match index
    • mouseDragged

      public boolean mouseDragged(net.minecraft.client.gui.Click click, double offsetX, double offsetY)
      Specified by:
      mouseDragged in interface net.minecraft.client.gui.Element
      Overrides:
      mouseDragged in class net.minecraft.client.gui.widget.ClickableWidget
    • mouseReleased

      public boolean mouseReleased(net.minecraft.client.gui.Click click)
      Specified by:
      mouseReleased in interface net.minecraft.client.gui.Element
      Overrides:
      mouseReleased in class net.minecraft.client.gui.widget.ClickableWidget