Package qupath.lib.gui.prefs
Class SystemMenuBar
java.lang.Object
qupath.lib.gui.prefs.SystemMenuBar
Helper class for managing
MenuBar.useSystemMenuBarProperty()
values based upon a property value.
The original plan was to make it easier to control if all windows, the main window only, or no windows should use the system menubar.
Alas, that doesn't work well - at least on macOS. If a system menubar is set for the main window only, then its accelerators are still triggered even when another window with a non-system menubar is active.
For this reason, there is no option to use the system menubar for the main window only. This will be reinstated in the future, if a workaround can be found.
- Since:
- v0.5.0
-
Property Summary
TypePropertyDescriptionstatic BooleanProperty
Property requesting that the system menubar should never be used for managed menubars.Property used to specify whether the system menubar should be used for the main QuPath stage. -
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Enum specifying when and where the system menubar should be used. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Get the current value of the override property, which specifies whether the system menubar should not be used by any window - no matter what the value ofsystemMenubarProperty()
.static void
manageChildMenuBar
(MenuBar menuBar) Request that a menubar is managed as a child menubar.static void
manageMainMenuBar
(MenuBar menuBar) Request that a menubar is managed as a main menubar.static BooleanProperty
Property requesting that the system menubar should never be used for managed menubars.static void
setOverrideSystemMenuBar
(boolean doOverride) Set the current value of the override property, which optionally specifies whether the system menubar should not be used by any window - no matter what the value ofsystemMenubarProperty()
.Property used to specify whether the system menubar should be used for the main QuPath stage.static void
unmanageMenuBar
(MenuBar menuBar) Do not manage the system menubar status for the given menubar.
-
Property Details
-
systemMenubar
Property used to specify whether the system menubar should be used for the main QuPath stage. This should be bound bidirectionally to the corresponding property of any menubars created.- Since:
- v0.5.0
- See Also:
-
overrideSystemMenuBar
Property requesting that the system menubar should never be used for managed menubars. This is useful if another window requires access to the system menubar. In particular, it helps in a macOS application if a Java AWT window is being used (e.g. ImageJ), since the conflicting attempts to get the system menubar can cause confusing behavior.- See Also:
-
-
Constructor Details
-
SystemMenuBar
public SystemMenuBar()
-
-
Method Details
-
systemMenubarProperty
Property used to specify whether the system menubar should be used for the main QuPath stage. This should be bound bidirectionally to the corresponding property of any menubars created.- Returns:
- Since:
- v0.5.0
-
manageMainMenuBar
Request that a menubar is managed as a main menubar. This means it is treated as a system menubar if #systemMenubarProperty() is set to ALL_WINDOWS or MAIN_WINDOW.- Parameters:
menuBar
-
-
manageChildMenuBar
Request that a menubar is managed as a child menubar. This means it is treated as a system menubar if #systemMenubarProperty() is set to ALL_WINDOWS only.- Parameters:
menuBar
-
-
unmanageMenuBar
Do not manage the system menubar status for the given menubar.- Parameters:
menuBar
-
-
overrideSystemMenuBarProperty
Property requesting that the system menubar should never be used for managed menubars. This is useful if another window requires access to the system menubar. In particular, it helps in a macOS application if a Java AWT window is being used (e.g. ImageJ), since the conflicting attempts to get the system menubar can cause confusing behavior.- Returns:
- See Also:
-
getOverrideSystemMenuBar
public static boolean getOverrideSystemMenuBar()Get the current value of the override property, which specifies whether the system menubar should not be used by any window - no matter what the value ofsystemMenubarProperty()
.- Returns:
- See Also:
-
setOverrideSystemMenuBar
public static void setOverrideSystemMenuBar(boolean doOverride) Set the current value of the override property, which optionally specifies whether the system menubar should not be used by any window - no matter what the value ofsystemMenubarProperty()
.- Parameters:
doOverride
-- See Also:
-