Class IMContext.Builder<B extends IMContext.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Direct Known Subclasses:
IMContextSimple.Builder, IMMulticontext.Builder, VimIMContext.Builder
Enclosing class:
IMContext

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

      public B setInputHints(Set<InputHints> inputHints)
      Additional hints that allow input methods to fine-tune their behaviour.
      Parameters:
      inputHints - the value for the input-hints property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setInputPurpose

      public B setInputPurpose(InputPurpose inputPurpose)

      The purpose of the text field that the `GtkIMContext is connected to.

      This property can be used by on-screen keyboards and other input methods to adjust their behaviour.

      Parameters:
      inputPurpose - the value for the input-purpose property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setInputHints

      public B setInputHints(InputHints... inputHints)
      Additional hints that allow input methods to fine-tune their behaviour.
      Parameters:
      inputHints - the value for the input-hints property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onCommit

      public B onCommit(IMContext.CommitCallback handler)

      The ::commit signal is emitted when a complete input sequence has been entered by the user.

      If the commit comes after a preediting sequence, the ::commit signal is emitted after ::preedit-end.

      This can be a single character immediately after a key press or the final result of preediting.

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

      public B onDeleteSurrounding(IMContext.DeleteSurroundingCallback handler)
      The ::delete-surrounding signal is emitted when the input method needs to delete all or part of the context surrounding the cursor.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onInvalidComposition

      public B onInvalidComposition(IMContext.InvalidCompositionCallback handler)
      Emitted when the filtered keys do not compose to a single valid character.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.22
      See Also:
    • onPreeditChanged

      public B onPreeditChanged(IMContext.PreeditChangedCallback handler)

      The ::preedit-changed signal is emitted whenever the preedit sequence currently being entered has changed.

      It is also emitted at the end of a preedit sequence, in which case IMContext.getPreeditString(Out, Out, Out) returns the empty string.

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

      public B onPreeditEnd(IMContext.PreeditEndCallback handler)
      The ::preedit-end signal is emitted when a preediting sequence has been completed or canceled.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onPreeditStart

      public B onPreeditStart(IMContext.PreeditStartCallback handler)
      The ::preedit-start signal is emitted when a new preediting sequence starts.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onRetrieveSurrounding

      public B onRetrieveSurrounding(IMContext.RetrieveSurroundingCallback handler)

      The ::retrieve-surrounding signal is emitted when the input method requires the context surrounding the cursor.

      The callback should set the input method surrounding context by calling the IMContext.setSurrounding(String, int, int) method.

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