Class MultiLineEditBox
java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractScrollArea
net.minecraft.client.gui.components.AbstractTextAreaWidget
net.minecraft.client.gui.components.MultiLineEditBox
- All Implemented Interfaces:
GuiEventListener
,Renderable
,TabOrderedElement
,LayoutElement
,NarratableEntry
,NarrationSupplier
,IAbstractWidgetExtension
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry
NarratableEntry.NarrationPriority
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private static final int
private static final int
private static final int
private long
private final Font
private final Component
private static final int
private static final int
private final MultilineTextField
Fields inherited from class net.minecraft.client.gui.components.AbstractScrollArea
SCROLLBAR_WIDTH
Fields inherited from class net.minecraft.client.gui.components.AbstractWidget
active, alpha, height, isHovered, packedFGColor, UNSET_FG_COLOR, visible, width
Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS
-
Constructor Summary
ConstructorsConstructorDescriptionMultiLineEditBox
(Font pFont, int pX, int pY, int pWidth, int pHeight, Component pPlaceholder, Component pMessage) -
Method Summary
Modifier and TypeMethodDescriptionboolean
charTyped
(char p_239387_, int p_239388_) Called when a character is typed within the GUI element.int
getValue()
boolean
keyPressed
(int p_239433_, int p_239434_, int p_239435_) Called when a keyboard key is pressed within the GUI element.void
onClick
(double p_388397_, double p_388871_) protected void
onDrag
(double p_387147_, double p_387062_, double p_388546_, double p_388296_) protected void
renderContents
(GuiGraphics p_283676_, int p_281538_, int p_283033_, float p_281767_) protected void
renderDecorations
(GuiGraphics p_282551_) private void
renderHighlight
(GuiGraphics pGuiGraphics, int pMinX, int pMinY, int pMaxX, int pMaxY) protected double
private void
private void
seekCursorScreen
(double pMouseX, double pMouseY) void
setCharacterLimit
(int pCharacterLimit) void
setFocused
(boolean p_295271_) Sets the focus state of the GUI element.void
void
setValueListener
(Consumer<String> pValueListener) void
updateWidgetNarration
(NarrationElementOutput p_259393_) Methods inherited from class net.minecraft.client.gui.components.AbstractTextAreaWidget
contentHeight, getInnerLeft, getInnerTop, innerPadding, isMouseOver, mouseClicked, playDownSound, renderBackground, renderBorder, renderWidget, scrollBarX, totalInnerPadding, withinContentAreaTopBottom
Methods inherited from class net.minecraft.client.gui.components.AbstractScrollArea
maxScrollAmount, mouseDragged, mouseScrolled, onRelease, refreshScrollAmount, renderScrollbar, scrollAmount, scrollbarVisible, scrollBarY, scrollerHeight, setScrollAmount, updateScrolling
Methods inherited from class net.minecraft.client.gui.components.AbstractWidget
clearFGColor, createNarrationMessage, defaultButtonNarrationText, getBottom, getFGColor, getHeight, getMessage, getRectangle, getRight, getTabOrderGroup, getTooltip, getWidth, getX, getY, isActive, isFocused, isHovered, isHoveredOrFocused, isValidClickButton, mouseReleased, narrationPriority, nextFocusPath, playButtonClickSound, render, renderScrollingString, renderScrollingString, renderScrollingString, setAlpha, setFGColor, setHeight, setMessage, setRectangle, setSize, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, visitWidgets, wrapDefaultNarrationMessage
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
getBorderForArrowNavigation, getCurrentFocusPath, keyReleased, mouseMoved
Methods inherited from interface net.neoforged.neoforge.client.extensions.IAbstractWidgetExtension
onClick
Methods inherited from interface net.minecraft.client.gui.layouts.LayoutElement
setPosition
Methods inherited from interface net.minecraft.client.gui.narration.NarratableEntry
getNarratables
-
Field Details
-
CURSOR_INSERT_WIDTH
private static final int CURSOR_INSERT_WIDTH- See Also:
-
CURSOR_INSERT_COLOR
private static final int CURSOR_INSERT_COLOR- See Also:
-
CURSOR_APPEND_CHARACTER
- See Also:
-
TEXT_COLOR
private static final int TEXT_COLOR- See Also:
-
PLACEHOLDER_TEXT_COLOR
private static final int PLACEHOLDER_TEXT_COLOR- See Also:
-
CURSOR_BLINK_INTERVAL_MS
private static final int CURSOR_BLINK_INTERVAL_MS- See Also:
-
font
-
placeholder
-
textField
-
focusedTime
private long focusedTime
-
-
Constructor Details
-
MultiLineEditBox
-
-
Method Details
-
setCharacterLimit
public void setCharacterLimit(int pCharacterLimit) -
setValueListener
-
setValue
-
getValue
-
updateWidgetNarration
- Specified by:
updateWidgetNarration
in classAbstractWidget
-
onClick
public void onClick(double p_388397_, double p_388871_) - Overrides:
onClick
in classAbstractWidget
-
onDrag
protected void onDrag(double p_387147_, double p_387062_, double p_388546_, double p_388296_) - Overrides:
onDrag
in classAbstractWidget
-
keyPressed
public boolean keyPressed(int p_239433_, int p_239434_, int p_239435_) Description copied from interface:GuiEventListener
Called when a keyboard key is pressed within the GUI element.- Specified by:
keyPressed
in interfaceGuiEventListener
- Overrides:
keyPressed
in classAbstractTextAreaWidget
- Parameters:
p_239433_
- the key code of the pressed key.p_239434_
- the scan code of the pressed key.p_239435_
- the keyboard modifiers.- Returns:
true
if the event is consumed,false
otherwise.
-
charTyped
public boolean charTyped(char p_239387_, int p_239388_) Description copied from interface:GuiEventListener
Called when a character is typed within the GUI element.- Parameters:
p_239387_
- the code point of the typed character.p_239388_
- the keyboard modifiers.- Returns:
true
if the event is consumed,false
otherwise.
-
renderContents
- Specified by:
renderContents
in classAbstractTextAreaWidget
-
renderDecorations
- Overrides:
renderDecorations
in classAbstractTextAreaWidget
-
getInnerHeight
public int getInnerHeight()- Specified by:
getInnerHeight
in classAbstractTextAreaWidget
-
scrollRate
protected double scrollRate()- Specified by:
scrollRate
in classAbstractScrollArea
-
renderHighlight
-
scrollToCursor
private void scrollToCursor() -
seekCursorScreen
private void seekCursorScreen(double pMouseX, double pMouseY) -
setFocused
public void setFocused(boolean p_295271_) Description copied from interface:GuiEventListener
Sets the focus state of the GUI element.- Specified by:
setFocused
in interfaceGuiEventListener
- Overrides:
setFocused
in classAbstractWidget
- Parameters:
p_295271_
-true
to apply focus,false
to remove focus
-