Class PreferencesWindow

All Implemented Interfaces:
PointerInterface

public class PreferencesWindow extends Window
A window to present an application's preferences.

<picture>
<source srcset="preferences-window-dark.png" media="(prefers-color-scheme: dark)">
<img src="preferences-window.png" alt="preferences-window">
</picture>

The `AdwPreferencesWindow` widget presents an application's preferences
gathered into pages and groups. The preferences are searchable by the user.

## CSS nodes

`AdwPreferencesWindow` has a main CSS node with the name `window` and the
style class `.preferences`.

https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.PreferencesWindow.html

  • Constructor Details

    • PreferencesWindow

      public PreferencesWindow(PointerContainer pointer)
    • PreferencesWindow

      public PreferencesWindow()
      Creates a new `AdwPreferencesWindow`.
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • add

      public void add(@Nonnull PreferencesPage page)
      Adds a preferences page to @self.
      Parameters:
      page - the page to add
    • addToast

      public void addToast(@Nonnull Toast toast)
      Displays @toast.

      See [method@ToastOverlay.add_toast].
      Parameters:
      toast - a toast
    • closeSubpage

      public void closeSubpage()
      Closes the current subpage.

      If there is no presented subpage, this does nothing.
    • getCanNavigateBack

      public boolean getCanNavigateBack()
      Gets whether gestures and shortcuts for closing subpages are enabled.
      Returns:
      whether gestures and shortcuts are enabled.
    • getSearchEnabled

      public boolean getSearchEnabled()
      Gets whether search is enabled for @self.
      Returns:
      whether search is enabled for @self.
    • getVisiblePage

      public PreferencesPage getVisiblePage()
      Gets the currently visible page of @self.
      Returns:
      the visible page
    • getVisiblePageName

      public Str getVisiblePageName()
      Gets the name of currently visible page of @self.
      Returns:
      the name of the visible page
    • presentSubpage

      public void presentSubpage(@Nonnull Widget subpage)
      Sets @subpage as the window's subpage and opens it.

      The transition can be cancelled by the user, in which case visible child will
      change back to the previously visible child.
      Parameters:
      subpage - the subpage
    • remove

      public void remove(@Nonnull PreferencesPage page)
      Removes a page from @self.
      Parameters:
      page - the page to remove
    • setCanNavigateBack

      public void setCanNavigateBack(boolean can_navigate_back)
      Sets whether gestures and shortcuts for closing subpages are enabled.

      The supported gestures are:

      - One-finger swipe on touchscreens
      - Horizontal scrolling on touchpads (usually two-finger swipe)
      - Back mouse button

      The keyboard back key is also supported, as well as the
      <kbd>Alt</kbd>+<kbd>←</kbd> shortcut.

      For right-to-left locales, gestures and shortcuts are reversed.
      Parameters:
      can_navigate_back - the new value
    • setSearchEnabled

      public void setSearchEnabled(boolean search_enabled)
      Sets whether search is enabled for @self.
      Parameters:
      search_enabled - whether search is enabled
    • setVisiblePage

      public void setVisiblePage(@Nonnull PreferencesPage page)
      Makes @page the visible page of @self.
      Parameters:
      page - a page of @self
    • setVisiblePageName

      public void setVisiblePageName(@Nonnull Str name)
      Makes the page with the given name visible.

      See [property@ViewStack:visible-child].
      Parameters:
      name - the name of the page to make visible
    • setVisiblePageName

      public void setVisiblePageName(String name)
      Makes the page with the given name visible.

      See [property@ViewStack:visible-child].
      Parameters:
      name - the name of the page to make visible
    • asAccessible

      public Accessible asAccessible()
      Implements interface Accessible. Call this to get access to interface functions.
      Overrides:
      asAccessible in class Window
      Returns:
      Accessible
    • asBuildable

      public Buildable asBuildable()
      Implements interface Buildable. Call this to get access to interface functions.
      Overrides:
      asBuildable in class Window
      Returns:
      Buildable
    • asConstraintTarget

      public ConstraintTarget asConstraintTarget()
      Implements interface ConstraintTarget. Call this to get access to interface functions.
      Overrides:
      asConstraintTarget in class Window
      Returns:
      ConstraintTarget
    • asNative

      public Native asNative()
      Implements interface Native. Call this to get access to interface functions.
      Overrides:
      asNative in class Window
      Returns:
      Native
    • asRoot

      public Root asRoot()
      Implements interface Root. Call this to get access to interface functions.
      Overrides:
      asRoot in class Window
      Returns:
      Root
    • asShortcutManager

      public ShortcutManager asShortcutManager()
      Implements interface ShortcutManager. Call this to get access to interface functions.
      Overrides:
      asShortcutManager in class Window
      Returns:
      ShortcutManager
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()