mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-06 06:21:16 +07:00
hide inplace editor in debugger tree by mouse wheel events
This commit is contained in:
+8
-3
@@ -185,7 +185,7 @@ public abstract class TreeInplaceEditor implements AWTEventListener {
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
if (!isShown()) return;
|
||||
defaultToolkit.addAWTEventListener(TreeInplaceEditor.this, AWTEvent.MOUSE_EVENT_MASK);
|
||||
defaultToolkit.addAWTEventListener(TreeInplaceEditor.this, AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_WHEEL_EVENT_MASK);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -201,12 +201,17 @@ public abstract class TreeInplaceEditor implements AWTEventListener {
|
||||
return;
|
||||
}
|
||||
MouseEvent mouseEvent = (MouseEvent)event;
|
||||
if (mouseEvent.getClickCount() == 0) {
|
||||
if (mouseEvent.getClickCount() == 0 && !(event instanceof MouseWheelEvent)) {
|
||||
return;
|
||||
}
|
||||
|
||||
final int id = mouseEvent.getID();
|
||||
if ((id != MouseEvent.MOUSE_PRESSED && id != MouseEvent.MOUSE_RELEASED && id != MouseEvent.MOUSE_CLICKED)) {
|
||||
if (id == MouseEvent.MOUSE_WHEEL) {
|
||||
cancelEditing();
|
||||
return;
|
||||
}
|
||||
|
||||
if (id != MouseEvent.MOUSE_PRESSED && id != MouseEvent.MOUSE_RELEASED && id != MouseEvent.MOUSE_CLICKED) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user