RFR: 8155030: The Menu Mnemonics are always displayed for GTK LAF [v6]
Abhishek Kumar
abhiscxk at openjdk.org
Tue Jun 18 13:06:14 UTC 2024
On Tue, 18 Jun 2024 12:51:34 GMT, Abhishek Kumar <abhiscxk at openjdk.org> wrote:
>> since this method should be recursing through all of a component's subcomponents, shouldn't there not even be an if check here?
>
>> JComponent extends Container .. so this will traverse everything in the Swing UI.
> Is there any pattern elsewhere in Swing you can use to short-circuit this ?
>
> I am unable to recall any pattern as such.
> since this method should be recursing through all of a component's subcomponents, shouldn't there not even be an if check here?
If I understand correctly, you mean to say we don't require an if condition here. But the if condition is to identify the components in container which needs to be repainted for mnemonic related changes.
So if a component is an instance of container, all the sub-components are fetched and if any of sub-component is either AbstractButton or JLabel instance, it will be repainted based on mnemonic condition otherwise will be ignored (if not a container itself).
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18992#discussion_r1644431689
More information about the client-libs-dev
mailing list