aboutsummaryrefslogtreecommitdiffstats
path: root/server/src
diff options
context:
space:
mode:
authorPekka Hyvönen <pekka@vaadin.com>2015-02-17 10:54:40 +0200
committerPekka Hyvönen <pekka@vaadin.com>2015-02-17 16:34:28 +0200
commitf537b9fdb2ba3993090d22011adfe247e4e2b6bd (patch)
tree205da1e7682db9207da6f439ae10ba9f2b3fcb29 /server/src
parenta7db9821bac2e41601dd4fd0f169d8a94d6e282e (diff)
downloadvaadin-framework-f537b9fdb2ba3993090d22011adfe247e4e2b6bd.tar.gz
vaadin-framework-f537b9fdb2ba3993090d22011adfe247e4e2b6bd.zip
Toggle column reordering from server side. Tests for reordering. #16643
Change-Id: Ib52143ce387f6376878bf3d1c401615a15f1a3cc
Diffstat (limited to 'server/src')
-rw-r--r--server/src/com/vaadin/ui/Grid.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/Grid.java b/server/src/com/vaadin/ui/Grid.java
index 2bc42676c3..764960606a 100644
--- a/server/src/com/vaadin/ui/Grid.java
+++ b/server/src/com/vaadin/ui/Grid.java
@@ -3469,6 +3469,31 @@ public class Grid extends AbstractComponent implements SelectionNotifier,
return columnKeys.get(columnId);
}
+ /**
+ * Returns whether column reordering is allowed. Default value is
+ * <code>false</code>.
+ *
+ * @since
+ * @return true if reordering is allowed
+ */
+ public boolean isColumnReorderingAllowed() {
+ return getState(false).columnReorderingAllowed;
+ }
+
+ /**
+ * Sets whether or not column reordering is allowed. Default value is
+ * <code>false</code>.
+ *
+ * @since
+ * @param columnReorderingAllowed
+ * specifies whether column reordering is allowed
+ */
+ public void setColumnReorderingAllowed(boolean columnReorderingAllowed) {
+ if (isColumnReorderingAllowed() != columnReorderingAllowed) {
+ getState().columnReorderingAllowed = columnReorderingAllowed;
+ }
+ }
+
@Override
protected GridState getState() {
return (GridState) super.getState();