Class SpinRow.Builder<B extends SpinRow.Builder<B>>

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

public static class SpinRow.Builder<B extends SpinRow.Builder<B>> extends ActionRow.Builder<B> implements Accessible.Builder<B>, Actionable.Builder<B>, Editable.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
Since:
1.4
  • Constructor Details

    • Builder

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

    • build

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

      public B setAdjustment(Adjustment adjustment)
      The adjustment that holds the value of the spin row.
      Parameters:
      adjustment - the value for the adjustment property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setClimbRate

      public B setClimbRate(double climbRate)
      The acceleration rate when you hold down a button or key.
      Parameters:
      climbRate - the value for the climb-rate property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setDigits

      public B setDigits(int digits)
      The number of decimal places to display.
      Parameters:
      digits - the value for the digits property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setNumeric

      public B setNumeric(boolean numeric)
      Whether non-numeric characters should be ignored.
      Parameters:
      numeric - the value for the numeric property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setSnapToTicks

      public B setSnapToTicks(boolean snapToTicks)
      Whether invalid values are snapped to the nearest step increment.
      Parameters:
      snapToTicks - the value for the snap-to-ticks property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setUpdatePolicy

      public B setUpdatePolicy(SpinButtonUpdatePolicy updatePolicy)

      The policy for updating the spin row.

      The options are always, or only when the value is invalid.

      Parameters:
      updatePolicy - the value for the update-policy property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setValue

      public B setValue(double value)
      The current value.
      Parameters:
      value - the value for the value property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • setWrap

      public B setWrap(boolean wrap)
      Whether the spin row should wrap upon reaching its limits.
      Parameters:
      wrap - the value for the wrap property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
    • onInput

      public B onInput(SpinRow.InputCallback handler)

      Emitted to convert the user's input into a double value.

      The signal handler is expected to use Editable#getText to retrieve the text of the spinbutton and set new_value to the new value.

      The default conversion uses GLib#strtod.

      See Gtk.SpinButton::input.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
      See Also:
    • onOutput

      public B onOutput(SpinRow.OutputCallback handler)

      Emitted to tweak the formatting of the value for display.

      See Gtk.SpinButton::output.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
      See Also:
    • onWrapped

      public B onWrapped(SpinRow.WrappedCallback handler)

      Emitted right after the spinbutton wraps.

      See Gtk.SpinButton::wrapped.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4
      See Also: