JDK-8132120 : Provide public API for screen menu bar support on MacOS
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: os_x
  • CPU: x86
  • Submitted: 2015-07-17
  • Updated: 2020-09-08
  • Resolved: 2020-09-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdResolved
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Description
A DESCRIPTION OF THE REQUEST :
The screen menu bar is a standard feature of Mac OS. Even applications with unique UIs use the screen menu bar. In Java, this means that custom LAFs should use the screen menu bar when running on MacOS.

The existing support for the screen menu bar is baked into the Aqua LAF. Specifically, it is supported by AquaMenuBarUI, AquaMenuItemUI, and AquaRootPaneUI. The support for a default menu bar (displayed when there is no active application frame) in _AppMenuBarHandler is tightly coupled to AquaMenuBarUI.

These platform classes will become inaccessible in JDK9. Although it may be possible to reference them in UIDefaults, it will not be possible to subclass them. This limits the ability of a custom LAF to customize the root pane and menu UIs and also use the screen menu bar. The root pane UI is of particular concern because it supports the default button feature, which needs to interact with button UI classes.

Screen menu bar support should be provided in a public API for use by third party LAFs in JDK9 and beyond.

This RFE should be have labels "modularization" and "jdkinternals".


JUSTIFICATION :
The screen menu bar is an essential part of the MacOS UI. Custom LAFs need a public API in JDK9 to use the screen menu bar.




Comments
[~alans] I guess this bug was fixed as part of JDK-8166683, no? The "-Dapple.laf.useScreenMenuBar=true" should enable global menu for all L&Fs.
06-02-2020

On 1/22/2018 2:01 PM, Alan Snyder wrote: > It looks like you closed this bug report as a duplicate. I believe that the bug report was misunderstood. > > The intention is to support the development of a custom look and feel that enables use of the screen menu bar. > > The existing public APIs support the screen menu bar only if the built-in Aqua look and feel is used. Starting with JDK 9, the private APIs used by Aqua look and feel to enable the screen menu bar are no longer accessible to custom look and feels without command line parameter usage. See, for example, MenuBarAccessor, used in com.apple.laf.ScreenMenuBar, and MenuComponentAccessor, used in com.apple.laf.ScreenMenu and ScreenMenuItemCheckbox. > > If you disagree, please tell me what public API could be used by a custom look and feel to enable use of the screen menu bar. > > Alan >
23-01-2018