Class ListView.Builder<B extends ListView.Builder<B>>

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

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

      public B setEnableRubberband(boolean enableRubberband)
      Allow rubberband selection.
      Parameters:
      enableRubberband - the value for the enable-rubberband property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setFactory

      public B setFactory(ListItemFactory factory)

      Factory for populating list items.

      The factory must be for configuring ListItem objects.

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

      public B setHeaderFactory(ListItemFactory headerFactory)

      Factory for creating header widgets.

      The factory must be for configuring ListHeader objects.

      Parameters:
      headerFactory - the value for the header-factory property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.12
    • setModel

      public B setModel(SelectionModel model)
      Model for the items displayed.
      Parameters:
      model - the value for the model property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setShowSeparators

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

      public B setSingleClickActivate(boolean singleClickActivate)
      Activate rows on single click and select them on hover.
      Parameters:
      singleClickActivate - the value for the single-click-activate 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.12
    • onActivate

      public B onActivate(ListView.ActivateCallback handler)

      Emitted when a row has been activated by the user.

      Activation usually happens via the list.activate-item action of the GtkListView.

      This allows for a convenient way to handle activation in a listview. See ListItem.setActivatable(boolean) for details on how to use this signal.

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