Class EntryCompletion.Builder<B extends EntryCompletion.Builder<B>>

java.lang.Object
org.javagi.gobject.Builder<B>
org.gnome.gobject.GObject.Builder<B>
org.gnome.gtk.EntryCompletion.Builder<B>
Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Enclosing class:
EntryCompletion

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

      public B setCellArea(CellArea cellArea)

      The GtkCellArea used to layout cell renderers in the treeview column.

      If no area is specified when creating the entry completion with EntryCompletion.withArea(CellArea), a horizontally oriented CellAreaBox will be used.

      Parameters:
      cellArea - the value for the cell-area property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setInlineCompletion

      public B setInlineCompletion(boolean inlineCompletion)

      Determines whether the common prefix of the possible completions should be inserted automatically in the entry.

      Note that this requires text-column to be set, even if you are using a custom match function.

      Parameters:
      inlineCompletion - the value for the inline-completion property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setInlineSelection

      public B setInlineSelection(boolean inlineSelection)
      Determines whether the possible completions on the popup will appear in the entry as you navigate through them.
      Parameters:
      inlineSelection - the value for the inline-selection property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setMinimumKeyLength

      public B setMinimumKeyLength(int minimumKeyLength)
      The minimum key length as set for completion.
      Parameters:
      minimumKeyLength - the value for the minimum-key-length property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setModel

      public B setModel(TreeModel model)
      The model used as data source.
      Parameters:
      model - the value for the model property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setPopupCompletion

      public B setPopupCompletion(boolean popupCompletion)
      Determines whether the possible completions should be shown in a popup window.
      Parameters:
      popupCompletion - the value for the popup-completion property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setPopupSetWidth

      public B setPopupSetWidth(boolean popupSetWidth)
      Determines whether the completions popup window will be resized to the width of the entry.
      Parameters:
      popupSetWidth - the value for the popup-set-width property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setPopupSingleMatch

      public B setPopupSingleMatch(boolean popupSingleMatch)

      Determines whether the completions popup window will shown for a single possible completion.

      You probably want to set this to false if you are using Gtk.EntryCompletion:inline-completion.

      Parameters:
      popupSingleMatch - the value for the popup-single-match property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setTextColumn

      public B setTextColumn(int textColumn)

      The column of the model containing the strings.

      Note that the strings must be UTF-8.

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

      public B onCursorOnMatch(EntryCompletion.CursorOnMatchCallback handler)

      Emitted when a match from the cursor is on a match of the list.

      The default behaviour is to replace the contents of the entry with the contents of the text column in the row pointed to by iter.

      Note that model is the model that was passed to EntryCompletion.setModel(TreeModel).

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

      public B onInsertPrefix(EntryCompletion.InsertPrefixCallback handler)

      Emitted when the inline autocompletion is triggered.

      The default behaviour is to make the entry display the whole prefix and select the newly inserted part.

      Applications may connect to this signal in order to insert only a smaller part of the prefix into the entry - e.g. the entry used in the GtkFileChooser inserts only the part of the prefix up to the next '/'.

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

      public B onMatchSelected(EntryCompletion.MatchSelectedCallback handler)

      Emitted when a match from the list is selected.

      The default behaviour is to replace the contents of the entry with the contents of the text column in the row pointed to by iter.

      Note that model is the model that was passed to EntryCompletion.setModel(TreeModel).

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

      public B onNoMatches(EntryCompletion.NoMatchesCallback handler)

      Emitted when the filter model has zero number of rows in completion_complete method.

      In other words when GtkEntryCompletion is out of suggestions.

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