SearchHandle
classclient uniquementdepuis 0.1.0com.galdurstudio.galdurui.api.window.SearchHandle
Pas encore traduit : texte d’origine en anglais.
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.
MEMBRES · 9
Méthodes 9
getText
RENVOIEString — 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.
PARAMÈTRES
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.
PARAMÈTRES
setEnabled
de ElementHandleEnables or disables the element. No effect if it is already in that state.
PARAMÈTRES
false to disable itisEnabled
de ElementHandleRENVOIEboolean — true if the element is enabled (the default)
setVisible
de ElementHandleShows or hides the element. Hidden, it frees its space in the window. No effect if it is already in that state.
PARAMÈTRES
false to hide itisVisible
de ElementHandleRENVOIEboolean — true if the element is shown (the default)
setTooltip
de ElementHandleSets the text shown when the element is hovered.
PARAMÈTRES
null to remove itgetTooltip
de ElementHandleRENVOIEComponent — the tooltip text, or null if none