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

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

      public B setMaxColumns(int maxColumns)

      Maximum number of columns per row.

      If this number is smaller than Gtk.GridView:min-columns, that value is used instead.

      Parameters:
      maxColumns - the value for the max-columns property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setMinColumns

      public B setMinColumns(int minColumns)
      Minimum number of columns per row.
      Parameters:
      minColumns - the value for the min-columns property
      Returns:
      the Builder instance is returned, to allow method chaining
    • 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
    • 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(GridView.ActivateCallback handler)

      Emitted when a cell has been activated by the user, usually via activating the GtkGridView|list.activate-item action.

      This allows for a convenient way to handle activation in a gridview. See Gtk.ListItem:activatable 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: