SearchHandle
classclient onlysince 0.1.0com.galdurstudio.galdurui.api.window.SearchHandle
Handle to a search field of a GaldurWindow: its text, and the action called on every
keystroke.
Returned by GaldurWindow.addSearch(...). As with CheckboxHandle, the state
lives here, not in the shown widget: the text survives resizes, and setText()
changes it even while the window is open, without rebuilding the screen.
SearchHandle search = window.addSearch(Component.literal("Search..."));ListHandle results = window.addList(6);search.onChange(text -> results.setLines(filter(all, text)));Like any ElementHandle, the field can be disabled, hidden or given a tooltip. Call on
the client thread.
MEMBERS · 9
Methods 9
getText
RETURNSString — the typed text, never null; empty at first
setText
Changes the field text. When the value really changes, the action given to
onChange() is called, whether the change comes from the player or from code.
PARAMETERS
null counts as emptyonChange
Sets the action called when the text changes, on every keystroke. Only one action is kept: a new call replaces the previous one.
PARAMETERS
setEnabled
from ElementHandleEnables or disables the element. No effect if it is already in that state.
PARAMETERS
false to disable itisEnabled
from ElementHandleRETURNSboolean — true if the element is enabled (the default)
setVisible
from ElementHandleShows or hides the element. Hidden, it frees its space in the window. No effect if it is already in that state.
PARAMETERS
false to hide itisVisible
from ElementHandleRETURNSboolean — true if the element is shown (the default)
setTooltip
from ElementHandleSets the text shown when the element is hovered.
PARAMETERS
null to remove itgetTooltip
from ElementHandleRETURNSComponent — the tooltip text, or null if none