Class GeneralMultilineEditorCopy
java.lang.Object
net.minecraft.client.gui.widget.ClickableWidget
io.github.zhengzhengyiyi.gui.widget.AbstractEditor
io.github.zhengzhengyiyi.gui.widget.GeneralMultilineEditorCopy
- All Implemented Interfaces:
net.minecraft.client.gui.Drawable,net.minecraft.client.gui.Element,net.minecraft.client.gui.Narratable,net.minecraft.client.gui.navigation.Navigable,net.minecraft.client.gui.Selectable,net.minecraft.client.gui.widget.Widget
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.client.gui.Selectable
net.minecraft.client.gui.Selectable.SelectionType -
Field Summary
FieldsModifier and TypeFieldDescriptionintstatic intFields inherited from class net.minecraft.client.gui.widget.ClickableWidget
active, alpha, height, hovered, visible, width -
Constructor Summary
ConstructorsConstructorDescriptionGeneralMultilineEditorCopy(int x, int y, int width, int height, net.minecraft.text.Text message) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendClickableNarrations(net.minecraft.client.gui.screen.narration.NarrationMessageBuilder builder) booleancharTyped(net.minecraft.client.input.CharInput input) voidEnds the current search operation.voidfindNext()Finds the next search match.voidFinds the previous search match.intGets the current search match index (1-based).intGets the current cursor position.getFileTypeFromName(String fileName) intGets the number of search matches found.getText()Gets the current text content of the editor.voidinsertTextAtCursor(String text) Inserts text at the current cursor position.booleanChecks if a search is currently active.booleankeyPressed(net.minecraft.client.input.KeyInput input) booleanmouseClicked(net.minecraft.client.gui.Click click, boolean doubled) booleanmouseDragged(net.minecraft.client.gui.Click click, double offsetX, double offsetY) booleanmouseReleased(net.minecraft.client.gui.Click click) booleanmouseScrolled(double mouseX, double mouseY, double amount) booleanmouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) protected voidrenderWidget(net.minecraft.client.gui.DrawContext context, int mouseX, int mouseY, float delta) voidsetChangedListener(Consumer<String> changedListener) Sets the listener for text change events.voidsetCursorPosition(int position) Sets the cursor position.voidsetEditable(boolean editable) Sets whether the editor is editable.voidvoidSets the text content of the editor.voidstartSearch(String query) Starts a text search with the given query.Methods inherited from class net.minecraft.client.gui.widget.ClickableWidget
appendDefaultNarrations, appendNarrations, drawScrollableText, drawScrollableText, drawScrollableText, forEachChild, getBottom, getHeight, getMessage, getNarrationMessage, getNarrationMessage, getNavigationFocus, getNavigationOrder, getNavigationPath, getRight, getType, getWidth, getX, getY, isFocused, isHovered, isInteractable, isMouseOver, isSelected, isValidClickButton, onClick, onDrag, onRelease, playClickSound, playDownSound, render, setAlpha, setDimensions, setDimensionsAndPosition, setFocused, setHeight, setMessage, setNavigationOrder, setTooltip, setTooltipDelay, setWidth, setX, setYMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.Element
getBorder, getFocusedPath, isClickable, keyReleased, mouseMovedMethods inherited from interface net.minecraft.client.gui.Selectable
getNarratedPartsMethods inherited from interface net.minecraft.client.gui.widget.Widget
setPosition
-
Field Details
-
text
-
maxVisibleLines
public static int maxVisibleLines -
lastCursorX
public int lastCursorX -
searchQuery
-
-
Constructor Details
-
GeneralMultilineEditorCopy
public GeneralMultilineEditorCopy(int x, int y, int width, int height, net.minecraft.text.Text message)
-
-
Method Details
-
getFileTypeFromName
-
renderWidget
protected void renderWidget(net.minecraft.client.gui.DrawContext context, int mouseX, int mouseY, float delta) - Specified by:
renderWidgetin classnet.minecraft.client.gui.widget.ClickableWidget
-
mouseClicked
public boolean mouseClicked(net.minecraft.client.gui.Click click, boolean doubled) - Specified by:
mouseClickedin interfacenet.minecraft.client.gui.Element- Overrides:
mouseClickedin classnet.minecraft.client.gui.widget.ClickableWidget
-
mouseScrolled
public boolean mouseScrolled(double mouseX, double mouseY, double amount) -
mouseScrolled
public boolean mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) -
keyPressed
public boolean keyPressed(net.minecraft.client.input.KeyInput input) -
charTyped
public boolean charTyped(net.minecraft.client.input.CharInput input) -
appendClickableNarrations
protected void appendClickableNarrations(net.minecraft.client.gui.screen.narration.NarrationMessageBuilder builder) - Specified by:
appendClickableNarrationsin classnet.minecraft.client.gui.widget.ClickableWidget
-
getText
Description copied from class:AbstractEditorGets the current text content of the editor.- Specified by:
getTextin classAbstractEditor- Returns:
- the text content
-
setText
Description copied from class:AbstractEditorSets the text content of the editor.- Specified by:
setTextin classAbstractEditor- Parameters:
text- the new text content
-
setEditable
public void setEditable(boolean editable) Description copied from class:AbstractEditorSets whether the editor is editable.- Specified by:
setEditablein classAbstractEditor- Parameters:
editable- true if the editor should be editable
-
setChangedListener
Description copied from class:AbstractEditorSets the listener for text change events.- Specified by:
setChangedListenerin classAbstractEditor- Parameters:
changedListener- the consumer to call when text changes
-
insertTextAtCursor
Description copied from class:AbstractEditorInserts text at the current cursor position.- Specified by:
insertTextAtCursorin classAbstractEditor- Parameters:
text- the text to insert
-
getCursorPosition
public int getCursorPosition()Description copied from class:AbstractEditorGets the current cursor position.- Specified by:
getCursorPositionin classAbstractEditor- Returns:
- the cursor position
-
setCursorPosition
public void setCursorPosition(int position) Description copied from class:AbstractEditorSets the cursor position.- Specified by:
setCursorPositionin classAbstractEditor- Parameters:
position- the new cursor position
-
setFileName
-
getFileName
-
startSearch
Description copied from class:AbstractEditorStarts a text search with the given query.- Specified by:
startSearchin classAbstractEditor- Parameters:
query- the search query
-
findNext
public void findNext()Description copied from class:AbstractEditorFinds the next search match.- Specified by:
findNextin classAbstractEditor
-
findPrevious
public void findPrevious()Description copied from class:AbstractEditorFinds the previous search match.- Specified by:
findPreviousin classAbstractEditor
-
endSearch
public void endSearch()Description copied from class:AbstractEditorEnds the current search operation.- Specified by:
endSearchin classAbstractEditor
-
isSearching
public boolean isSearching()Description copied from class:AbstractEditorChecks if a search is currently active.- Specified by:
isSearchingin classAbstractEditor- Returns:
- true if searching
-
getSearchMatchCount
public int getSearchMatchCount()Description copied from class:AbstractEditorGets the number of search matches found.- Specified by:
getSearchMatchCountin classAbstractEditor- Returns:
- the match count
-
getCurrentSearchIndex
public int getCurrentSearchIndex()Description copied from class:AbstractEditorGets the current search match index (1-based).- Specified by:
getCurrentSearchIndexin classAbstractEditor- Returns:
- the current match index
-
mouseDragged
public boolean mouseDragged(net.minecraft.client.gui.Click click, double offsetX, double offsetY) - Specified by:
mouseDraggedin interfacenet.minecraft.client.gui.Element- Overrides:
mouseDraggedin classnet.minecraft.client.gui.widget.ClickableWidget
-
mouseReleased
public boolean mouseReleased(net.minecraft.client.gui.Click click) - Specified by:
mouseReleasedin interfacenet.minecraft.client.gui.Element- Overrides:
mouseReleasedin classnet.minecraft.client.gui.widget.ClickableWidget
-