Class SearchEntry.Builder<B extends SearchEntry.Builder<B>>

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

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

      public B setActivatesDefault(boolean activatesDefault)
      Whether to activate the default widget when Enter is pressed.
      Parameters:
      activatesDefault - the value for the activates-default property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setInputHints

      public B setInputHints(Set<InputHints> inputHints)
      The hints about input for the GtkSearchEntry used to alter the behaviour of input methods.
      Parameters:
      inputHints - the value for the input-hints property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.14
    • setInputPurpose

      public B setInputPurpose(InputPurpose inputPurpose)
      The purpose for the GtkSearchEntry input used to alter the behaviour of input methods.
      Parameters:
      inputPurpose - the value for the input-purpose property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.14
    • setKeyCaptureWidget

      public B setKeyCaptureWidget(Widget keyCaptureWidget)

      The widget that the entry will use to capture key events.

      Key events are consumed by the search entry to start or continue a search.

      Parameters:
      keyCaptureWidget - the value for the key-capture-widget property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.22
    • setPlaceholderText

      public B setPlaceholderText(String placeholderText)
      The text that will be displayed in the GtkSearchEntry when it is empty and unfocused.
      Parameters:
      placeholderText - the value for the placeholder-text property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setSearchDelay

      public B setSearchDelay(int searchDelay)
      The delay in milliseconds from last keypress to the search changed signal.
      Parameters:
      searchDelay - the value for the search-delay property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.8
    • setInputHints

      public B setInputHints(InputHints... inputHints)
      The hints about input for the GtkSearchEntry used to alter the behaviour of input methods.
      Parameters:
      inputHints - the value for the input-hints property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.14
    • onActivate

      public B onActivate(SearchEntry.ActivateCallback handler)

      Emitted when the entry is activated.

      The keybindings for this signal are all forms of the Enter key.

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

      public B onNextMatch(SearchEntry.NextMatchCallback handler)

      Emitted when the user initiates a move to the next match for the current search string.

      This is a keybinding signal.

      Applications should connect to it, to implement moving between matches.

      The default bindings for this signal is Ctrl+g.

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

      public B onPreviousMatch(SearchEntry.PreviousMatchCallback handler)

      Emitted when the user initiates a move to the previous match for the current search string.

      This is a keybinding signal.

      Applications should connect to it, to implement moving between matches.

      The default bindings for this signal is Ctrl+Shift+g.

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

      public B onSearchChanged(SearchEntry.SearchChangedCallback handler)
      Emitted with a delay. The length of the delay can be changed with the Gtk.SearchEntry:search-delay property.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onSearchStarted

      public B onSearchStarted(SearchEntry.SearchStartedCallback handler)
      Emitted when the user initiated a search on the entry.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onStopSearch

      public B onStopSearch(SearchEntry.StopSearchCallback handler)

      Emitted when the user stops a search via keyboard input.

      This is a keybinding signal.

      Applications should connect to it, to implement hiding the search entry in this case.

      The default bindings for this signal is Escape.

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