diff options
author | John Alhroos <john.ahlroos@itmill.com> | 2010-04-15 13:27:05 +0000 |
---|---|---|
committer | John Alhroos <john.ahlroos@itmill.com> | 2010-04-15 13:27:05 +0000 |
commit | d0218aa4d44a20a3af7e13fd6680763a1baae21a (patch) | |
tree | c10da2f4ccf0fd4d56d6ef4832c483ae5f927e29 | |
parent | ec6b4c7b6a8ee37091437d44a66a41af6bbfdbe9 (diff) | |
download | vaadin-framework-d0218aa4d44a20a3af7e13fd6680763a1baae21a.tar.gz vaadin-framework-d0218aa4d44a20a3af7e13fd6680763a1baae21a.zip |
Added default multiselect constant #3520
svn changeset:12570/svn branch:6.4
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java index 64a6d18a91..416a8b67d2 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java @@ -90,6 +90,13 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, private static final double CACHE_RATE_DEFAULT = 2; /** + * The default multi select mode where simple left clicks only selects one + * item, CTRL+left click selects multiple items and SHIFT-left click selects + * a range of items. + */ + private static final int MULTISELECT_MODE_DEFAULT = 0; + + /** * multiple of pagelength which component will cache when requesting more * rows */ @@ -216,7 +223,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, .getIntAttribute("dragmode") : 0; multiselectmode = uidl.hasAttribute("multiselectmode") ? uidl - .getIntAttribute("multiselectmode") : 0; + .getIntAttribute("multiselectmode") : MULTISELECT_MODE_DEFAULT; setCacheRate(uidl.hasAttribute("cr") ? uidl.getDoubleAttribute("cr") : CACHE_RATE_DEFAULT); @@ -2542,28 +2549,28 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, if ((event.getCtrlKey() || event.getMetaKey()) && event.getShiftKey() && selectMode == SELECT_MODE_MULTI - && multiselectmode == 0) { + && multiselectmode == MULTISELECT_MODE_DEFAULT) { toggleShiftSelection(false); // Ctrl click } else if ((event.getCtrlKey() || event .getMetaKey()) && selectMode == SELECT_MODE_MULTI - && multiselectmode == 0) { + && multiselectmode == MULTISELECT_MODE_DEFAULT) { toggleSelection(true); // Shift click } else if (event.getShiftKey() && selectMode == SELECT_MODE_MULTI - && multiselectmode == 0) { + && multiselectmode == MULTISELECT_MODE_DEFAULT) { toggleShiftSelection(true); // click } else { - if (multiselectmode == 0) { + if (multiselectmode == MULTISELECT_MODE_DEFAULT) { deselectAll(); } - toggleSelection(multiselectmode == 0); + toggleSelection(multiselectmode == MULTISELECT_MODE_DEFAULT); } // Remove IE text selection hack @@ -2642,7 +2649,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, || event.getShiftKey() || event.getMetaKey() && selectMode == SELECT_MODE_MULTI - && multiselectmode == 0) { + && multiselectmode == MULTISELECT_MODE_DEFAULT) { // Prevent default text selection in Firefox event.preventDefault(); |