From 8ece5b005a8edb5c50d06c0ac9758044f7e8b877 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pekka=20Hyv=C3=B6nen?= Date: Fri, 13 Mar 2015 14:39:23 +0200 Subject: [PATCH] Client side API for setting a grid column hideable (#17023) Change-Id: I389d603210744ea02846a00ab893188b7953145f --- .../src/com/vaadin/client/widgets/Grid.java | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/client/src/com/vaadin/client/widgets/Grid.java b/client/src/com/vaadin/client/widgets/Grid.java index 7e08348da0..f7744d52ae 100644 --- a/client/src/com/vaadin/client/widgets/Grid.java +++ b/client/src/com/vaadin/client/widgets/Grid.java @@ -3385,6 +3385,8 @@ public class Grid extends ResizeComposite implements private boolean hidden = false; + private boolean hideable = false; + private String headerCaption = ""; private double minimumWidthPx = GridConstants.DEFAULT_MIN_WIDTH; @@ -3689,6 +3691,38 @@ public class Grid extends ResizeComposite implements return hidden; } + /** + * Set whether it is possible for the user to hide this column or not. + * Default is {@code false}. + *

+ * Note: it is still possible to hide the column + * programmatically using {@link #setHidden(boolean)}. + * + * @since + * @param hideable + * true if the user can hide this column, + * false if not + */ + public void setHideable(boolean hideable) { + this.hideable = hideable; + // TODO update whether sidebar/popup can be opened + } + + /** + * Is it possible for the the user to hide this column. Default is + * {@code false}. + *

+ * Note: the column can be programmatically hidden using + * {@link #setHidden(boolean)} regardless of the returned value. + * + * @since + * @return true if the user can hide the column, + * false if not + */ + public boolean isHideable() { + return hideable; + } + @Override public String toString() { String details = ""; -- 2.39.5