Interface SystemMenuBar


public interface SystemMenuBar
The menu bar a system keeps outside the windows, one for the application, as a backend offers it to the toolkit. A backend on a system with none offers none: BackendPeer.systemMenuBar() answers null.

Each window contributes at most one bar. Which one the system shows is the backend's to decide from the window the user is working in; a window with none shows the application's menu and little else.

  • Method Details

    • attach

      boolean attach(NativeWindow window, MenuBarHost host)
      A window's bar asks for the system's.
      Returns:
      whether it was taken; false when the window already contributes another, which then stays in the window
    • detach

      void detach(NativeWindow window, MenuBarHost host)
      The bar left its window, or asked to be drawn in it. Unknown pairs are ignored.
    • holds

      boolean holds(NativeWindow window, MenuBarHost host)
      Returns:
      whether the system's bar holds this bar now. A bar that was taken is not held while its window is fullscreen in a way that covers the system's bar; MenuBarHost.heldChanged() says when the answer changes
    • changed

      void changed(MenuBarHost host)
      What the bar shows without being opened, its titles, may have changed.
    • runs

      boolean runs(String key, int modifiers)
      Whether the system runs an accelerator of a bar it holds. What it does not run is the toolkit's to run, the focused widget first.
      Parameters:
      key - the key's name with no modifier, as MenuRow.shortcutKey()
      modifiers - the Keys modifier bits