nigelht / macwidgets

Collection of Mac style widgets written in Java (by Ken Orr)
http://nigelht.github.io/macwidgets
3 stars 0 forks source link

SourceListClickListener should provide access to the raw MouseEvent. #158

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. View the SourceListClickListener API.

What is the expected output? What do you see instead?

I'd expect to see:
    void sourceListItemClicked(SourceListItem item, MouseEvent event);
    void sourceListCategoryClicked(SourceListCategory category, 
MouseEvent event)

What version of the product are you using? On what operating system?

HEAD (so I guess 0.9.6-SNAPSHOT), on OS X Snow Leopard. But this issue 
related to running apps on multiple platforms, which require different 
behaviour from each other.

Please provide any additional information below.

The raw mouse event is needed to determine when a popup menu should 
be shown, via the JPopupMenu.isPopupTrigger(MouseEvent) method. While 
I generally like the approach of providing a simpler API (the button & 
clickCount parameters in this case) in this case access to the raw event is 
needed in order to interact with the installed look & feel.

Original issue reported on code.google.com by ian.phil...@gmail.com on 11 Mar 2010 at 10:29

GoogleCodeExporter commented 9 years ago
Patch to use suggested API. An alternative would be to keep the current button 
& 
clickCount params and just add the event as an additional param. Unfortunately 
either 
option will break compatibility.

Original comment by ian.phil...@gmail.com on 11 Mar 2010 at 3:59

Attachments:

GoogleCodeExporter commented 9 years ago
OK, I feel silly now. After creating that patch and looking through the code a 
bit more I 
spotted how you've set this up (i.e. the SourceListContextMenuProvider 
interface).

You can close this issue.

Original comment by ian.phil...@gmail.com on 11 Mar 2010 at 4:09