Class VirtualListComponent<K,V>

java.lang.Object
com.render.api.gui.GuiComponent<VirtualListComponent<K,V>>
com.render.api.gui.VirtualListComponent<K,V>
Type Parameters:
K - stable row key
V - immutable application value
All Implemented Interfaces:
AutoCloseable

public final class VirtualListComponent<K,V> extends GuiComponent<VirtualListComponent<K,V>> implements AutoCloseable
A keyed, variable-height retained list that mounts only its viewport and pixel overscan window. Supply immutable snapshots on the client thread. Row heights are explicit border-box design pixels, so the index and first visible frame agree without speculative measurement. The list owns row position and size; row contents remain ordinary components with normal styles, input, focus and paint.

Focused or pressed descendants pin their keyed row until ownership ends, including when a filter removes the key. Unmounted rows use a bounded cache and are never rebound to another key. Selection is stored separately from the current filtered snapshot and remains selected when that key returns. Close the list with its owning view to release cached row resources. Use finite positive heights; extremely long content still follows float design-coordinate precision when converted to component boxes.

  • Constructor Details

    • VirtualListComponent

      public VirtualListComponent(GuiVirtualRowRenderer<K,V> renderer)
      Creates a list whose renderer owns application row content and row resource cleanup.
  • Method Details

    • items

      public VirtualListComponent<K,V> items(GuiVirtualListSnapshot<K,V> replacement)
      Installs a validated snapshot and preserves the top visible key plus its within-row offset when possible.
    • items

      public GuiVirtualListSnapshot<K,V> items()
      Returns:
      the immutable current data snapshot
    • rowHeight

      public VirtualListComponent<K,V> rowHeight(K key, float height)
      Updates one indexed row height in O(log N), retaining the key-relative scroll anchor. A subsequent snapshot installation replaces these height overrides with that snapshot's heights.
    • selectedKey

      public VirtualListComponent<K,V> selectedKey(K key)
      Selects a stable key, or null to clear it. A filtered-out key can remain selected.
    • selectedKey

      public Optional<K> selectedKey()
      Returns:
      the selected key, even when currently filtered out
    • onSelectionChanged

      public VirtualListComponent<K,V> onSelectionChanged(Consumer<? super K> listener)
      Observes actual selection changes on the client thread; the value is null when selection is cleared.
    • overscan

      public VirtualListComponent<K,V> overscan(float pixels)
      Configures overscan above and below the viewport in design pixels.
    • retainedRowLimit

      public VirtualListComponent<K,V> retainedRowLimit(int count)
      Sets the maximum cached row count, excluding additional visible or ownership-pinned rows that cannot be evicted. Set this to zero to retain only currently mounted rows.
    • mountedRowLimit

      public VirtualListComponent<K,V> mountedRowLimit(int count)
      Bounds the ordinary viewport/overscan window. Very small rows may require a larger explicit limit; an oversized window fails visibly instead of silently omitting content. Ownership-pinned rows are additional.
    • scrollBehavior

      public VirtualListComponent<K,V> scrollBehavior(GuiScrollBehavior behavior)
      Selects the ordinary wheel/programmatic scroll policy. Key reveals are immediate.
    • showScrollIndicator

      public VirtualListComponent<K,V> showScrollIndicator(boolean visible)
      Shows or hides the ordinary scroll indicator without affecting indexed content.
    • scrollOffset

      public VirtualListComponent<K,V> scrollOffset(float offset)
      Sets an immediate offset after the next usable layout, including before the list is first displayed.
    • scrollOffset

      public float scrollOffset()
      Returns:
      the currently rendered vertical scroll offset
    • maxScrollOffset

      public float maxScrollOffset()
      Returns:
      maximum scroll offset for the last arranged viewport
    • revealKey

      public VirtualListComponent<K,V> revealKey(K key)
      Reveals a key with the minimum immediate scroll movement.
    • scrollToKey

      public VirtualListComponent<K,V> scrollToKey(K key, GuiScrollSnapAlign alignment)
      Aligns a key; NONE uses the smallest movement needed to reveal its whole row.
    • row

      public Optional<GuiComponent<?>> row(K key)
      Returns:
      a cached row for a key, without constructing or mounting it
    • mountedKeys

      public List<K> mountedKeys()
      Returns:
      immutable currently mounted keys, including ownership-pinned keys
    • stats

      Returns:
      current bounded-work and retention counters
    • renderSelf

      protected void renderSelf(com.render.api.gui.GuiRenderContext context)
      Overrides:
      renderSelf in class GuiComponent<VirtualListComponent<K,V>>
    • close

      public void close()
      Cancels input ownership, detaches all rows and releases every cached row once. Repeated closes are no-ops.
      Specified by:
      close in interface AutoCloseable
    • pointerEvents

      public VirtualListComponent<K,V> pointerEvents(GuiPointerEvents events)
      Selects pointer participation for this component and its descendants. Use CHILDREN_ONLY for structural overlay containers and NONE for decorative drag ghosts or tooltips.
      Parameters:
      events - pointer participation policy
      Returns:
      this component
    • pointerEvents

      public final GuiPointerEvents pointerEvents()
      Returns the pointer participation policy.
      Returns:
      pointer participation policy
    • add

      public VirtualListComponent<K,V> add(GuiComponent<?> child)
    • remove

      public VirtualListComponent<K,V> remove(GuiComponent<?> child)
    • clearChildren

      public VirtualListComponent<K,V> clearChildren()
    • onChildDetached

      protected void onChildDetached(GuiComponent<?> child)
      Releases parent-owned references when a source child is detached.
      Parameters:
      child - the detached source child
    • replaceChildren

      public VirtualListComponent<K,V> replaceChildren(List<? extends GuiComponent<?>> replacements)
      Replaces source children while treating an identical retained identity/order sequence as a no-op.

      Reuse component instances. Newly allocated look-alikes are intentionally considered different because callbacks, focus, animation, and resource ownership cannot be compared safely. Invalid ownership or duplicate identities are rejected before either tree is mutated.

      Parameters:
      replacements - desired source children in paint order
      Returns:
      this component
    • replaceChildren

      public VirtualListComponent<K,V> replaceChildren(GuiComponent<?>... replacements)
      Varargs form of replaceChildren(List).
      Parameters:
      replacements - desired source children in paint order
      Returns:
      this component
    • updateWhenChanged

      public VirtualListComponent<K,V> updateWhenChanged(String channel, Object snapshot, Consumer<VirtualListComponent<K,V>> updater)
      Runs a retained update only when its immutable equality snapshot changes.

      Use this around coarse synchronization code that would otherwise clear/rebuild a subtree every tick. Prefer direct setters for individual values. Channels are component-local and limited to 32 retained snapshots; the oldest is discarded when the limit is exceeded. Snapshots should be immutable scalars, strings, records, or immutable lists.

      Parameters:
      channel - stable name for this update source
      snapshot - immutable equality value representing the input state
      updater - update executed only after a changed snapshot
      Returns:
      this component
    • updateWhenChanged

      public VirtualListComponent<K,V> updateWhenChanged(String channel, long revision, Consumer<VirtualListComponent<K,V>> updater)
      Allocation-free steady-state revision overload of updateWhenChanged(String, Object, Consumer).
      Parameters:
      channel - stable name for this update source
      revision - monotonically changing model or content revision
      updater - update executed only after a changed revision
      Returns:
      this component
    • children

      public List<GuiComponent<?>> children()
    • parent

      public GuiComponent<?> parent()
    • x

      public float x()
    • y

      public float y()
    • width

      public float width()
    • height

      public float height()
    • visible

      public boolean visible()
    • enabled

      public boolean enabled()
    • focused

      public boolean focused()
      Returns whether this component currently owns keyboard focus.
      Returns:
      true when focused
    • readOnly

      public VirtualListComponent<K,V> readOnly(boolean readOnly)
      Makes this control read-only for selector and interaction semantics. Text fields keep selection, navigation, copy and programmatic value updates; user edits are consumed without changing their value. Other controls may define their own read-only behavior.
      Parameters:
      readOnly - read-only state
      Returns:
      this component
    • readOnly

      public final boolean readOnly()
    • required

      public VirtualListComponent<K,V> required(boolean required)
      Sets whether this component participates in required/optional form styling.
      Parameters:
      required - required state
      Returns:
      this component
    • required

      public final boolean required()
    • validity

      public VirtualListComponent<K,V> validity(GuiValidity validity)
      Sets semantic validity independently of edit-time input filtering.
      Parameters:
      validity - validation state
      Returns:
      this component
    • validity

      public final GuiValidity validity()
    • rangeState

      public VirtualListComponent<K,V> rangeState(GuiRangeState rangeState)
      Sets the optional range pseudo-state for numeric and custom controls.
      Parameters:
      rangeState - range state
      Returns:
      this component
    • rangeState

      public final GuiRangeState rangeState()
    • indeterminate

      public VirtualListComponent<K,V> indeterminate(boolean indeterminate)
      Sets the mixed/indeterminate state used by tri-state controls.
      Parameters:
      indeterminate - mixed state
      Returns:
      this component
    • indeterminate

      public final boolean indeterminate()
    • matchesStyleState

      public final boolean matchesStyleState(GuiStyleState state)
      Tests a standard or custom modern selector state.
      Parameters:
      state - state query
      Returns:
      active flag
    • computedStyle

      public final Optional<GuiComputedStyle> computedStyle()
      Returns the latest computed modern style.
      Returns:
      computed style when this component has been resolved by a modern host
    • intrinsicSize

      public final GuiIntrinsicSize intrinsicSize()
      Returns intrinsic contributions from the latest modern measure pass.
      Returns:
      immutable intrinsic metrics
    • layoutFragments

      public final List<GuiLayoutFragment> layoutFragments()
      Returns final modern layout fragments. Modern layout normally produces one fragment per box; display:contents and display:none produce none.
      Returns:
      immutable fragment list
    • fragmentTree

      public final GuiFragmentTree fragmentTree()
      Returns the latest page/column fragment projection rooted at this component.
      Returns:
      immutable fragment tree, or an empty tree outside fragmentation
    • pseudoElementStyle

      public final Optional<GuiComputedStyle> pseudoElementStyle(GuiPseudoElement pseudoElement)
      Returns a paint-only or generated pseudo-element's computed style.
      Parameters:
      pseudoElement - pseudo-element
      Returns:
      computed style when a matching rule exists
    • styledPseudoElements

      public final Set<GuiPseudoElement> styledPseudoElements()
      Returns pseudo-elements with a currently matched modern rule.
      Returns:
      immutable pseudo-element set
    • pseudoElementBox

      public final Optional<GuiPseudoElementComponent> pseudoElementBox(GuiPseudoElement pseudoElement)
      Returns a stable generated pseudo-element box for BEFORE, AFTER, or MARKER after a matching modern rule has resolved.
      Parameters:
      pseudoElement - tree-abiding pseudo-element
      Returns:
      generated box when present
    • dirtyCategories

      public final Set<GuiDirtyCategory> dirtyCategories()
      Returns current modern invalidation categories.
      Returns:
      immutable dirty-category set
    • lastInvalidationReason

      public final String lastInvalidationReason()
      Returns the latest invalidation reason for devtools.
      Returns:
      reason
    • paintInputs

      public VirtualListComponent<K,V> paintInputs(GuiPaintInputs inputs)
      Supplies immutable named inputs and optional selector queries to this component's visual and mask worklets.
    • paintInputs

      public GuiPaintInputs paintInputs()
      Returns this component's immutable declared worklet inputs.
    • margin

      public VirtualListComponent<K,V> margin(float all)
    • margin

      public VirtualListComponent<K,V> margin(float vertical, float horizontal)
    • margin

      public VirtualListComponent<K,V> margin(float top, float right, float bottom, float left)
    • padding

      public VirtualListComponent<K,V> padding(float all)
    • padding

      public VirtualListComponent<K,V> padding(float vertical, float horizontal)
    • padding

      public VirtualListComponent<K,V> padding(float top, float right, float bottom, float left)
    • color

      public VirtualListComponent<K,V> color(RenderColor color)
    • backgroundColor

      public VirtualListComponent<K,V> backgroundColor(RenderColor color)
    • borderColor

      public VirtualListComponent<K,V> borderColor(RenderColor color)
    • borderWidth

      public VirtualListComponent<K,V> borderWidth(float borderWidth)
    • cornerRadius

      public VirtualListComponent<K,V> cornerRadius(float cornerRadius)
    • opacity

      public VirtualListComponent<K,V> opacity(float opacity)
    • shadow

      public VirtualListComponent<K,V> shadow(GuiShadow shadow)
    • boxShadow

      public VirtualListComponent<K,V> boxShadow(GuiShadow shadow)
      Sets the drop shadow painted behind this component's box.
      Parameters:
      shadow - box shadow, or null
      Returns:
      this component
    • glow

      public VirtualListComponent<K,V> glow(GuiGlow glow)
    • boxGlow

      public VirtualListComponent<K,V> boxGlow(GuiGlow glow)
      Sets the glow painted around this component's box.
      Parameters:
      glow - box glow, or null
      Returns:
      this component
    • gradient

      public VirtualListComponent<K,V> gradient(GuiGradient gradient)
    • animatedBorder

      public VirtualListComponent<K,V> animatedBorder(GuiAnimatedBorder animatedBorder)
      Sets the animated border decoration.

      The moving ring follows the border edge and its glow may extend outside this component's own clip path. Ancestor clips still constrain the decoration.

      Parameters:
      animatedBorder - animated border, or null
      Returns:
      this component
    • visible

      public VirtualListComponent<K,V> visible(boolean visible)
    • caretStyle

      public VirtualListComponent<K,V> caretStyle(GuiCaretStyle caretStyle)
      Sets the editable-text caret appearance inherited by the CARET pseudo-element.
      Parameters:
      caretStyle - caret appearance
      Returns:
      this component
    • backgroundLayers

      public VirtualListComponent<K,V> backgroundLayers(List<GuiBackgroundLayer> layers)
      Replaces the ordered modern background-image layer list. The background color is painted below every layer.
      Parameters:
      layers - ordered bottom-to-top layers
      Returns:
      this component
    • backgroundLayers

      public VirtualListComponent<K,V> backgroundLayers(GuiBackgroundLayer... layers)
    • backgroundLayer

      public VirtualListComponent<K,V> backgroundLayer(GuiBackgroundLayer layer)
    • border

      public VirtualListComponent<K,V> border(GuiBorder border)
      Sets the typed per-side border. Later legacy border setters clear this value.
      Parameters:
      border - border value, or null
      Returns:
      this component
    • outline

      public VirtualListComponent<K,V> outline(GuiOutline outline)
    • boxDecorationBreak

      public VirtualListComponent<K,V> boxDecorationBreak(GuiBoxDecorationBreak behavior)
    • boxShadows

      public VirtualListComponent<K,V> boxShadows(List<GuiBoxShadow> shadows)
    • boxShadows

      public VirtualListComponent<K,V> boxShadows(GuiBoxShadow... shadows)
    • transform

      public VirtualListComponent<K,V> transform(GuiTransform transform)
      Sets the immutable post-layout transform list for this component subtree.
      Parameters:
      transform - ordered transform list
      Returns:
      this component
    • transformOrigin

      public VirtualListComponent<K,V> transformOrigin(GuiTransformOrigin origin)
      Sets the normalized origin around which transforms are applied.
      Parameters:
      origin - transform origin
      Returns:
      this component
    • transformBox

      public VirtualListComponent<K,V> transformBox(GuiTransformBox box)
      Selects the component box used to resolve transforms.
      Parameters:
      box - transform reference box
      Returns:
      this component
    • transformStyle

      public VirtualListComponent<K,V> transformStyle(GuiTransformStyle transformStyle)
      Selects flat or preserve-3D descendant transform behavior.
      Parameters:
      transformStyle - descendant transform behavior
      Returns:
      this component
    • backfaceVisibility

      public VirtualListComponent<K,V> backfaceVisibility(GuiBackfaceVisibility visibility)
      Selects whether a transformed back face remains visible.
      Parameters:
      visibility - back-face behavior
      Returns:
      this component
    • motionPath

      public VirtualListComponent<K,V> motionPath(GuiMotionPath path)
      Sets the post-layout path followed by this component.
      Parameters:
      path - motion-path declaration
      Returns:
      this component
    • clipPath

      public VirtualListComponent<K,V> clipPath(GuiClipPath path)
      Sets the component clip path, or null to remove it.
      Parameters:
      path - clip path
      Returns:
      this component
    • maskLayers

      public VirtualListComponent<K,V> maskLayers(List<GuiMaskLayer> layers)
      Replaces the ordered mask-layer list.
      Parameters:
      layers - mask layers in paint order
      Returns:
      this component
    • maskLayers

      public VirtualListComponent<K,V> maskLayers(GuiMaskLayer... layers)
      Replaces the ordered mask-layer list.
      Parameters:
      layers - mask layers in paint order
      Returns:
      this component
    • filters

      public VirtualListComponent<K,V> filters(GuiFilterChain filters)
      Sets the ordered foreground filter chain.
      Parameters:
      filters - foreground filters
      Returns:
      this component
    • backdropFilters

      public VirtualListComponent<K,V> backdropFilters(GuiFilterChain filters)
      Sets filters applied to the game and retained GUI content already painted behind this component. The component's own fill, border, and descendants are painted sharply after the clipped backdrop pass.
      Parameters:
      filters - backdrop filters
      Returns:
      this component
    • enabled

      public VirtualListComponent<K,V> enabled(boolean enabled)
    • clipChildren

      public VirtualListComponent<K,V> clipChildren(boolean clipChildren)
      Sets whether child content is clipped to this component's content bounds.
      Parameters:
      clipChildren - whether to clip child content
      Returns:
      this component
    • isClippingChildren

      public boolean isClippingChildren()
      Returns whether child content is clipped to this component's content bounds.
      Returns:
      whether child content is clipped
    • requestFocus

      public VirtualListComponent<K,V> requestFocus()
    • tooltip

      public VirtualListComponent<K,V> tooltip(TooltipComponent tooltip)
    • contextMenu

      public VirtualListComponent<K,V> contextMenu(ContextMenuComponent contextMenu)
    • applyStyle

      public VirtualListComponent<K,V> applyStyle(GuiStylePreset preset)
      Applies a reusable sparse style preset.
      Parameters:
      preset - preset to apply
      Returns:
      this component
    • inlineStyle

      public VirtualListComponent<K,V> inlineStyle(Consumer<GuiStyleBuilder> declarations)
      Adds typed high-priority inline declarations for modern mode.

      Existing fluent setters write to the same precedence level. Cascade-wide INITIAL, INHERIT, and UNSET values are available through GuiStyleBuilder.set(GuiStyleProperty, T).

      Parameters:
      declarations - declaration callback
      Returns:
      this component
    • removeInlineStyle

      public VirtualListComponent<K,V> removeInlineStyle(GuiStyleProperty<?> property)
      Removes an authored modern inline override so stylesheets and component defaults can supply this property again. The legacy fluent value remains the component default; token subscriptions owned by the override are released. Removing an absent override is an inexpensive no-op.
      Parameters:
      property - property whose inline declaration should be removed
      Returns:
      this component
    • transitionAll

      public VirtualListComponent<K,V> transitionAll(double durationSeconds, GuiEasing easing)
    • transitionAll

      public VirtualListComponent<K,V> transitionAll(double durationSeconds, double delaySeconds, GuiEasing easing)
    • transitionAll

      public VirtualListComponent<K,V> transitionAll(double durationSeconds, double delaySeconds, GuiEasing easing, GuiTransitionBehavior behavior)
      Transitions every modern property, optionally including discrete values.
      Parameters:
      durationSeconds - duration in seconds
      delaySeconds - non-negative delay
      easing - timing function
      behavior - discrete transition policy
      Returns:
      this component
    • transition

      public VirtualListComponent<K,V> transition(double durationSeconds, double delaySeconds, GuiEasing easing, GuiTransitionBehavior behavior, GuiStyleProperty<?>... properties)
      Transitions selected typed modern properties.
      Parameters:
      durationSeconds - duration in seconds
      delaySeconds - non-negative delay
      easing - timing function
      behavior - discrete transition policy
      properties - modern properties
      Returns:
      this component
    • transition

      public VirtualListComponent<K,V> transition(double durationSeconds, GuiEasing easing, GuiTransitionBehavior behavior, GuiStyleProperty<?>... properties)
    • startingStyle

      public VirtualListComponent<K,V> startingStyle(Consumer<GuiStyleBuilder> declarations)
      Defines typed values used when this component first enters the styled tree.
      Parameters:
      declarations - starting declaration callback
      Returns:
      this component
    • transition

      public VirtualListComponent<K,V> transition(double durationSeconds, GuiEasing easing, GuiProperty<?>... properties)
    • transition

      public VirtualListComponent<K,V> transition(double durationSeconds, double delaySeconds, GuiEasing easing, GuiProperty<?>... properties)
    • transition

      public VirtualListComponent<K,V> transition(double durationSeconds, GuiEasing easing, GuiPropertyGroup... groups)
    • transition

      public VirtualListComponent<K,V> transition(double durationSeconds, double delaySeconds, GuiEasing easing, GuiPropertyGroup... groups)
    • hovered

      public VirtualListComponent<K,V> hovered(Consumer<VirtualListComponent<K,V>> consumer)
    • pressed

      public VirtualListComponent<K,V> pressed(Consumer<VirtualListComponent<K,V>> consumer)
    • focused

      public VirtualListComponent<K,V> focused(Consumer<VirtualListComponent<K,V>> consumer)
    • disabled

      public VirtualListComponent<K,V> disabled(Consumer<VirtualListComponent<K,V>> consumer)
    • animation

      public VirtualListComponent<K,V> animation(String name, GuiKeyframes keyframes)
    • play

      public VirtualListComponent<K,V> play(String name)
    • pause

      public VirtualListComponent<K,V> pause(String name)
      Freezes the last displayed sample of a named animation. Its retained contribution remains available when authored values change, while a clean tree stops scheduling continuous animation work.
      Parameters:
      name - animation name
      Returns:
      this component
    • resume

      public VirtualListComponent<K,V> resume(String name)
      Resumes a paused animation, excluding the complete pause interval even when frames reused the held sample. Completed finite animations retain their fill; use play(String) to restart them.
      Parameters:
      name - animation name
      Returns:
      this component
    • cancel

      public VirtualListComponent<K,V> cancel(String name)
      Cancels a named animation and schedules reevaluation of its underlying geometry and paint on the next frame. Configured property transitions keep their normal timing when keyframes release ownership, so restoration need not snap immediately. Unknown or already inactive names do not invalidate a prepared component.
      Parameters:
      name - animation name
      Returns:
      this component
    • id

      public VirtualListComponent<K,V> id(String id)
      Assigns this component's optional stable identifier.

      The identifier is visible to typed ID selectors, retained-tree lookup, devtools, and view-transition pairing. Recreating a component with the same ID morphs it from the old bounds to the new bounds. A null or blank value removes the identifier.

      Parameters:
      id - stable identifier, or null
      Returns:
      this component
    • id

      public String id()
      Returns this component's optional stable identifier.
      Returns:
      identifier, or null
    • findById

      public final Optional<GuiComponent<?>> findById(String id)
      Finds the uniquely identified component in this retained subtree.

      The search includes this component. Duplicate IDs are rejected because lookup and morph-transition ownership would otherwise be ambiguous.

      Parameters:
      id - identifier to find
      Returns:
      matching component, when present
      Throws:
      IllegalStateException - when the subtree contains the ID more than once
    • findById

      public final <C extends GuiComponent<?>> Optional<C> findById(String id, Class<C> componentType)
      Finds and type-checks a uniquely identified component in this retained subtree.
      Type Parameters:
      C - component type
      Parameters:
      id - identifier to find
      componentType - required component type
      Returns:
      matching typed component, when present
      Throws:
      IllegalStateException - when the ID is duplicated
      ClassCastException - when the matching component has another type
    • viewTransitionName

      public VirtualListComponent<K,V> viewTransitionName(String name)
      Assigns the stable name used to pair this component's old and new view-transition snapshots. This overrides the component ID for transition pairing. A null or blank name returns pairing to retained identity or ID.
      Parameters:
      name - transition name
      Returns:
      this component
    • viewTransitionName

      public final String viewTransitionName()
      Returns this component's explicit view-transition name.
      Returns:
      transition name, or null
    • styleClass

      public VirtualListComponent<K,V> styleClass(String... classes)
      Adds one or more selector-visible style classes.
      Parameters:
      classes - class names
      Returns:
      this component
    • removeStyleClass

      public VirtualListComponent<K,V> removeStyleClass(String styleClass)
      Removes a selector-visible style class.
      Parameters:
      styleClass - class name
      Returns:
      this component
    • styleClasses

      public Set<String> styleClasses()
      Returns immutable selector-visible style classes.
      Returns:
      style classes
    • styleAttribute

      public <V> VirtualListComponent<K,V> styleAttribute(GuiStyleAttribute<V> attribute, V value)
      Sets a typed selector-visible component attribute.
      Type Parameters:
      V - value type
      Parameters:
      attribute - attribute key
      value - value, or null to remove
      Returns:
      this component
    • styleAttribute

      public <V> Optional<V> styleAttribute(GuiStyleAttribute<V> attribute)
      Reads a typed style attribute.
      Type Parameters:
      V - value type
      Parameters:
      attribute - attribute key
      Returns:
      value when present
    • styleState

      public VirtualListComponent<K,V> styleState(GuiPseudoClass pseudoClass, boolean active)
      Sets an explicit standard pseudo-class value.

      Use this for semantic states such as checked, required, valid, or open. Pointer, focus, enabled, root, empty, and structural states are maintained by the runtime.

      Parameters:
      pseudoClass - pseudo-class
      active - active flag
      Returns:
      this component
    • styleState

      public VirtualListComponent<K,V> styleState(String state, boolean active)
      Sets a component-defined selector state.
      Parameters:
      state - state name
      active - active flag
      Returns:
      this component
    • stateProvider

      public VirtualListComponent<K,V> stateProvider(GuiStateProvider provider)
      Adds a dynamic state provider.
      Parameters:
      provider - provider
      Returns:
      this component
    • x

      public VirtualListComponent<K,V> x(float x)
    • y

      public VirtualListComponent<K,V> y(float y)
    • position

      public VirtualListComponent<K,V> position(float x, float y)
    • translateX

      public VirtualListComponent<K,V> translateX(float translateX)
    • translateY

      public VirtualListComponent<K,V> translateY(float translateY)
    • translate

      public VirtualListComponent<K,V> translate(float translateX, float translateY)
    • width

      public VirtualListComponent<K,V> width(float width)
    • height

      public VirtualListComponent<K,V> height(float height)
    • size

      public VirtualListComponent<K,V> size(float width, float height)
    • autoWidth

      public VirtualListComponent<K,V> autoWidth()
    • autoHeight

      public VirtualListComponent<K,V> autoHeight()
    • autoSize

      public VirtualListComponent<K,V> autoSize()
    • width

      public VirtualListComponent<K,V> width(GuiLength width)
      Sets a typed modern width. This declaration is used only by a modern host.
      Parameters:
      width - typed width
      Returns:
      this component
    • height

      public VirtualListComponent<K,V> height(GuiLength height)
      Sets a typed modern height.
      Parameters:
      height - typed height
      Returns:
      this component
    • size

      public VirtualListComponent<K,V> size(GuiLength width, GuiLength height)
    • minWidth

      public VirtualListComponent<K,V> minWidth(GuiLength width)
    • maxWidth

      public VirtualListComponent<K,V> maxWidth(GuiLength width)
    • minHeight

      public VirtualListComponent<K,V> minHeight(GuiLength height)
    • maxHeight

      public VirtualListComponent<K,V> maxHeight(GuiLength height)
    • boxSizing

      public VirtualListComponent<K,V> boxSizing(GuiBoxSizing boxSizing)
    • aspectRatio

      public VirtualListComponent<K,V> aspectRatio(GuiAspectRatio aspectRatio)
    • display

      public VirtualListComponent<K,V> display(GuiDisplay display)
    • defaultDisplay

      protected final void defaultDisplay(GuiDisplay display)
      Defines the formatting role supplied by a component type before authored styles and fluent inline declarations are applied.

      This is intended for component constructors. Calling display(GuiDisplay) after construction still creates the higher-priority inline declaration.

      Parameters:
      display - default formatting role
    • defineModernDefaults

      protected void defineModernDefaults(GuiStyleBuilder defaults)
      Adds stylesheet-overridable defaults for this component type.

      Fluent setters, including calls made by constructors, are inline declarations. Subclasses should override this hook when a value is a component default rather than an authored inline value.

      Parameters:
      defaults - builder receiving component defaults
    • invalidateModernDefaults

      protected final void invalidateModernDefaults()
      Invalidates cached declarations after state used by defineModernDefaults(GuiStyleBuilder) changes.
    • listStyleType

      public VirtualListComponent<K,V> listStyleType(GuiCounterStyle style)
      Selects the list counter style used by an automatic ::marker.
      Parameters:
      style - counter style
      Returns:
      this component
    • listStylePosition

      public VirtualListComponent<K,V> listStylePosition(GuiListStylePosition position)
      Places the automatic marker inside the first line or in an outside marker column.
      Parameters:
      position - marker position
      Returns:
      this component
    • listStyleImage

      public VirtualListComponent<K,V> listStyleImage(GuiListMarkerImage image)
      Replaces the automatic text marker with an explicitly sized image.
      Parameters:
      image - marker image, or null for generated counter text
      Returns:
      this component
    • markerSide

      public VirtualListComponent<K,V> markerSide(GuiMarkerSide side)
      Selects which writing direction determines the outside marker side.
      Parameters:
      side - marker-side policy
      Returns:
      this component
    • markerGap

      public VirtualListComponent<K,V> markerGap(float gap)
      Sets the space between an outside marker and the principal box.
      Parameters:
      gap - non-negative design-space gap
      Returns:
      this component
    • quotes

      public VirtualListComponent<K,V> quotes(GuiQuotePairs quotes)
      Selects generated open/close quote pairs.
      Parameters:
      quotes - quote pairs
      Returns:
      this component
    • scrollMargin

      public VirtualListComponent<K,V> scrollMargin(GuiScrollInsets margin)
      Sets the target's snap-area expansion.
      Parameters:
      margin - scroll margin
      Returns:
      this component
    • scrollMargin

      public VirtualListComponent<K,V> scrollMargin(float all)
      Sets a uniform snap-area expansion.
      Parameters:
      all - margin on every side
      Returns:
      this component
    • scrollSnapStop

      public VirtualListComponent<K,V> scrollSnapStop(GuiScrollSnapStop stop)
      Selects whether a snap operation may pass this target.
      Parameters:
      stop - stop policy
      Returns:
      this component
    • position

      public VirtualListComponent<K,V> position(GuiPositionType positionType)
    • inset

      public VirtualListComponent<K,V> inset(GuiLength all)
    • inset

      public VirtualListComponent<K,V> inset(GuiLength top, GuiLength right, GuiLength bottom, GuiLength left)
    • verticalAlign

      public VirtualListComponent<K,V> verticalAlign(GuiVerticalAlign verticalAlign)
    • flexDirection

      public VirtualListComponent<K,V> flexDirection(GuiFlexDirection direction)
    • flexWrap

      public VirtualListComponent<K,V> flexWrap(GuiFlexWrap wrap)
    • flexGrow

      public VirtualListComponent<K,V> flexGrow(float grow)
    • flexShrink

      public VirtualListComponent<K,V> flexShrink(float shrink)
    • flexBasis

      public VirtualListComponent<K,V> flexBasis(GuiLength basis)
    • order

      public VirtualListComponent<K,V> order(int order)
    • justifyContent

      public VirtualListComponent<K,V> justifyContent(GuiAlignment alignment)
    • alignItems

      public VirtualListComponent<K,V> alignItems(GuiAlignment alignment)
    • alignSelf

      public VirtualListComponent<K,V> alignSelf(GuiAlignment alignment)
    • alignContent

      public VirtualListComponent<K,V> alignContent(GuiAlignment alignment)
    • rowGap

      public VirtualListComponent<K,V> rowGap(GuiLength gap)
    • columnGap

      public VirtualListComponent<K,V> columnGap(GuiLength gap)
    • gridTemplate

      public VirtualListComponent<K,V> gridTemplate(GuiGridTemplate template)
    • gridPlacement

      public VirtualListComponent<K,V> gridPlacement(GuiGridPlacement placement)
    • gridAutoFlow

      public VirtualListComponent<K,V> gridAutoFlow(GuiGridAutoFlow flow)
    • justifyItems

      public VirtualListComponent<K,V> justifyItems(GuiAlignment alignment)
    • justifySelf

      public VirtualListComponent<K,V> justifySelf(GuiAlignment alignment)
    • tableLayout

      public VirtualListComponent<K,V> tableLayout(GuiTableLayout layout)
    • borderCollapse

      public VirtualListComponent<K,V> borderCollapse(GuiBorderCollapse collapse)
    • borderSpacing

      public VirtualListComponent<K,V> borderSpacing(float spacing)
    • captionSide

      public VirtualListComponent<K,V> captionSide(GuiCaptionSide side)
    • emptyCells

      public VirtualListComponent<K,V> emptyCells(GuiEmptyCells value)
    • columnCount

      public VirtualListComponent<K,V> columnCount(int count)
    • columnWidth

      public VirtualListComponent<K,V> columnWidth(GuiLength width)
    • columnFill

      public VirtualListComponent<K,V> columnFill(GuiColumnFill fill)
    • columnRule

      public VirtualListComponent<K,V> columnRule(GuiBorderSide rule)
    • columnSpan

      public VirtualListComponent<K,V> columnSpan(GuiColumnSpan span)
    • breakBefore

      public VirtualListComponent<K,V> breakBefore(GuiBreakValue value)
    • breakAfter

      public VirtualListComponent<K,V> breakAfter(GuiBreakValue value)
    • breakInside

      public VirtualListComponent<K,V> breakInside(GuiBreakValue value)
    • widows

      public VirtualListComponent<K,V> widows(int lines)
    • orphans

      public VirtualListComponent<K,V> orphans(int lines)
    • marginBreak

      public VirtualListComponent<K,V> marginBreak(GuiMarginBreak value)
    • pageName

      public VirtualListComponent<K,V> pageName(String name)
    • anchorName

      public VirtualListComponent<K,V> anchorName(String name)
    • anchorPlacement

      public VirtualListComponent<K,V> anchorPlacement(GuiAnchorPlacement placement)
    • anchor

      public VirtualListComponent<K,V> anchor(GuiAnchor anchor)
    • centered

      public VirtualListComponent<K,V> centered()
    • zIndex

      public VirtualListComponent<K,V> zIndex(int zIndex)
    • tabIndex

      public VirtualListComponent<K,V> tabIndex(int tabIndex)
      Sets this component's sequential keyboard-focus order.

      Positive values are visited first in ascending order, zero follows retained-tree order, and negative values opt out of Tab traversal while preserving mouse and programmatic focus.

      Parameters:
      tabIndex - sequential focus index
      Returns:
      this component
    • tabIndex

      public int tabIndex()
      Returns this component's sequential focus index.
      Returns:
      focus index
    • writeModernInline

      protected final <V> void writeModernInline(GuiStyleProperty<V> property, V value)
    • invalidateModernLayout

      protected final void invalidateModernLayout(String reason)
    • styleOpen

      protected boolean styleOpen()
      Allows controls with retained popup/expansion state to implement :open.
    • self

      protected final VirtualListComponent<K,V> self()
    • renderChildren

      protected final void renderChildren(com.render.api.gui.GuiRenderContext context)