This is an automated email from the ASF dual-hosted git repository.
sdedic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new d97e554 NETBEANS-1698: Listview only performs action on
left-doubleclick. Consumed doubleclicks do nothing (#1023)
d97e554 is described below
commit d97e554b27aa777502ece1bcd96de1e3b6767f0c
Author: Svatopluk Dedic <[email protected]>
AuthorDate: Tue Nov 20 10:24:14 2018 +0100
NETBEANS-1698: Listview only performs action on left-doubleclick. Consumed
doubleclicks do nothing (#1023)
---
platform/openide.awt/src/org/openide/awt/MouseUtils.java | 4 ++++
platform/openide.explorer/src/org/openide/explorer/view/ListView.java | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/platform/openide.awt/src/org/openide/awt/MouseUtils.java
b/platform/openide.awt/src/org/openide/awt/MouseUtils.java
index d349b7f..0d61232 100644
--- a/platform/openide.awt/src/org/openide/awt/MouseUtils.java
+++ b/platform/openide.awt/src/org/openide/awt/MouseUtils.java
@@ -76,6 +76,10 @@ public class MouseUtils extends Object {
if ((e.getID() != MouseEvent.MOUSE_CLICKED) || (e.getClickCount() ==
0)) {
return false;
}
+ // do not report already consumed events
+ if (e.isConsumed()) {
+ return false;
+ }
return ((e.getClickCount() % 2) == 0) || isDoubleClickImpl(e);
}
diff --git
a/platform/openide.explorer/src/org/openide/explorer/view/ListView.java
b/platform/openide.explorer/src/org/openide/explorer/view/ListView.java
index 59bcbaa..5c1819d 100644
--- a/platform/openide.explorer/src/org/openide/explorer/view/ListView.java
+++ b/platform/openide.explorer/src/org/openide/explorer/view/ListView.java
@@ -1301,7 +1301,7 @@ public class ListView extends JScrollPane implements
Externalizable {
@Override
public void mouseClicked(MouseEvent e) {
- if (MouseUtils.isDoubleClick(e)) {
+ if (SwingUtilities.isLeftMouseButton(e) &&
MouseUtils.isDoubleClick(e)) {
int index = list.locationToIndex(e.getPoint());
performObjectAt(index, e.getModifiers());
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists