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.
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) { provider.select (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.
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.