Class DropDown.Builder<B extends DropDown.Builder<B>>

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

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

      public B setEnableSearch(boolean enableSearch)

      Whether to show a search entry in the popup.

      Note that search requires Gtk.DropDown:expression to be set.

      Parameters:
      enableSearch - the value for the enable-search property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setExpression

      public B setExpression(Expression expression)

      An expression to evaluate to obtain strings to match against the search term.

      See Gtk.DropDown:enable-search for how to enable search. If Gtk.DropDown:factory is not set, the expression is also used to bind strings to labels produced by a default factory.

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

      public B setFactory(ListItemFactory factory)
      Factory for populating list items.
      Parameters:
      factory - the value for the factory property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setHeaderFactory

      public B setHeaderFactory(ListItemFactory headerFactory)
      The factory for creating header widgets for the popup.
      Parameters:
      headerFactory - the value for the header-factory property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.12
    • setListFactory

      public B setListFactory(ListItemFactory listFactory)

      The factory for populating list items in the popup.

      If this is not set, Gtk.DropDown:factory is used.

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

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

      public B setSearchMatchMode(StringFilterMatchMode searchMatchMode)
      The match mode for the search filter.
      Parameters:
      searchMatchMode - the value for the search-match-mode property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.12
    • setSelected

      public B setSelected(int selected)

      The position of the selected item.

      If no item is selected, the property has the value GTK_INVALID_LIST_POSITION.

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

      public B setShowArrow(boolean showArrow)
      Whether to show an arrow within the GtkDropDown widget.
      Parameters:
      showArrow - the value for the show-arrow property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.6
    • onActivate

      public B onActivate(DropDown.ActivateCallback handler)

      Emitted to when the drop down is activated.

      The ::activate signal on GtkDropDown is an action signal and emitting it causes the drop down to pop up its dropdown.

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