Class VimIMContext.Builder<B extends VimIMContext.Builder<B>>

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

public static class VimIMContext.Builder<B extends VimIMContext.Builder<B>> extends IMContext.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
Since:
5.4
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

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

      public B onEdit(VimIMContext.EditCallback handler)

      Requests the application open the file found at path.

      If path is null, then the current file should be reloaded from storage.

      This may be executed in relation to the user running the :edit or :e commands.

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

      public B onExecuteCommand(VimIMContext.ExecuteCommandCallback handler)

      The signal is emitted when a command should be executed. This might be something like :wq or :e <path>.

      If the application chooses to implement this, it should return true from this signal to indicate the command has been handled.

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

      public B onFormatText(VimIMContext.FormatTextCallback handler)
      Requests that the application format the text between begin and end.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      5.4
      See Also:
    • onWrite

      public B onWrite(VimIMContext.WriteCallback handler)

      Requests the application save the file.

      If a filename was provided, it will be available to the signal handler as path. This may be executed in relation to the user running the :write or :w commands.

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