summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VTree.java29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTree.java b/src/com/vaadin/terminal/gwt/client/ui/VTree.java
index eb8a2e63c5..ed705dbb9e 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VTree.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VTree.java
@@ -869,17 +869,24 @@ public class VTree extends FocusElementPanel implements Paintable,
final MouseEventDetails details = new MouseEventDetails(evt);
ScheduledCommand command = new ScheduledCommand() {
public void execute() {
- // non-immediate iff an immediate select event is going to
- // happen
- boolean imm = !immediate
- || !selectable
- || (!isNullSelectionAllowed && isSelected() && selectedIds
- .size() == 1);
- client
- .updateVariable(paintableId, "clickedKey", key,
- false);
- client.updateVariable(paintableId, "clickEvent", details
- .toString(), imm);
+ if (details.getButton() == 0) {
+ // non-immediate iff an immediate select event is going
+ // to
+ // happen and the left button was clicked
+ boolean imm = !immediate
+ || !selectable
+ || (!isNullSelectionAllowed && isSelected() && selectedIds
+ .size() == 1);
+ client.updateVariable(paintableId, "clickedKey", key,
+ false);
+ client.updateVariable(paintableId, "clickEvent",
+ details.toString(), imm);
+ } else {
+ client.updateVariable(paintableId, "clickedKey", key,
+ false);
+ client.updateVariable(paintableId, "clickEvent",
+ details.toString(), immediate);
+ }
}
};
if (treeHasFocus) {