Class Viewport.Builder<B extends Viewport.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
Accessible.Builder<B>, Scrollable.Builder<B>, BuilderInterface
Enclosing class:
Viewport

public static class Viewport.Builder<B extends Viewport.Builder<B>> extends Widget.Builder<B> implements Accessible.Builder<B>, Scrollable.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public Viewport build()
      Finish building the Viewport object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to Viewport.
      Overrides:
      build in class Widget.Builder<B extends Viewport.Builder<B>>
      Returns:
      a new instance of Viewport with the properties that were set in the Builder object.
    • setChild

      public B setChild(Widget child)
      The child widget.
      Parameters:
      child - the value for the child property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setScrollToFocus

      public B setScrollToFocus(boolean scrollToFocus)

      Whether to scroll when the focus changes.

      Before 4.6.2, this property was mistakenly defaulting to FALSE, so if your code needs to work with older versions, consider setting it explicitly to TRUE.

      Parameters:
      scrollToFocus - the value for the scroll-to-focus property
      Returns:
      the Builder instance is returned, to allow method chaining