net.minecraft.client.gui.widget

public class TextFieldWidget

extends ClickableWidget

All mapped superinterfaces:

Widget, Drawable, Element, Navigable, Selectable, Narratable

net.minecraft.client.gui.components.EditBox
net.minecraft.class_342
net.minecraft.client.gui.widget.TextFieldWidget

Field summary

Modifier and TypeField
private static final ButtonTextures
SPRITES
field_45914
TEXTURES
public static final int
BACKWARDS
field_32194
field_32194
public static final int
FORWARDS
field_32195
field_32195
public static final int
DEFAULT_TEXT_COLOR
field_32196
DEFAULT_EDITABLE_COLOR
public static final Style
DEFAULT_HINT_STYLE
field_62465
PLACEHOLDER_STYLE
public static final Style
SEARCH_HINT_STYLE
field_62466
SEARCH_STYLE
private final TextRenderer
font
field_2105
textRenderer
private String
value
field_2092
text
private int
maxLength
field_2108
maxLength
private boolean
bordered
field_2095
drawsBackground
private boolean
canLoseFocus
field_2096
focusUnlocked
private boolean
isEditable
field_2094
editable
private boolean
centered
field_60437
centered
private boolean
textShadow
field_60438
textShadow
private boolean
invertHighlightedTextColor
field_63506
invertSelectionBackground
private int
displayPos
field_2103
firstCharacterIndex
private int
cursorPos
field_2102
selectionStart
private int
highlightPos
field_2101
selectionEnd
private int
textColor
field_2100
editableColor
private int
textColorUneditable
field_2098
uneditableColor
private String
suggestion
field_2106
suggestion
private Consumer<String>
responder
field_2088
changedListener
private final List<TextFieldWidget$Formatter>
formatters
field_62008
formatters
private Text
hint
field_41100
placeholder
private ImePreEditWidget
preeditOverlay
field_1_2068
preEditWidget
private long
focusedTime
field_45352
lastSwitchFocusTime
private int
textX
field_60435
textX
private int
textY
field_60436
textY

Constructor summary

ModifierConstructor
public (TextRenderer textRenderer, int width, int height, Text text)
public (TextRenderer textRenderer, int x, int y, int width, int height, Text text)
public (TextRenderer textRenderer, int x, int y, int width, int height, TextFieldWidget copyFrom, Text text)

Method summary

