Class AppLaunchContext.Builder<B extends AppLaunchContext.Builder<B>>

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

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

      public B onLaunchFailed(AppLaunchContext.LaunchFailedCallback handler)

      The Gio.AppLaunchContext::launch-failed signal is emitted when a AppInfo launch fails. The startup notification id is provided, so that the launcher can cancel the startup notification.

      Because a launch operation may involve spawning multiple instances of the target application, you should expect this signal to be emitted multiple times, one for each spawned instance.

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

      public B onLaunchStarted(AppLaunchContext.LaunchStartedCallback handler)

      The Gio.AppLaunchContext::launch-started signal is emitted when a AppInfo is about to be launched. If non-null the platformData is an GVariant dictionary mapping strings to variants (ie a{sv}), which contains additional, platform-specific data about this launch. On UNIX, at least the startup-notification-id keys will be present.

      The value of the startup-notification-id key (type s) is a startup notification ID corresponding to the format from the startup-notification specification. It allows tracking the progress of the launchee through startup.

      It is guaranteed that this signal is followed by either a Gio.AppLaunchContext::launched or Gio.AppLaunchContext::launch-failed signal.

      Because a launch operation may involve spawning multiple instances of the target application, you should expect this signal to be emitted multiple times, one for each spawned instance.

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

      public B onLaunched(AppLaunchContext.LaunchedCallback handler)

      The Gio.AppLaunchContext::launched signal is emitted when a AppInfo is successfully launched.

      Because a launch operation may involve spawning multiple instances of the target application, you should expect this signal to be emitted multiple times, one time for each spawned instance.

      The platformData is an GVariant dictionary mapping strings to variants (ie a{sv}), which contains additional, platform-specific data about this launch. On UNIX, at least the pid and startup-notification-id keys will be present.

      Since 2.72 the pid may be 0 if the process id wasn’t known (for example if the process was launched via D-Bus). The pid may not be set at all in subsequent releases.

      On Windows, pid is guaranteed to be valid only for the duration of the Gio.AppLaunchContext::launched signal emission; after the signal is emitted, GLib will call GLib#spawnClosePid. If you need to keep the GLib.Pid after the signal has been emitted, then you can duplicate pid using DuplicateHandle().

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