Class ComboRow.Builder<B extends ComboRow.Builder<B>>

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

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

      If set to TRUE, a search entry will be shown in the popup that allows to search for items in the list.

      Search requires ComboRow:expression to be set.

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

      public B setExpression(Expression expression)

      An expression used to obtain strings from items.

      The expression must have a value type of G_TYPE_STRING.

      It's used to bind strings to labels produced by the default factory if ComboRow:factory is not set, or when ComboRow:use-subtitle is set to TRUE.

      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.

      This factory is always used for the item in the row. It is also used for items in the popup unless ComboRow:list-factory is set.

      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:
      1.6
    • setListFactory

      public B setListFactory(ListItemFactory listFactory)

      The factory for populating list items in the popup.

      If this is not set, ComboRow: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)
      The model that provides 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:
      1.6
    • 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
    • setUseSubtitle

      public B setUseSubtitle(boolean useSubtitle)

      Whether to use the current value as the subtitle.

      If you use a custom list item factory, you will need to give the row a name conversion expression with ComboRow:expression.

      If set to TRUE, you should not access ActionRow:subtitle.

      The subtitle is interpreted as Pango markup if PreferencesRow:use-markup is set to TRUE.

      Parameters:
      useSubtitle - the value for the use-subtitle property
      Returns:
      the Builder instance is returned, to allow method chaining