Package org.gnome.gtk
Class Application.Builder<B extends Application.Builder<B>>
java.lang.Object
io.github.jwharm.javagi.gobject.Builder<B>
org.gnome.gobject.GObject.Builder<B>
org.gnome.gio.Application.Builder<B>
org.gnome.gtk.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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theApplication
object.onQueryEnd
(Application.QueryEndCallback handler) Emitted when the session manager is about to end the session.Emitted when a window is added to an application.Emitted when a window is removed from an application.setMenubar
(MenuModel menubar) The menu model to be used for the application's menu bar.setRegisterSession
(boolean registerSession) Set this property to true to register with the session manager.Methods inherited from class org.gnome.gio.Application.Builder
onActivate, onCommandLine, onHandleLocalOptions, onNameLost, onOpen, onShutdown, onStartup, setActionGroup, setApplicationId, setFlags, setFlags, setInactivityTimeout, setResourceBasePath, setVersion
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 theApplication
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 toApplication
.- Overrides:
build
in classApplication.Builder<B extends Application.Builder<B>>
- Returns:
- a new instance of
Application
with the properties that were set in the Builder object.
-
setMenubar
-
setRegisterSession
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 theregister-session
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
onQueryEnd
Emitted when the session manager is about to end the session.This signal is only emitted if
Gtk.Application:register-session
is true. Applications can connect to this signal and callApplication.inhibit(org.gnome.gtk.Window, java.util.Set<org.gnome.gtk.ApplicationInhibitFlags>, java.lang.String)
withGtk.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
Emitted when a window is added to an application.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onWindowRemoved
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(org.gnome.gtk.Window)
.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-