Class CellRendererCombo.Builder<B extends CellRendererCombo.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Enclosing class:
CellRendererCombo

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

      public B setHasEntry(boolean hasEntry)
      If true, the cell renderer will include an entry and allow to enter values other than the ones in the popup list.
      Parameters:
      hasEntry - the value for the has-entry property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setModel

      public B setModel(TreeModel model)
      Holds a tree model containing the possible values for the combo box. Use the text_column property to specify the column holding the values.
      Parameters:
      model - the value for the model property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setTextColumn

      public B setTextColumn(int textColumn)

      Specifies the model column which holds the possible values for the combo box.

      Note that this refers to the model specified in the model property, not the model backing the tree view to which this cell renderer is attached.

      GtkCellRendererCombo automatically adds a text cell renderer for this column to its combo box.

      Parameters:
      textColumn - the value for the text-column property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onChanged

      public B onChanged(CellRendererCombo.ChangedCallback handler)

      This signal is emitted each time after the user selected an item in the combo box, either by using the mouse or the arrow keys. Contrary to GtkComboBox, GtkCellRendererCombo::changed is not emitted for changes made to a selected item in the entry. The argument newIter corresponds to the newly selected item in the combo box and it is relative to the GtkTreeModel set via the model property on GtkCellRendererCombo.

      Note that as soon as you change the model displayed in the tree view, the tree view will immediately cease the editing operating. This means that you most probably want to refrain from changing the model until the combo cell renderer emits the edited or editing_canceled signal.

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