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

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

      public B setAcceptUnpairedRelease(boolean acceptUnpairedRelease)
      Whether to accept unpaired release events.
      Parameters:
      acceptUnpairedRelease - the value for the accept-unpaired-release property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setActivateOnSingleClick

      public B setActivateOnSingleClick(boolean activateOnSingleClick)
      Determines whether children can be activated with a single click, or require a double-click.
      Parameters:
      activateOnSingleClick - the value for the activate-on-single-click property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setColumnSpacing

      public B setColumnSpacing(int columnSpacing)
      The amount of horizontal space between two children.
      Parameters:
      columnSpacing - the value for the column-spacing property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setHomogeneous

      public B setHomogeneous(boolean homogeneous)
      Determines whether all children should be allocated the same size.
      Parameters:
      homogeneous - the value for the homogeneous property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setMaxChildrenPerLine

      public B setMaxChildrenPerLine(int maxChildrenPerLine)
      The maximum amount of children to request space for consecutively in the given orientation.
      Parameters:
      maxChildrenPerLine - the value for the max-children-per-line property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setMinChildrenPerLine

      public B setMinChildrenPerLine(int minChildrenPerLine)

      The minimum number of children to allocate consecutively in the given orientation.

      Setting the minimum children per line ensures that a reasonably small height will be requested for the overall minimum width of the box.

      Parameters:
      minChildrenPerLine - the value for the min-children-per-line property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setRowSpacing

      public B setRowSpacing(int rowSpacing)
      The amount of vertical space between two children.
      Parameters:
      rowSpacing - the value for the row-spacing property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setSelectionMode

      public B setSelectionMode(SelectionMode selectionMode)
      The selection mode used by the flow box.
      Parameters:
      selectionMode - the value for the selection-mode property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onActivateCursorChild

      public B onActivateCursorChild(FlowBox.ActivateCursorChildCallback handler)

      Emitted when the user activates the box.

      This is a keybinding signal.

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

      public B onChildActivated(FlowBox.ChildActivatedCallback handler)
      Emitted when a child has been activated by the user.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onMoveCursor

      public B onMoveCursor(FlowBox.MoveCursorCallback handler)

      Emitted when the user initiates a cursor movement.

      This is a keybinding signal. Applications should not connect to it, but may emit it with g_signal_emit_by_name() if they need to control the cursor programmatically.

      The default bindings for this signal come in two variants, the variant with the Shift modifier extends the selection, the variant without the Shift modifier does not. There are too many key combinations to list them all here.

      • , , , move by individual children
      • Home, End move to the ends of the box
      • PgUp, PgDn move vertically by pages
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onSelectAll

      public B onSelectAll(FlowBox.SelectAllCallback handler)

      Emitted to select all children of the box, if the selection mode permits it.

      This is a keybinding signal.

      The default bindings for this signal is Ctrl-a.

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

      public B onSelectedChildrenChanged(FlowBox.SelectedChildrenChangedCallback handler)

      Emitted when the set of selected children changes.

      Use FlowBox.selectedForeach(FlowBoxForeachFunc) or FlowBox.getSelectedChildren() to obtain the selected children.

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

      public B onToggleCursorChild(FlowBox.ToggleCursorChildCallback handler)

      Emitted to toggle the selection of the child that has the focus.

      This is a keybinding signal.

      The default binding for this signal is Ctrl-Space.

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

      public B onUnselectAll(FlowBox.UnselectAllCallback handler)

      Emitted to unselect all children of the box, if the selection mode permits it.

      This is a keybinding signal.

      The default bindings for this signal is Ctrl-Shift-a.

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