Class ItemSlotArea
java.lang.Object
com.ultikits.ultitools.abstracts.gui.declarative.core.Widget
com.ultikits.ultitools.abstracts.gui.declarative.core.RenderObjectWidget
com.ultikits.ultitools.abstracts.gui.declarative.widgets.ItemSlotArea
Binds a consecutive row-major area of a grid to existing container indexes, read-only by default.
Paging changes firstIndex, never container contents or lifetime. A partial last page leaves the
remaining grid slots unbound. Use it as a layout child with its own startSlot, not as a single
GridView cell (a cell assigns one position to its render object).
ItemSlotArea.builder(container).firstIndex(page * 9).count(9).build(); // VIEW
ItemSlotArea.builder(container).count(9).mode(BindingMode.EDITABLE).build(); // Explicit opt-in
- Since:
- 7.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA non-thread-safe range builder; defaults to all container indexes at slot zero, in VIEW mode. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final SlotContainerprivate final intprivate final intprivate final BindingModeprivate final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ItemSlotArea.Builderbuilder(SlotContainer container) @NotNull RenderObjectElementCreates the Element corresponding to this Widget.intgetCount()intgetMode()int
-
Field Details
-
container
-
firstIndex
private final int firstIndex -
count
private final int count -
startSlot
private final int startSlot -
mode
-
-
Constructor Details
-
ItemSlotArea
-
-
Method Details
-
builder
- Parameters:
container- the container whose contents are shown @return a new builder
-
getContainer
- Returns:
- the bound container
-
getFirstIndex
public int getFirstIndex()- Returns:
- the first visible container index
-
getCount
public int getCount()- Returns:
- the requested area size, possibly exceeding the remaining container indexes
-
getStartSlot
public int getStartSlot()- Returns:
- the first grid slot
-
getMode
- Returns:
- the binding's edit/view mode
-
createElement
Description copied from class:WidgetCreates the Element corresponding to this Widget.This is a framework-internal method; subclasses should return the Element implementation appropriate to the Widget type.
- StatelessWidget returns a
StatelessElement - StatefulWidget returns a
StatefulElement - RenderObjectWidget returns a
RenderObjectElement
- Specified by:
createElementin classRenderObjectWidget- Returns:
- the corresponding Element instance
- StatelessWidget returns a
-