Class ProgressBar.Builder<B extends ProgressBar.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:
ProgressBar

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

      public B setEllipsize(EllipsizeMode ellipsize)

      The preferred place to ellipsize the string.

      The text will be ellipsized if the progress bar does not have enough room to display the entire string, specified as a PangoEllipsizeMode.

      Note that setting this property to a value other than EllipsizeMode.NONE has the side-effect that the progress bar requests only enough space to display the ellipsis ("..."). Another means to set a progress bar's width is Widget.setSizeRequest(int, int).

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

      public B setFraction(double fraction)
      The fraction of total work that has been completed.
      Parameters:
      fraction - the value for the fraction property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setInverted

      public B setInverted(boolean inverted)
      Invert the direction in which the progress bar grows.
      Parameters:
      inverted - the value for the inverted property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setPulseStep

      public B setPulseStep(double pulseStep)
      The fraction of total progress to move the bounding block when pulsed.
      Parameters:
      pulseStep - the value for the pulse-step property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setShowText

      public B setShowText(boolean showText)

      Sets whether the progress bar will show a text in addition to the bar itself.

      The shown text is either the value of the Gtk.ProgressBar:text property or, if that is null, the Gtk.ProgressBar:fraction value, as a percentage.

      To make a progress bar that is styled and sized suitably for showing text (even if the actual text is blank), set Gtk.ProgressBar:show-text to true and Gtk.ProgressBar:text to the empty string (not null).

      Parameters:
      showText - the value for the show-text property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setText

      public B setText(String text)
      Text to be displayed in the progress bar.
      Parameters:
      text - the value for the text property
      Returns:
      the Builder instance is returned, to allow method chaining