Mouse Event Handling Problem [message #1384997] |
Tue, 03 June 2014 14:12 |
|
Hi,
We have some mouse event handling troubles and I would need some suggestions how to fix them. The problem is that the context menu of the table - that is shown as a result when the user right clicks - is not always showing up. Scenario that is not working:
- Select a cell by clicking the left mouse button
- Press and hold the right mouse button
- Move the mouse a little bit within the cell
- Release the right mouse button
= The action is not executed and nothing happens
The behaviour is also producible with the example application. Just change the code that attaches the debug menu (DebugMenuConfiguration) to use the registerSingleClickBinding API instead of the registerMouseDownBinding API to attach the menu. Open the application and select "Tutorial Examples" -> "Integration" -> "GroupBySummaryRowExample".
I debugged a little bit into the MouseModeEventHandler and the error happens when this handler gets a mouse-move event. When this happens the mode is switched back to 'normal' and the mouse-up event is not handled any more. Thus the context menu is not shown.
My suggested fix would be to get rid of the mode-switching during a mouse-move event. The switching happens anyhow when the mouse button is released again.
Thus it would look like:
MouseModeEventHandler:
@Override
public synchronized void mouseMove(MouseEvent event) {
if (mouseDown && dragMode != null) {
if (natTable.commitAndCloseActiveCellEditor()) {
dragMode.mouseDown(natTable, initialMouseDownEvent);
switchMode(new DragModeEventHandler(getModeSupport(), natTable, dragMode, this, initialMouseDownEvent));
}
}
}
Any comments or even better solutions for this problem?
Best Regard,
Michael
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Mouse Event Handling Problem [message #1387644 is a reply to message #1387261] |
Wed, 25 June 2014 11:28 |
|
Thanks for the update
For our current release (at the end of this week) we are using a workaround as we do not want to have a private forked version in our target platform.
For anybody interested: Instead of registering a single-click binding we do register a mouse listener on the widget and handle the event by our self.
|
|
|
Powered by
FUDForum. Page generated in 0.04743 seconds