Aller au contenu
galdurdocs

RowHandle

classclient uniquementdepuis 0.1.0

com.galdurstudio.galdurui.api.window.RowHandle

Pas encore traduit : texte d’origine en anglais.

Handle to a row of a GaldurWindow: elements placed side by side, left to right, instead of stacked.

Returned by GaldurWindow.addRow(). Elements are added as in the window, and each returns its own handle. The elements of a row are centred vertically on each other and separated by the theme gap (spacing.gap).

Example.java
RowHandle actions = window.addRow(true);actions.addButton(Component.literal("Confirm"), this::confirm);actions.addButton(Component.literal("Cancel"), window::close);

Like any ElementHandle, the row can be disabled, hidden or given a tooltip all at once:

  • disabled, it disables all its elements;
  • hidden, it disappears with its elements and frees its space; a row whose elements are all hidden frees its space too;
  • its tooltip shows on the elements that have none of their own (including in place of an icon button's label).

An element added while the window is shown appears on the next frame. Call on the client thread. A row does not contain another row.

public class RowHandle extends ElementHandle
PAQUETapi.window
CÔTÉclient uniquement
HÉRITE DEElementHandle

MEMBRES · 11

Méthodes 10

addText

public ElementHandle addText(Component text)

Adds a text at the end of the row.

PARAMÈTRES

textComponentthe text to show

RENVOIEElementHandle — the element's handle (disable, hide, tooltip)

addButton

public ElementHandle addButton(Component label, Runnable action)

Adds a button at the end of the row.

PARAMÈTRES

labelComponentthe button label
actionRunnablerun when the button is activated, by mouse or keyboard

RENVOIEElementHandle — the element's handle (disable, hide, tooltip)

addIconButton

2 surcharges
public ElementHandle addIconButton(ItemStack icon, Component label, Runnable action)
public ElementHandle addIconButton(ResourceLocation sprite, Component label, Runnable action)

Adds an icon button showing an item at the end of the row.

PARAMÈTRES

iconItemStackthe shown item; copied
labelComponenttooltip and narration text (not drawn on the button)
actionRunnablerun when the button is activated, by mouse or keyboard
spriteResourceLocationsprite id in the GUI atlas, in grayscale

RENVOIEElementHandle — the element's handle (disable, hide, tooltip)

addCheckbox

public CheckboxHandle addCheckbox(Component label, boolean defaultState)

Adds a checkbox at the end of the row and returns its handle.

PARAMÈTRES

labelComponentthe text next to the box
defaultStatebooleantrue if the checkbox is checked on open

RENVOIECheckboxHandle — the checkbox handle

public void setEnabled(boolean enabled)

Enables or disables the element. No effect if it is already in that state.

PARAMÈTRES

enabledbooleanfalse to disable it
public boolean isEnabled()

RENVOIEboolean — true if the element is enabled (the default)

public void setVisible(boolean visible)

Shows or hides the element. Hidden, it frees its space in the window. No effect if it is already in that state.

PARAMÈTRES

visiblebooleanfalse to hide it
public boolean isVisible()

RENVOIEboolean — true if the element is shown (the default)

public void setTooltip(Component tooltip)

Sets the text shown when the element is hovered.

PARAMÈTRES

tooltipComponentthe tooltip text, or null to remove it
public Component getTooltip()

RENVOIEComponent — the tooltip text, or null if none

© 2026 Galdur Studio · galdurstudio.com · Discord · LGPL-3.0-onlyProduit non officiel. Non approuvé par Mojang ou Microsoft, ni associé à eux.