Class ViewStack.Builder<B extends ViewStack.Builder<B>>

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

public static class ViewStack.Builder<B extends ViewStack.Builder<B>> extends Widget.Builder<B> implements Accessible.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 ViewStack build()
      Finish building the ViewStack object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to ViewStack.
      Overrides:
      build in class Widget.Builder<B extends ViewStack.Builder<B>>
      Returns:
      a new instance of ViewStack with the properties that were set in the Builder object.
    • setEnableTransitions

      public B setEnableTransitions(boolean enableTransitions)

      Whether the stack uses a crossfade transition between pages.

      Use ViewStack:transition-duration to control the duration, and ViewStack:transition-running to know when the transition is running.

      Parameters:
      enableTransitions - the value for the enable-transitions property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.7
    • setHhomogeneous

      public B setHhomogeneous(boolean hhomogeneous)

      Whether the stack is horizontally homogeneous.

      If the stack is horizontally homogeneous, it allocates the same width for all children.

      If it's FALSE, the stack may change width when a different child becomes visible.

      Parameters:
      hhomogeneous - the value for the hhomogeneous property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setTransitionDuration

      public B setTransitionDuration(int transitionDuration)

      The transition animation duration, in milliseconds.

      Only used when ViewStack:enable-transitions is set to TRUE.

      Parameters:
      transitionDuration - the value for the transition-duration property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.7
    • setVhomogeneous

      public B setVhomogeneous(boolean vhomogeneous)

      Whether the stack is vertically homogeneous.

      If the stack is vertically homogeneous, it allocates the same height for all children.

      If it's FALSE, the stack may change height when a different child becomes visible.

      Parameters:
      vhomogeneous - the value for the vhomogeneous property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setVisibleChild

      public B setVisibleChild(Widget visibleChild)
      The widget currently visible in the stack.
      Parameters:
      visibleChild - the value for the visible-child property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setVisibleChildName

      public B setVisibleChildName(String visibleChildName)

      The name of the widget currently visible in the stack.

      See ViewStack:visible-child.

      Parameters:
      visibleChildName - the value for the visible-child-name property
      Returns:
      the Builder instance is returned, to allow method chaining