Class EditBox
java.lang.Object
net.minecraft.client.gui.GuiComponent
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.EditBox
- All Implemented Interfaces:
GuiEventListener
,Widget
,NarratableEntry
,NarrationSupplier
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry
NarratableEntry.NarrationPriority
-
Field Summary
Modifier and TypeFieldDescriptionprivate static int
static int
private static int
private static int
private boolean
private boolean
private static String
private static int
private static int
private int
static int
private int
private Font
private BiFunction<String,Integer,FormattedCharSequence>
static int
private int
private int
private boolean
private int
private boolean
private String
private int
private int
private String
Fields inherited from class net.minecraft.client.gui.components.AbstractWidget
active, alpha, height, isHovered, packedFGColor, UNSET_FG_COLOR, visible, WIDGETS_LOCATION, width, x, y
Fields inherited from class net.minecraft.client.gui.GuiComponent
BACKGROUND_LOCATION, GUI_ICONS_LOCATION, STATS_ICON_LOCATION
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
changeFocus(boolean p_94172_)
boolean
charTyped(char p_94122_, int p_94123_)
protected MutableComponent
void
deleteChars(int p_94181_)
private void
deleteText(int p_94218_)
void
deleteWords(int p_94177_)
private int
getCursorPos(int p_94221_)
int
int
private int
int
getScreenX(int p_94212_)
getValue()
int
getWordPosition(int p_94185_)
private int
getWordPosition(int p_94129_, int p_94130_)
private int
getWordPosition(int p_94141_, int p_94142_, boolean p_94143_)
void
insertText(String p_94165_)
private boolean
private boolean
boolean
isMouseOver(double p_94157_, double p_94158_)
boolean
boolean
keyPressed(int p_94132_, int p_94133_, int p_94134_)
boolean
mouseClicked(double p_94125_, double p_94126_, int p_94127_)
void
moveCursor(int p_94189_)
void
moveCursorTo(int p_94193_)
void
void
protected void
onFocusedChanged(boolean p_94170_)
private void
onValueChange(String p_94175_)
void
renderButton(PoseStack p_94160_, int p_94161_, int p_94162_, float p_94163_)
private void
renderHighlight(int p_94136_, int p_94137_, int p_94138_, int p_94139_)
void
setBordered(boolean p_94183_)
void
setCanLoseFocus(boolean p_94191_)
void
setCursorPosition(int p_94197_)
void
setEditable(boolean p_94187_)
void
void
setFocus(boolean p_94179_)
void
setFormatter(BiFunction<String,Integer,FormattedCharSequence> p_94150_)
void
setHighlightPos(int p_94209_)
void
setMaxLength(int p_94200_)
void
setResponder(Consumer<String> p_94152_)
void
setSuggestion(String p_94168_)
void
setTextColor(int p_94203_)
void
setTextColorUneditable(int p_94206_)
void
void
setVisible(boolean p_94195_)
void
setX(int p_94215_)
void
tick()
void
updateNarration(NarrationElementOutput p_169009_)
Methods inherited from class net.minecraft.client.gui.components.AbstractWidget
clearFGColor, clicked, defaultButtonNarrationText, getFGColor, getHeight, getMessage, getWidth, getYImage, isActive, isFocused, isHovered, isValidClickButton, mouseDragged, mouseReleased, narrationPriority, onClick, onDrag, onRelease, playDownSound, render, renderBg, renderToolTip, setAlpha, setFGColor, setFocused, setHeight, setMessage, setWidth, wrapDefaultNarrationMessage
Methods inherited from class net.minecraft.client.gui.GuiComponent
blit, blit, blit, blit, blit, blitOutlineBlack, drawCenteredString, drawCenteredString, drawCenteredString, drawString, drawString, drawString, fill, fillGradient, fillGradient, fillGradient, getBlitOffset, hLine, setBlitOffset, vLine
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.components.events.GuiEventListener
keyReleased, mouseDragged, mouseMoved, mouseReleased, mouseScrolled
-
Field Details
-
BACKWARDS
public static final int BACKWARDS- See Also:
- Constant Field Values
-
FORWARDS
public static final int FORWARDS- See Also:
- Constant Field Values
-
CURSOR_INSERT_WIDTH
private static final int CURSOR_INSERT_WIDTH- See Also:
- Constant Field Values
-
CURSOR_INSERT_COLOR
private static final int CURSOR_INSERT_COLOR- See Also:
- Constant Field Values
-
CURSOR_APPEND_CHARACTER
- See Also:
- Constant Field Values
-
DEFAULT_TEXT_COLOR
public static final int DEFAULT_TEXT_COLOR- See Also:
- Constant Field Values
-
BORDER_COLOR_FOCUSED
private static final int BORDER_COLOR_FOCUSED- See Also:
- Constant Field Values
-
BORDER_COLOR
private static final int BORDER_COLOR- See Also:
- Constant Field Values
-
BACKGROUND_COLOR
private static final int BACKGROUND_COLOR- See Also:
- Constant Field Values
-
font
-
value
-
maxLength
private int maxLength -
frame
private int frame -
bordered
private boolean bordered -
canLoseFocus
private boolean canLoseFocus -
isEditable
private boolean isEditable -
shiftPressed
private boolean shiftPressed -
displayPos
private int displayPos -
cursorPos
private int cursorPos -
highlightPos
private int highlightPos -
textColor
private int textColor -
textColorUneditable
private int textColorUneditable -
suggestion
-
responder
-
filter
-
formatter
-
-
Constructor Details
-
EditBox
-
EditBox
-
-
Method Details
-
setResponder
-
setFormatter
-
tick
public void tick() -
createNarrationMessage
- Overrides:
createNarrationMessage
in classAbstractWidget
-
setValue
-
getValue
-
getHighlighted
-
setFilter
-
insertText
-
onValueChange
-
deleteText
private void deleteText(int p_94218_) -
deleteWords
public void deleteWords(int p_94177_) -
deleteChars
public void deleteChars(int p_94181_) -
getWordPosition
public int getWordPosition(int p_94185_) -
getWordPosition
private int getWordPosition(int p_94129_, int p_94130_) -
getWordPosition
private int getWordPosition(int p_94141_, int p_94142_, boolean p_94143_) -
moveCursor
public void moveCursor(int p_94189_) -
getCursorPos
private int getCursorPos(int p_94221_) -
moveCursorTo
public void moveCursorTo(int p_94193_) -
setCursorPosition
public void setCursorPosition(int p_94197_) -
moveCursorToStart
public void moveCursorToStart() -
moveCursorToEnd
public void moveCursorToEnd() -
keyPressed
public boolean keyPressed(int p_94132_, int p_94133_, int p_94134_)- Specified by:
keyPressed
in interfaceGuiEventListener
-
canConsumeInput
public boolean canConsumeInput() -
charTyped
public boolean charTyped(char p_94122_, int p_94123_)- Specified by:
charTyped
in interfaceGuiEventListener
-
mouseClicked
public boolean mouseClicked(double p_94125_, double p_94126_, int p_94127_)- Specified by:
mouseClicked
in interfaceGuiEventListener
- Overrides:
mouseClicked
in classAbstractWidget
-
setFocus
public void setFocus(boolean p_94179_) -
renderButton
- Overrides:
renderButton
in classAbstractWidget
-
renderHighlight
private void renderHighlight(int p_94136_, int p_94137_, int p_94138_, int p_94139_) -
setMaxLength
public void setMaxLength(int p_94200_) -
getMaxLength
private int getMaxLength() -
getCursorPosition
public int getCursorPosition() -
isBordered
private boolean isBordered() -
setBordered
public void setBordered(boolean p_94183_) -
setTextColor
public void setTextColor(int p_94203_) -
setTextColorUneditable
public void setTextColorUneditable(int p_94206_) -
changeFocus
public boolean changeFocus(boolean p_94172_)- Specified by:
changeFocus
in interfaceGuiEventListener
- Overrides:
changeFocus
in classAbstractWidget
-
isMouseOver
public boolean isMouseOver(double p_94157_, double p_94158_)- Specified by:
isMouseOver
in interfaceGuiEventListener
- Overrides:
isMouseOver
in classAbstractWidget
-
onFocusedChanged
protected void onFocusedChanged(boolean p_94170_)- Overrides:
onFocusedChanged
in classAbstractWidget
-
isEditable
private boolean isEditable() -
setEditable
public void setEditable(boolean p_94187_) -
getInnerWidth
public int getInnerWidth() -
setHighlightPos
public void setHighlightPos(int p_94209_) -
setCanLoseFocus
public void setCanLoseFocus(boolean p_94191_) -
isVisible
public boolean isVisible() -
setVisible
public void setVisible(boolean p_94195_) -
setSuggestion
-
getScreenX
public int getScreenX(int p_94212_) -
setX
public void setX(int p_94215_) -
updateNarration
- Specified by:
updateNarration
in interfaceNarrationSupplier
-