Class AppLaunchContext.Builder<B extends 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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theAppLaunchContext
object.TheGio.AppLaunchContext::launched
signal is emitted when aAppInfo
is successfully launched.TheGio.AppLaunchContext::launch-failed
signal is emitted when aAppInfo
launch fails.TheGio.AppLaunchContext::launch-started
signal is emitted when aAppInfo
is about to be launched.Methods inherited from class org.gnome.gobject.GObject.Builder
onNotify
Methods inherited from class io.github.jwharm.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilder
object.
-
-
Method Details
-
build
Finish building theAppLaunchContext
object. This will callGObject.withProperties(org.gnome.glib.Type, java.lang.String[], org.gnome.gobject.Value[])
to create a new GObject instance, which is then cast toAppLaunchContext
.- Overrides:
build
in classGObject.Builder<B extends AppLaunchContext.Builder<B>>
- Returns:
- a new instance of
AppLaunchContext
with the properties that were set in the Builder object.
-
onLaunchFailed
TheGio.AppLaunchContext::launch-failed
signal is emitted when aAppInfo
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 - See Also:
-
onLaunchStarted
TheGio.AppLaunchContext::launch-started
signal is emitted when aAppInfo
is about to be launched. If non-null theplatformData
is an GVariant dictionary mapping strings to variants (iea{sv}
), which contains additional, platform-specific data about this launch. On UNIX, at least thestartup-notification-id
keys will be present.The value of the
startup-notification-id
key (types
) is a startup notification ID corresponding to the format from the [startup-notification specification](https://specifications.freedesktop.org/startup-notification-spec/startup-notification-0.1.txt). It allows tracking the progress of the launchee through startup.It is guaranteed that this signal is followed by either a
Gio.AppLaunchContext::launched
orGio.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 - See Also:
-
onLaunched
TheGio.AppLaunchContext::launched
signal is emitted when aAppInfo
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 (iea{sv}
), which contains additional, platform-specific data about this launch. On UNIX, at least thepid
andstartup-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). Thepid
may not be set at all in subsequent releases.On Windows,
pid
is guaranteed to be valid only for the duration of theGio.AppLaunchContext::launched
signal emission; after the signal is emitted, GLib will callGLib.spawnClosePid(org.gnome.glib.Pid)
. If you need to keep theGLib.Pid
after the signal has been emitted, then you can duplicatepid
usingDuplicateHandle()
.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-