Modifier and TypeMethod
public void
setResponder(Consumer<String> responder)
method_1863(Consumer<String> arg0)
setChangedListener(Consumer<String> changedListener)
public void
addFormatter(EditBox$TextFormatter formatter)
method_73210(class_342$class_11734 arg0)
addFormatter(TextFieldWidget$Formatter formatter)
protected MutableText
createNarrationMessage()
method_25360()
getNarrationMessage()
public void
setValue(String value)
method_1852(String arg0)
setText(String text)
public String
getValue()
method_1882()
getText()
public String
getHighlighted()
method_1866()
getSelectedText()
public void
setX(int x)
method_46421(int arg0)
setX(int arg0)
public void
setY(int y)
method_46419(int arg0)
setY(int arg0)
public void
insertText(String input)
method_1867(String arg0)
write(String text)
private void
onValueChange(String value)
method_1874(String arg0)
onChanged(String newText)
private void
deleteText(int dir, boolean wholeWord)
method_16873(int arg0, boolean arg1)
erase(int offset, boolean words)
public void
deleteWords(int dir)
method_1877(int arg0)
eraseWords(int wordOffset)
public void
deleteChars(int dir)
method_1878(int arg0)
eraseCharacters(int characterOffset)
public void
deleteCharsToPos(int pos)
method_55506(int arg0)
eraseCharactersTo(int position)
public int
getWordPosition(int dir)
method_1853(int arg0)
getWordSkipPosition(int wordOffset)
private int
getWordPosition(int dir, int from)
method_1869(int arg0, int arg1)
getWordSkipPosition(int wordOffset, int cursorPosition)
private int
getWordPosition(int dir, int from, boolean stripSpaces)
method_1864(int arg0, int arg1, boolean arg2)
getWordSkipPosition(int wordOffset, int cursorPosition, boolean skipOverSpaces)
public void
moveCursor(int dir, boolean hasShiftDown)
method_1855(int arg0, boolean arg1)
moveCursor(int offset, boolean shiftKeyPressed)
private int
getCursorPos(int dir)
method_27537(int arg0)
getCursorPosWithOffset(int offset)
public void
moveCursorTo(int dir, boolean extendSelection)
method_1883(int arg0, boolean arg1)
setCursor(int cursor, boolean select)
public void
setCursorPosition(int pos)
method_1875(int arg0)
setSelectionStart(int cursor)
public void
moveCursorToStart(boolean hasShiftDown)
method_1870(boolean arg0)
setCursorToStart(boolean shiftKeyPressed)
public void
moveCursorToEnd(boolean hasShiftDown)
method_1872(boolean arg0)
setCursorToEnd(boolean shiftKeyPressed)
public boolean
keyPressed(KeyEvent event)
method_25404(class_11908 arg0)
keyPressed(KeyInput arg0)
public boolean
canConsumeInput()
method_20315()
isActive()
public boolean
charTyped(CharacterEvent event)
method_25400(class_11905 arg0)
charTyped(CharInput arg0)
public boolean
preeditUpdated(PreeditEvent event)
method_1_2559(class_1_359 arg0)
preEdit(ImePreEditInput arg0)
private int
findClickedPositionInText(MouseButtonEvent event)
method_74215(class_11909 arg0)
calculateCursorPos(Click click)
private void
selectWord(MouseButtonEvent event)
method_74216(class_11909 arg0)
selectWord(Click click)
public void
onClick(MouseButtonEvent event, boolean doubleClick)
method_25348(class_11909 arg0, boolean arg1)
onClick(Click arg0, boolean arg1)
protected void
onDrag(MouseButtonEvent event, double dx, double dy)
method_25349(class_11909 arg0, double arg1, double arg2)
onDrag(Click arg0, double arg1, double arg2)
public void
playDownSound(SoundManager soundManager)
method_25354(class_1144 arg0)
playDownSound(SoundManager arg0)
public void
extractWidgetRenderState(GuiGraphicsExtractor graphics, int mouseX, int mouseY, float a)
method_48579(class_332 arg0, int arg1, int arg2, float arg3)
renderWidget(DrawContext arg0, int arg1, int arg2, float arg3)
private OrderedText
applyFormat(String text, int offset)
method_73211(String arg0, int arg1)
format(String string, int firstCharacterIndex)
private void
updateTextPosition()
method_71504()
updateTextPosition()
public void
setMaxLength(int maxLength)
method_1880(int arg0)
setMaxLength(int maxLength)
private int
getMaxLength()
method_1861()
getMaxLength()
public int
getCursorPosition()
method_1881()
getCursor()
public boolean
isBordered()
method_1851()
drawsBackground()
public void
setBordered(boolean bordered)
method_1858(boolean arg0)
setDrawsBackground(boolean drawsBackground)
public void
setTextColor(int textColor)
method_1868(int arg0)
setEditableColor(int editableColor)
public void
setTextColorUneditable(int textColorUneditable)
method_1860(int arg0)
setUneditableColor(int uneditableColor)
public void
setFocused(boolean focused)
method_25365(boolean arg0)
setFocused(boolean arg0)
private boolean
isEditable()
method_20316()
isEditable()
public void
setEditable(boolean isEditable)
method_1888(boolean arg0)
setEditable(boolean editable)
private boolean
isCentered()
method_71505()
isCentered()
public void
setCentered(boolean centered)
method_71502(boolean arg0)
setCentered(boolean centered)
public void
setTextShadow(boolean textShadow)
method_71503(boolean arg0)
setTextShadow(boolean textShadow)
public void
setInvertHighlightedTextColor(boolean invertHighlightedTextColor)
method_75351(boolean arg0)
setInvertSelectionBackground(boolean invertSelectionBackground)
public int
getInnerWidth()
method_1859()
getInnerWidth()
public void
setHighlightPos(int pos)
method_1884(int arg0)
setSelectionEnd(int index)
private void
scrollTo(int pos)
method_52719(int arg0)
updateFirstCharacterIndex(int cursor)
public void
setCanLoseFocus(boolean canLoseFocus)
method_1856(boolean arg0)
setFocusUnlocked(boolean focusUnlocked)
public boolean
isVisible()
method_1885()
isVisible()
public void
setVisible(boolean visible)
method_1862(boolean arg0)
setVisible(boolean visible)
public void
setSuggestion(String suggestion)
method_1887(String arg0)
setSuggestion(String suggestion)
public int
getScreenX(int charIndex)
method_1889(int arg0)
getCharacterX(int index)
public void
updateWidgetNarration(NarrationElementOutput output)
method_47399(class_6382 arg0)
appendClickableNarrations(NarrationMessageBuilder arg0)
public void
setHint(Component hint)
method_47404(class_2561 arg0)
setPlaceholder(Text placeholder)