This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 126529 - The needs to have an option to make the select action handle the right click
Summary: The needs to have an option to make the select action handle the right click
Alias: None
Product: platform
Classification: Unclassified
Component: Graph (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Kris Richards
Depends on:
Blocks: 105060 126780
  Show dependency tree
Reported: 2008-02-01 21:52 UTC by Trey Spiva
Modified: 2008-04-10 21:31 UTC (History)
0 users

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description Trey Spiva 2008-02-01 21:52:31 UTC
Currently the SelectAction will only handle the left and middle mouse buttons (MouseEvent.Button1 && MouseEvent.Button2).  A lot of applications the user 
would like to be able to right click on a widget and select the widget as well as bring up the context menu.  

So the SelectAction should respond to the MouseEvent.BUTTON2 event, and select the associated widget, and then allow other actions to handle the event 
as well.  

Proposed changes to make this behavior happen.  The proposed changes would be backward compatible with current implementation.

1) A new constructor should take a SelectProvider as well as a boolean to determine if the right mouse button should be handled.
2) the mousePressed method should look like this:
   if (event.getButton ()  ==  MouseEvent.BUTTON1  ||  event.getButton () == MouseEvent.BUTTON2) {
    ... // Same as currently implemented
   else if(event.getButton() == MouseEvent.BUTTON3)
   { (widget, localLocation, invertSelection);
      return State.CHAIN_ONLY;
3) The ActionFactory should have a new createSelectAction method that takes a SelectProvider and boolean.  The boolean would specify if the right button 
should be handled.
Comment 1 Kris Richards 2008-04-10 21:31:16 UTC
Added fix to issue 126529 and 132354. Note that the changes to the ActionFactionwill have to pass API review. A new createSelectAction was added that takes 
a boolean argument as well as the provider. The boolean indicates whether or not the provider should listen to the events sent by the popup trigger (right-
click). A new constructor was added to the SelectAction that takes this boolean as an argument. If true, the SelectAction sets the pressed on widget as 
selected and then passes the event on to the next listener.