Class GridLayout.RowHelper
java.lang.Object
xyz.gmitch215.socketmc.screen.layout.GridLayout.RowHelper
- Enclosing class:
GridLayout
Utility class for adding elements in rows.
-
Method Summary
Modifier and TypeMethodDescription<T extends LayoutElement>
Tadd
(T child) Adds an element to this row.<T extends LayoutElement>
Tadd
(T child, int occupiedColumns) Adds an element to this row.<T extends LayoutElement>
Tadd
(T child, int occupiedColumns, Consumer<LayoutSettings> settings) Adds an element to this row.<T extends LayoutElement>
Tadd
(T child, int occupiedColumns, Supplier<LayoutSettings> settings) Adds an element to this row.<T extends LayoutElement>
Tadd
(T child, int occupiedColumns, LayoutSettings settings) Adds an element to this row.<T extends LayoutElement>
Tadd
(T child, Consumer<LayoutSettings> settings) Adds an element to this row.<T extends LayoutElement>
Tadd
(T child, Supplier<LayoutSettings> settings) Adds an element to this row.<T extends LayoutElement>
Tadd
(T child, LayoutSettings settings) Adds an element to this row.getGrid()
Gets the GridLayout that the RowHelper is associated with.
-
Method Details
-
add
Adds an element to this row.- Type Parameters:
T
- The type of the element- Parameters:
child
- The element to add- Returns:
- The element that was added
- Throws:
IllegalArgumentException
- if the element is null
-
add
@NotNull public <T extends LayoutElement> T add(@NotNull T child, int occupiedColumns) throws IllegalArgumentException Adds an element to this row.- Type Parameters:
T
- The type of the element- Parameters:
child
- The element to addoccupiedColumns
- The number of columns the element occupies- Returns:
- The element that was added
- Throws:
IllegalArgumentException
- if the element is null or the occupied columns is less than 1
-
add
@NotNull public <T extends LayoutElement> T add(@NotNull T child, LayoutSettings settings) throws IllegalArgumentException Adds an element to this row.- Type Parameters:
T
- The type of the element- Parameters:
child
- The element to addsettings
- The layout settings for the element- Returns:
- The element that was added
- Throws:
IllegalArgumentException
- if the element is null
-
add
@NotNull public <T extends LayoutElement> T add(@NotNull T child, int occupiedColumns, LayoutSettings settings) throws IllegalArgumentException Adds an element to this row.- Type Parameters:
T
- The type of the element- Parameters:
child
- The element to addoccupiedColumns
- The number of columns the element occupiessettings
- The layout settings for the element- Returns:
- The element that was added
- Throws:
IllegalArgumentException
- if the element or settings are null or the occupied columns is less than 1
-
add
@NotNull public <T extends LayoutElement> T add(@NotNull T child, Supplier<LayoutSettings> settings) throws IllegalArgumentException Adds an element to this row.- Type Parameters:
T
- The type of the element- Parameters:
child
- The element to addsettings
- The generator for the layout settings- Returns:
- The element that was added
- Throws:
IllegalArgumentException
- if the element is null
-
add
@NotNull public <T extends LayoutElement> T add(@NotNull T child, int occupiedColumns, Supplier<LayoutSettings> settings) throws IllegalArgumentException Adds an element to this row.- Type Parameters:
T
- The type of the element- Parameters:
child
- The element to addoccupiedColumns
- The number of columns the element occupiessettings
- The generator for the layout settings- Returns:
- The element that was added
- Throws:
IllegalArgumentException
- if the element or settings are null or the occupied columns is less than 1
-
add
@NotNull public <T extends LayoutElement> T add(@NotNull T child, Consumer<LayoutSettings> settings) throws IllegalArgumentException Adds an element to this row.- Type Parameters:
T
- The type of the element- Parameters:
child
- The element to addsettings
- The function to apply onGridLayout.createDefaultSettings()
- Returns:
- The element that was added
- Throws:
IllegalArgumentException
- if the element is null
-
add
@NotNull public <T extends LayoutElement> T add(@NotNull T child, int occupiedColumns, Consumer<LayoutSettings> settings) throws IllegalArgumentException Adds an element to this row.- Type Parameters:
T
- The type of the element- Parameters:
child
- The element to addoccupiedColumns
- The number of columns the element occupiessettings
- The function to apply onGridLayout.createDefaultSettings()
- Returns:
- The element that was added
- Throws:
IllegalArgumentException
- if the element or settings are null or the occupied columns is less than 1
-
getGrid
Gets the GridLayout that the RowHelper is associated with.- Returns:
- GridLayout
-