Class Application.Builder<B extends Application.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Direct Known Subclasses:
Application.Builder
Enclosing class:
Application

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

      public B setMenubar(MenuModel menubar)
      The menu model to be used for the application's menu bar.
      Parameters:
      menubar - the value for the menubar property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setRegisterSession

      @Deprecated public B setRegisterSession(boolean registerSession)
      Deprecated.
      This property is ignored. GTK always registers with the session manager

      Set this property to true to register with the session manager.

      This will make GTK track the session state (such as the Gtk.Application:screensaver-active property).

      Parameters:
      registerSession - the value for the register-session property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onQueryEnd

      public B onQueryEnd(Application.QueryEndCallback handler)

      Emitted when the session manager is about to end the session.

      Applications can connect to this signal and call Application.inhibit(Window, Set, String) with Gtk.ApplicationInhibitFlags.logout to delay the end of the session until state has been saved.

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

      public B onWindowAdded(Application.WindowAddedCallback handler)

      Emitted when a window is added to an application.

      See Application.addWindow(Window).

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

      public B onWindowRemoved(Application.WindowRemovedCallback handler)

      Emitted when a window is removed from an application.

      This can happen as a side-effect of the window being destroyed or explicitly through Application.removeWindow(Window).

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