<Swing Dev> [8] Review request for 4199622 RFE: JComboBox shouldn't sending ActionEvents for keyboard navigation
Vladislav Karnaukhov
Vladislav.Karnaukhov at oracle.com
Wed Jan 16 15:27:26 UTC 2013
Hello Sergey,
please see inline.
On 1/16/2013 07:20 PM, Sergey Bylokhov wrote:
> Hi, Vladislav.
> From the bug description:
> "When the user pops up a JComboBox (hits the spacebar for Metal L&F),
> and then tries to navigate with the arrow keys, any ActionListeners
> for that CB will have their actionPerformed methods called, and there
> isn't any information in the given ActionEvent to show that this was
> only a navigation action rather than a selection (spacebar) action."
> I do not see a problem here, because "navigation action" is an action
> and so ActionEvent is posted in this case. Does somebody complains
> about it?
Yes, it was escalated. Customer would like to have an enhancement to
JComboBox behavior (just an enhancement; they fully realize that default
JComboBox behavior mustn't change, because backward compatibility impact
would be tremendous).
> I am not sure but what about the case when the user change selection
> view mouseover? Is it possible?
The customer would like to see an enhancement when keyboard navigation
duplicates that of with mouse. They have some resource-consuming task
placed on actionPerformed, and if an end-user accidentally uses keyboard
for navigation, it greatly affects system load.
>
>
> 16.01.2013 18:04, Vladislav Karnaukhov wrote:
>> Hello Alex,
>>
>> thanks for the review.
>>
>> Please find a new version here:
>> http://cr.openjdk.java.net/~vkarnauk/4199622/webrev.01/
>>
>> Regards,
>> - Vlad
>>
>> On 1/16/2013 05:45 PM, Alexander Potochkin wrote:
>>> Hello Vlad
>>>
>>> The fix overall looks good,
>>> however there are some comments:
>>>
>>> it is better to use UIManager.getBoolean() in this case,
>>> it will enable you to skip the null check
>>>
>>> in the test you should use SunToolkit.realSync() instead of sleep()
>>> (please also call realSync in the very beginning of the test method
>>> to wait for focus to come)
>>> and define boolean noAction as volatile since you are accessing it
>>> on two threads
>>>
>>> Thanks
>>> alexp
>>>
>>> On 1/16/2013 4:58 PM, Vladislav Karnaukhov wrote:
>>>> Hello,
>>>>
>>>> could you please review the fix:
>>>> bug: http://bugs.sun.com/view_bug.do?bug_id=4199622
>>>> webrev: http://cr.openjdk.java.net/~vkarnauk/4199622/webrev.00/
>>>>
>>>> The fix uses new property to disable ActionEvent generation in
>>>> JComboBox' drop-down window when an user navigates with keyboard.
>>>> The fix works only when property is explicitly set by a developer;
>>>> otherwise default JComboBox' behavior doesn't change.
>>>>
>>>> Regards,
>>>> - Vlad
>>
>>
>
>
More information about the swing-dev
mailing list