Class TextInputUtil


  • public class TextInputUtil
    extends java.lang.Object
    • Field Detail

      • getMessageFn

        private final java.util.function.Supplier<java.lang.String> getMessageFn
      • setMessageFn

        private final java.util.function.Consumer<java.lang.String> setMessageFn
      • getClipboardFn

        private final java.util.function.Supplier<java.lang.String> getClipboardFn
      • setClipboardFn

        private final java.util.function.Consumer<java.lang.String> setClipboardFn
      • stringValidator

        private final java.util.function.Predicate<java.lang.String> stringValidator
      • cursorPos

        private int cursorPos
      • selectionPos

        private int selectionPos
    • Constructor Detail

      • TextInputUtil

        public TextInputUtil​(java.util.function.Supplier<java.lang.String> p_i232265_1_,
                             java.util.function.Consumer<java.lang.String> p_i232265_2_,
                             java.util.function.Supplier<java.lang.String> p_i232265_3_,
                             java.util.function.Consumer<java.lang.String> p_i232265_4_,
                             java.util.function.Predicate<java.lang.String> p_i232265_5_)
    • Method Detail

      • createClipboardGetter

        public static java.util.function.Supplier<java.lang.String> createClipboardGetter​(Minecraft p_238570_0_)
      • getClipboardContents

        public static java.lang.String getClipboardContents​(Minecraft p_238576_0_)
      • createClipboardSetter

        public static java.util.function.Consumer<java.lang.String> createClipboardSetter​(Minecraft p_238582_0_)
      • setClipboardContents

        public static void setClipboardContents​(Minecraft p_238571_0_,
                                                java.lang.String p_238571_1_)
      • charTyped

        public boolean charTyped​(char p_216894_1_)
      • keyPressed

        public boolean keyPressed​(int p_216897_1_)
      • clampToMsgLength

        private int clampToMsgLength​(int p_238589_1_)
      • insertText

        private void insertText​(java.lang.String p_238572_1_,
                                java.lang.String p_238572_2_)
      • insertText

        public void insertText​(java.lang.String p_216892_1_)
      • resetSelectionIfNeeded

        private void resetSelectionIfNeeded​(boolean p_238573_1_)
      • moveByChars

        public void moveByChars​(int p_238569_1_,
                                boolean p_238569_2_)
      • moveByWords

        public void moveByWords​(int p_238575_1_,
                                boolean p_238575_2_)
      • removeCharsFromCursor

        public void removeCharsFromCursor​(int p_238586_1_)
      • cut

        public void cut()
      • paste

        public void paste()
      • copy

        public void copy()
      • selectAll

        public void selectAll()
      • getSelected

        private java.lang.String getSelected​(java.lang.String p_238578_1_)
      • deleteSelection

        private java.lang.String deleteSelection​(java.lang.String p_238583_1_)
      • setCursorToStart

        private void setCursorToStart​(boolean p_238579_1_)
      • setCursorToEnd

        public void setCursorToEnd()
      • setCursorToEnd

        private void setCursorToEnd​(boolean p_238584_1_)
      • getCursorPos

        public int getCursorPos()
      • setCursorPos

        public void setCursorPos​(int p_238581_1_,
                                 boolean p_238581_2_)
      • getSelectionPos

        public int getSelectionPos()
      • setSelectionRange

        public void setSelectionRange​(int p_238568_1_,
                                      int p_238568_2_)
      • isSelecting

        public boolean isSelecting()