Class Window.Builder<B extends Window.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
Accessible.Builder<B>, BuilderInterface
Direct Known Subclasses:
AboutDialog.Builder, ApplicationWindow.Builder, Assistant.Builder, Dialog.Builder, MessageDialog.Builder, ShortcutsWindow.Builder, Window.Builder
Enclosing class:
Window

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

      public B setApplication(Application application)

      The GtkApplication associated with the window.

      The application will be kept alive for at least as long as it has any windows associated with it (see g_application_hold() for a way to keep it alive without windows).

      Normally, the connection between the application and the window will remain until the window is destroyed, but you can explicitly remove it by setting the this property to NULL.

      Parameters:
      application - the value for the application property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setChild

      public B setChild(Widget child)
      The child widget.
      Parameters:
      child - the value for the child property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setDecorated

      public B setDecorated(boolean decorated)
      Whether the window should have a frame (also known as decorations).
      Parameters:
      decorated - the value for the decorated property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setDefaultHeight

      public B setDefaultHeight(int defaultHeight)
      The default height of the window.
      Parameters:
      defaultHeight - the value for the default-height property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setDefaultWidget

      public B setDefaultWidget(Widget defaultWidget)
      The default widget.
      Parameters:
      defaultWidget - the value for the default-widget property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setDefaultWidth

      public B setDefaultWidth(int defaultWidth)
      The default width of the window.
      Parameters:
      defaultWidth - the value for the default-width property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setDeletable

      public B setDeletable(boolean deletable)
      Whether the window frame should have a close button.
      Parameters:
      deletable - the value for the deletable property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setDestroyWithParent

      public B setDestroyWithParent(boolean destroyWithParent)
      If this window should be destroyed when the parent is destroyed.
      Parameters:
      destroyWithParent - the value for the destroy-with-parent property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setDisplay

      public B setDisplay(Display display)
      The display that will display this window.
      Parameters:
      display - the value for the display property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setFocusVisible

      public B setFocusVisible(boolean focusVisible)

      Whether 'focus rectangles' are currently visible in this window.

      This property is maintained by GTK based on user input and should not be set by applications.

      Parameters:
      focusVisible - the value for the focus-visible property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setFocusWidget

      public B setFocusWidget(Widget focusWidget)
      The focus widget.
      Parameters:
      focusWidget - the value for the focus-widget property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setFullscreened

      public B setFullscreened(boolean fullscreened)

      Whether the window is fullscreen.

      Setting this property is the equivalent of calling Window.fullscreen() or Window.unfullscreen(); either operation is asynchronous, which means you will need to connect to the ::notify signal in order to know whether the operation was successful.

      Parameters:
      fullscreened - the value for the fullscreened property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGravity

      public B setGravity(WindowGravity gravity)

      The gravity to use when resizing the window programmatically.

      Gravity describes which point of the window we want to keep fixed (meaning that the window will grow in the opposite direction). For example, a gravity of GTK_WINDOW_GRAVITY_TOP_RIGHT means that we want the to fix top right corner of the window.

      Parameters:
      gravity - the value for the gravity property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.20
    • setHandleMenubarAccel

      public B setHandleMenubarAccel(boolean handleMenubarAccel)
      Whether the window frame should handle F10 for activating menubars.
      Parameters:
      handleMenubarAccel - the value for the handle-menubar-accel property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.2
    • setHideOnClose

      public B setHideOnClose(boolean hideOnClose)
      If this window should be hidden instead of destroyed when the user clicks the close button.
      Parameters:
      hideOnClose - the value for the hide-on-close property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setIconName

      public B setIconName(String iconName)

      Specifies the name of the themed icon to use as the window icon.

      See IconTheme for more details.

      Parameters:
      iconName - the value for the icon-name property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setMaximized

      public B setMaximized(boolean maximized)

      Whether the window is maximized.

      Setting this property is the equivalent of calling Window.maximize() or Window.unmaximize(); either operation is asynchronous, which means you will need to connect to the ::notify signal in order to know whether the operation was successful.

      Parameters:
      maximized - the value for the maximized property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setMnemonicsVisible

      public B setMnemonicsVisible(boolean mnemonicsVisible)

      Whether mnemonics are currently visible in this window.

      This property is maintained by GTK based on user input, and should not be set by applications.

      Parameters:
      mnemonicsVisible - the value for the mnemonics-visible property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setModal

      public B setModal(boolean modal)
      If true, the window is modal.
      Parameters:
      modal - the value for the modal property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setResizable

      public B setResizable(boolean resizable)
      If true, users can resize the window.
      Parameters:
      resizable - the value for the resizable property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setStartupId

      public B setStartupId(String startupId)
      A write-only property for setting window's startup notification identifier.
      Parameters:
      startupId - the value for the startup-id property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setTitle

      public B setTitle(String title)
      The title of the window.
      Parameters:
      title - the value for the title property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setTitlebar

      public B setTitlebar(Widget titlebar)
      The titlebar widget.
      Parameters:
      titlebar - the value for the titlebar property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.6
    • setTransientFor

      public B setTransientFor(Window transientFor)
      The transient parent of the window.
      Parameters:
      transientFor - the value for the transient-for property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onActivateDefault

      public B onActivateDefault(Window.ActivateDefaultCallback handler)

      Emitted when the user activates the default widget.

      This is a keybinding signal.

      The keybindings for this signal are all forms of the Enter key.

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

      public B onActivateFocus(Window.ActivateFocusCallback handler)

      Emitted when the user activates the currently focused widget of window.

      This is a keybinding signal.

      The default binding for this signal is .

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

      public B onCloseRequest(Window.CloseRequestCallback handler)
      Emitted when the user clicks on the close button of the window.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onEnableDebugging

      public B onEnableDebugging(Window.EnableDebuggingCallback handler)

      Emitted when the user enables or disables interactive debugging.

      When toggle is true, interactive debugging is toggled on or off, when it is false, the debugger will be pointed at the widget under the pointer.

      This is a keybinding signal.

      The default bindings for this signal are Ctrl+Shift+I and Ctrl+Shift+D.

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

      @Deprecated public B onKeysChanged(Window.KeysChangedCallback handler)
      Deprecated.
      Use Shortcut and EventController to implement keyboard shortcuts
      Emitted when the set of accelerators or mnemonics that are associated with the window changes.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also: