<Swing Dev> [10] RFR: JDK-8043315: Nimbus: Setting Nimbus.Overrides property affects custom keymap installation

Sergey Bylokhov sergey.bylokhov at oracle.com
Thu Jun 1 18:37:54 UTC 2017


Hi, Prasanta.
Can you please clarify the fix a little bit. 
You have a static variable, which is set to "false" when the listener for "keymap" is triggered, and it seems that you never set it back to "true"? Is it intentional behavior?
Note that if there are a few objects of "SynthEditorPaneUI" then they will share this static field. Also it seems that the test can be automated, because currently it is requires from the user to press only one button("space").

----- prasanta.sadhukhan at oracle.com wrote:

> Hi All,
> 
> Please review a bug fix for Nimbus L&F where if app sets custom keymap
> 
> and then sets Nimbus.Overrides property,
> then the custom keymap is not honoured.
> For example, if testapp sets a new action for "space" key press and
> sets 
> sets Nimbus.Overrides property,
>   it will not be honoured and default action ie. inserting a "space" 
> character will be done.
> 
> Issue was NimbusLookAndFeel#shouldUpdateStyleOnEvent() returns true
> for 
> Nimbus.Override property which causes SynthEditorPaneUI#updateStyle()
> to 
> be called which
> uninstall set keyboard actions and sets up default keyboard action.
> 
> Proposed fix is to check if a keymap is already set (a propertyChange
> 
> event will be fired for when app calls setKeyMap()) then do not reset
> to 
> default keymap.
> 
> Bug: https://bugs.openjdk.java.net/browse/JDK-8043315
> webrev: http://cr.openjdk.java.net/~psadhukhan/8043315/webrev.00/
> 
> Regards
> Prasanta



More information about the swing-dev mailing list