RFR: 8233477 [Win LAF]The tooltip doesn't display correctly in Win LAF [v4]
Phil Race
prr at openjdk.java.net
Fri May 13 22:43:50 UTC 2022
On Thu, 12 May 2022 07:25:22 GMT, Tejesh R <duke at openjdk.java.net> wrote:
>> In Button ToolTip, Mnemonic key string was shown only in Metal Look and Feel, since the feature is implemented in it. In other L&F especially Windows L&F the feature is not available. In order to make it available for other L&F's, the getAcceleratedString method and calculateAcceleratedStringSpace method is Implemented in ToolTipUI class. These methods are used in BasicToolTipUI class which uses the feature and shows/paints the ToolTip String along with the set Mnemonic key. In similar way other L&F which doesn't Inherit BasicToolTipUI can make use of the feature available in ToolTipUI.
>
> Tejesh R has updated the pull request incrementally with one additional commit since the last revision:
>
> Removed the test from open, updated in closed
I find it very strange that https://bugs.openjdk.java.net/browse/JDK-5047379 was fixed in 2005
and the bug report there says
> This fix only affects tooltips. It can be tested on any platform as it is platform independent.
And by platforms it really means for the default L&F which is Metal on Windows ..
So I think the reason it took 14 years for anyone to notice it wasn't behaving the same on Windows L&F
is that it wasn't designed for the Windows L&F
Which begs two questions,
1) why was someone testing it on a non-default L&F .. "we run all tests on all L&Fs" isn't really something you should do without careful thought
2) Does this mean it is actually a Metal "special" behaviour .. do Windows NATIVE apps display mnemonics on tool tips ?
And since per the eval of 5047379
> the only time we'll show an accelerator key in the tooltip is if someone has added a WHEN_IN_FOCUSED_WINDOW binding to the component's InputMap.
Perhaps no one should be caring about this ?
Maybe we just update the test to hardwire Metal and move on ? That'll mean the test will always pass no matter what L&F SQE specify as the default ..
I find it very strange that https://bugs.openjdk.java.net/browse/JDK-5047379 was fixed in 2005
and the bug report there says
> This fix only affects tooltips. It can be tested on any platform as it is platform independent.
And by platforms it really means for the default L&F which is Metal on Windows ..
So I think the reason it took 14 years for anyone to notice it wasn't behaving the same on Windows L&F
is that it wasn't designed for the Windows L&F
Which begs two questions,
1) why was someone testing it on a non-default L&F .. "we run all tests on all L&Fs" isn't really something you should do without careful thought
2) Does this mean it is actually a Metal "special" behaviour .. do Windows NATIVE apps display mnemonics on tool tips ?
And since per the eval of 5047379
> the only time we'll show an accelerator key in the tooltip is if someone has added a WHEN_IN_FOCUSED_WINDOW binding to the component's InputMap.
Perhaps no one should be caring about this ?
Maybe we just update the test to hardwire Metal and move on ? That'll mean the test will always pass no matter what L&F SQE specify as the default ..
-------------
PR: https://git.openjdk.java.net/jdk/pull/8496
More information about the client-libs-dev
mailing list