Class ListBox.Builder<B extends ListBox.Builder<B>>

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

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

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

      public B setShowSeparators(boolean showSeparators)
      Whether to show separators between rows.
      Parameters:
      showSeparators - the value for the show-separators property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setTabBehavior

      public B setTabBehavior(ListTabBehavior tabBehavior)
      Behavior of the Tab key
      Parameters:
      tabBehavior - the value for the tab-behavior property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.18
    • onActivateCursorRow

      public B onActivateCursorRow(ListBox.ActivateCursorRowCallback handler)
      Emitted when the cursor row is activated.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onMoveCursor

      public B onMoveCursor(ListBox.MoveCursorCallback handler)

      Emitted when the user initiates a cursor movement.

      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:
    • onRowActivated

      public B onRowActivated(ListBox.RowActivatedCallback handler)
      Emitted when a row has been activated by the user.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onRowSelected

      public B onRowSelected(ListBox.RowSelectedCallback handler)

      Emitted when a new row is selected, or (with a null row) when the selection is cleared.

      When the box is using SelectionMode.MULTIPLE, this signal will not give you the full picture of selection changes, and you should use the Gtk.ListBox::selected-rows-changed signal instead.

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

      public B onSelectAll(ListBox.SelectAllCallback handler)

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

      This is a keybinding signal.

      The default binding for this signal is Ctrl-a.

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

      public B onSelectedRowsChanged(ListBox.SelectedRowsChangedCallback handler)
      Emitted when the set of selected rows changes.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onToggleCursorRow

      public B onToggleCursorRow(ListBox.ToggleCursorRowCallback handler)

      Emitted when the cursor row is toggled.

      The default bindings for this signal is Ctrl+.

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

      public B onUnselectAll(ListBox.UnselectAllCallback handler)

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

      This is a keybinding signal.

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

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