<Swing Dev> [9] Review request for 8033069: mouse wheel scroll closes combobox popup

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Tue May 12 18:38:37 UTC 2015


Hi, Alexey.
Thanks for clarification, the fix looks good.

On 07.05.15 15:31, Alexey Ivanov wrote:
> Hi Sergey,
>
> The changes in BasicPopupMenuUI are similar to handling mouse events 
> for JMenu. The popup stays open if user rotates wheel over combo box 
> that opened the popup but the popup will be canceled if wheel is 
> rotated over another combo box or any other component.
>
> The client property "doNotCancelPopup" is set for each combo box 
> because MOUSE_PRESS logic is in BasicComboPopup.Handler.mousePressed. 
> If you click another combo box, it will open its own popup which 
> automatically hides the popup that was visible.
>
> In case of MOUSE_WHEEL, combo box over which mouse wheel is rotated 
> should close the popup of another combo box that opened the popup; and 
> it should do nothing if its own popup is open. Moving this logic into 
> JComboBox MouseWheelListener seems too complicated.
>
>
> As for user-installed MouseWheelListener on JComboBox, of course 
> mouseWheelMoved is called but MouseWheelEvent is already marked 
> consumed. It might have a negative effect on user code if they check 
> isConsumed() flag. If the event is not consumed, the popup will be closed.
>
> Regards,
> Alexey
>
> On 06.05.2015 22:28, Sergey Bylokhov wrote:
>> Hi, Alexey.
>> The changes in the BasicPopupMenuUI does not look clear, I am not 
>> sure but probably it will be better to implement it in the same way 
>> as for MOUSE_PRESSED(via UIManager property)? It will add an 
>> additional configuration possibility.
>> Can you also confirm that the case when the user install mouse wheel 
>> listener to the JComboBox still works.
>>
>> On 06.05.15 16:30, Alexey Ivanov wrote:
>>> Hello Swing team,
>>>
>>> Could you please review the fix:
>>>     bug: https://bugs.openjdk.java.net/browse/JDK-8033069
>>>     webrev: http://cr.openjdk.java.net/~aivanov/8033069/jdk9/webrev.00/
>>>
>>> Description:
>>> If you rotate mouse wheel when combo box popup is open, the popup 
>>> gets closed.
>>>
>>> The fix is to always consume MOUSE_WHEEL event.
>>>
>>> There are two regression tests for the cases where popup has 
>>> vertical scroll bar and does not have scroll bar.
>>>
>>> Thanks,
>>> Alexey
>>
>>
>> -- 
>> Best regards, Sergey.
>


-- 
Best regards, Sergey.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20150512/2f2cdf01/attachment.html>


More information about the swing-dev mailing list