Class CenterBox.Builder<B extends CenterBox.Builder<B>>

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

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

      public B setBaselinePosition(BaselinePosition baselinePosition)
      The position of the baseline aligned widget if extra space is available.
      Parameters:
      baselinePosition - the value for the baseline-position property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setCenterWidget

      public B setCenterWidget(Widget centerWidget)
      The widget that is placed at the center position.
      Parameters:
      centerWidget - the value for the center-widget property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.10
    • setEndWidget

      public B setEndWidget(Widget endWidget)

      The widget that is placed at the end position.

      In vertical orientation, the end position is at the bottom. In horizontal orientation, the end position is at the trailing edge with respect to the text direction.

      Parameters:
      endWidget - the value for the end-widget property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.10
    • setShrinkCenterLast

      public B setShrinkCenterLast(boolean shrinkCenterLast)

      Whether to shrink the center widget after other children.

      By default, when there's no space to give all three children their natural widths, the start and end widgets start shrinking and the center child keeps natural width until they reach minimum width.

      If false, start and end widgets keep natural width and the center widget starts shrinking instead.

      Parameters:
      shrinkCenterLast - the value for the shrink-center-last property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.12
    • setStartWidget

      public B setStartWidget(Widget startWidget)

      The widget that is placed at the start position.

      In vertical orientation, the start position is at the top. In horizontal orientation, the start position is at the leading edge with respect to the text direction.

      Parameters:
      startWidget - the value for the start-widget property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.10