Class ScrollContainer.Builder

Enclosing class:
ScrollContainer

public static class ScrollContainer.Builder extends AbstractPanelElement.Builder<ScrollContainer, ScrollContainer.Builder>
  • Constructor Details

    • Builder

      protected Builder()
  • Method Details

    • self

      protected ScrollContainer.Builder self()
      Description copied from class: AbstractPanelElement.Builder
      Returns this as the concrete builder.
      Specified by:
      self in class AbstractPanelElement.Builder<ScrollContainer, ScrollContainer.Builder>
    • size

      public ScrollContainer.Builder size(int width, int height)
      Required: the outer size, scrollbar lane included.
      Overrides:
      size in class AbstractPanelElement.Builder<ScrollContainer, ScrollContainer.Builder>
    • height

      public ScrollContainer.Builder height(int height)
      The viewport's height alone, for a container that fits its width to its content (fitWidth).
    • fitWidth

      public ScrollContainer.Builder fitWidth()
      As wide as its content instead of a declared width: the widest child, the band's inset in the Default look and the scrollbar lane. Given more room by its panel, it takes it and lays its children out to it. Give it its height(int).
    • fitHeight

      public ScrollContainer.Builder fitHeight()
      As tall as its content up to the declared height, scrolling past it. It pushes what is below it as it grows (7.3.0): place what follows as if it took no room.
    • laneOutside

      public ScrollContainer.Builder laneOutside()
      The scrollbar lane beside the declared width rather than inside it (7.4.0): the content has the whole width, and the container is a lane wider only while the content overflows, so what holds it makes room for the scrollbar just then. With size(int, int), not fitWidth().
    • fitRoom

      public ScrollContainer.Builder fitRoom(int step)
      As tall as its content while there is room, shorter by whole steps when there is not, never below the declared height (7.4.0): content shorter than that leaves the rest of the declared height empty, so the frame keeps its size as the content shrinks. In a container region section it shows every row without a scrollbar while the window has the height and scrolls once it is too short; elsewhere it is as tall as its content. It pushes what is below it, as fitHeight() does. Pair with laneOutside() for a lane only while it scrolls: .size(ContainerRegion.CONTENT_WIDTH, 3 * 18).laneOutside().fitRoom(18).
      Parameters:
      step - the row height it shrinks by, > 0
    • fillHeight

      public ScrollContainer.Builder fillHeight()
      Takes the height its container gives it (7.3.0): the room a panel's viewport leaves below it, what a vertical Flow has left after its other children, a Tabs page's height. So a header stays put above it and only it scrolls: a list under a title and a "New" row. Where there is no height to give, it is its declared height, or without one as tall as its content. Pair with size(int, int) or fitWidth().
    • content

      public ScrollContainer.Builder content(List<? extends PanelElement> content)
      Required: the children, positioned from the viewport's top-left.
    • contentHeight

      public ScrollContainer.Builder contentHeight(int pixels)
      The scrollable height, when not the children's extent (room past the end, say).
    • state

      The consumer owns the scroll, in pixels from the top: get is read every frame, set receives each change. Without it the scroll is the container's own view state.
    • build

      public ScrollContainer build()
      Description copied from class: AbstractPanelElement.Builder
      Builds the element. Throws IllegalStateException when a required setting is missing.
      Specified by:
      build in class AbstractPanelElement.Builder<ScrollContainer, ScrollContainer.Builder>