Ending the need for apple.laf.useScreenMenuBar
Mike Swingler
swingler at apple.com
Mon Dec 5 10:29:52 PST 2011
On Dec 5, 2011, at 6:49 AM, Scott Palmer wrote:
> On Mon, Dec 5, 2011 at 6:04 AM, Artem Ananiev <artem.ananiev at oracle.com>wrote:
>
>> On 12/3/2011 4:23 AM, Scott Kovatch wrote:
>>
>>>
>>> On Dec 2, 2011, at 2:57 PM, Mike Swingler wrote:
>>>
>>> On Dec 2, 2011, at 2:28 PM, Mario Torre wrote:
>>>>
>>>> Il giorno 02/dic/2011, alle ore 23:25, Scott Kovatch ha scritto:
>>>>>
>>>>>> Folks,
>>>>>>
>>>>>> This may be a better question for Artem and the AWT/Swing team,
>>>>>> but it affects the Mac so I'm starting here.
>>>>>>
>>>>>> Now that it's 2011, can we please get rid of
>>>>>> apple.laf.useScreenMenuBar and just allow menu bars in the Aqua
>>>>>> L&F to be enabled by default? I believe JavaFx doesn't force
>>>>>> Mac menu bars into the window (but if it does, I will make my
>>>>>> displeasure known to Richard Bair on Monday.)
>>>>>>
>>>>>> I ask, because today I was looking at the changes to Web Start
>>>>>> and the plugin to allow this property as a 'safe' one that can
>>>>>> be defined in a JNLP file, and I decided now is the time to get
>>>>>> rid of it once and for all. It's not that I object to adding it
>>>>>> to Web Start; I object to the necessity of having to define it
>>>>>> in the first place.
>>>>>>
>>>>>> -- Scott
>>>>>>
>>>>>
>>>>> I think you're right, I'm in favor of this change too.
>>>>>
>>>>> Cheers, Mario
>>>>>
>>>>
>>>> I'd be the first one to advocate for this, but isn't the key
>>>> problem that he semantics of the Screen Menu bar violate certain
>>>> rules in the JCK? Implementing arbitrary Java drawing into
>>>> NSView-based menu items might even be possible post-Leopard, but is
>>>> that really something the AWT team would want to implement?
>>>>
>>>
>>
> JMenuItem is a JComponent... as such Java developers are rightfully going
> to assume that the painting pipeline for JComponents applies.
> Wanting (or not) to implement it isn't really an argument :-)
> There are lots of UI guidelines that are platform specific and a general UI
> framework may support things that aren't typical or desirable on a specific
> platform. E.g. I believe on OS X icons on menu items are generally
> discouraged, even though they are possible such as is seen in Safari's
> Bookmarks menu.
>
> I'm not saying that I'm against this by the way. If the Aqua L&F
> automatically uses the screen menu bar that's fine with me. So long as
> code that does unusual things with JMenuItems doesn't crash. It wouldn't
> be the first time a particular look and feel was slightly incompatible with
> the cross-platform look and feel. Perhaps though, just in case, the Java
> Preference app could be used to toggle the default menu behaviour for the
> Aqua L&F? At least that would give people a workaround for things that
> break.
The current situation is the ScreenMenuBar is not default, but virtually every app that has an explicit deployment for the Mac sets this property. Apps that don't even bother to test or deploy for Mac OS X get cross platform behavior and a cross platform user experience.
I don't see the harm of letting developers continue opt-up into a less compatible, but more Mac-like experience. This is just like using Meta instead of Ctrl based keyboard accelerators when on a Mac.
Regards,
Mike Swingler
Apple Inc.
More information about the macosx-port-dev
mailing list