Class SystemMenuBar
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
- Implementation Note
- Currently, this avoids binding to the MenuBar's property directly, as that would require a bidirectional binding.
- 
Property SummaryPropertiesTypePropertyDescriptionstatic BooleanPropertyProperty 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 SummaryNested ClassesModifier and TypeClassDescriptionstatic enumEnum specifying when and where the system menubar should be used.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic booleanGet 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 voidmanageChildMenuBar(MenuBar menuBar) Request that a menubar is managed as a child menubar.static voidmanageMainMenuBar(MenuBar menuBar) Request that a menubar is managed as a main menubar.static BooleanPropertyProperty requesting that the system menubar should never be used for managed menubars.static voidsetOverrideSystemMenuBar(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().static booleanReturns true if the platform supports (or maybe supports) the system menubar.Property used to specify whether the system menubar should be used for the main QuPath stage.static voidunmanageMenuBar(MenuBar menuBar) Do not manage the system menubar status for the given menubar.
- 
Property Details- 
systemMenubarProperty 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:
 
- 
overrideSystemMenuBarProperty 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- 
SystemMenuBarpublic SystemMenuBar()
 
- 
- 
Method Details- 
supportsSystemMenubarpublic static boolean supportsSystemMenubar()Returns true if the platform supports (or maybe supports) the system menubar.This provides a way to avoid providing the option to the user if it is known to be irrelevant, although we can't query the system menubar support directly - so this is a best guess. It also allows the option to be disabled by setting a system property qupath.enableSystemMenuBar=false.- Returns:
 
- 
systemMenubarPropertyProperty 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
 
- 
manageMainMenuBarRequest 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-
 
- 
manageChildMenuBarRequest 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-
 
- 
unmanageMenuBarDo not manage the system menubar status for the given menubar.- Parameters:
- menuBar-
 
- 
overrideSystemMenuBarPropertyProperty 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:
 
- 
getOverrideSystemMenuBarpublic 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:
 
- 
setOverrideSystemMenuBarpublic 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:
 
 
-