Package net.minecraft.client.gui.fonts
Class TextInputUtil
- java.lang.Object
-
- net.minecraft.client.gui.fonts.TextInputUtil
-
public class TextInputUtil extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private int
cursorPos
private java.util.function.Supplier<java.lang.String>
getClipboardFn
private java.util.function.Supplier<java.lang.String>
getMessageFn
private int
selectionPos
private java.util.function.Consumer<java.lang.String>
setClipboardFn
private java.util.function.Consumer<java.lang.String>
setMessageFn
private java.util.function.Predicate<java.lang.String>
stringValidator
-
Constructor Summary
Constructors Constructor Description 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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
charTyped(char p_216894_1_)
private int
clampToMsgLength(int p_238589_1_)
void
copy()
static java.util.function.Supplier<java.lang.String>
createClipboardGetter(Minecraft p_238570_0_)
static java.util.function.Consumer<java.lang.String>
createClipboardSetter(Minecraft p_238582_0_)
void
cut()
private java.lang.String
deleteSelection(java.lang.String p_238583_1_)
static java.lang.String
getClipboardContents(Minecraft p_238576_0_)
int
getCursorPos()
private java.lang.String
getSelected(java.lang.String p_238578_1_)
int
getSelectionPos()
void
insertText(java.lang.String p_216892_1_)
private void
insertText(java.lang.String p_238572_1_, java.lang.String p_238572_2_)
boolean
isSelecting()
boolean
keyPressed(int p_216897_1_)
void
moveByChars(int p_238569_1_, boolean p_238569_2_)
void
moveByWords(int p_238575_1_, boolean p_238575_2_)
void
paste()
void
removeCharsFromCursor(int p_238586_1_)
private void
resetSelectionIfNeeded(boolean p_238573_1_)
void
selectAll()
static void
setClipboardContents(Minecraft p_238571_0_, java.lang.String p_238571_1_)
void
setCursorPos(int p_238581_1_, boolean p_238581_2_)
void
setCursorToEnd()
private void
setCursorToEnd(boolean p_238584_1_)
private void
setCursorToStart(boolean p_238579_1_)
void
setSelectionRange(int p_238568_1_, int p_238568_2_)
-
-
-
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()
-
-