summaryrefslogtreecommitdiffstats
path: root/shared/src
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2015-09-18 14:26:50 +0300
committerHenri Sara <hesara@vaadin.com>2015-12-16 07:18:37 +0000
commit3aff803172dab49a6e0ac694b3b3d687dc7e976c (patch)
tree469ac91e564baf88852bb73460194b07cf381134 /shared/src
parent61e83653330399f6ead49f74277410e43368a2cb (diff)
downloadvaadin-framework-3aff803172dab49a6e0ac694b3b3d687dc7e976c.tar.gz
vaadin-framework-3aff803172dab49a6e0ac694b3b3d687dc7e976c.zip
Make it possible to only show collapsible columns in menu (#9811)
Change-Id: I52cd2648d305f44d5688e7a2fcd222e6b167b97b
Diffstat (limited to 'shared/src')
-rw-r--r--shared/src/com/vaadin/shared/ui/table/CollapseMenuContent.java40
-rw-r--r--shared/src/com/vaadin/shared/ui/table/TableConstants.java7
-rw-r--r--shared/src/com/vaadin/shared/ui/table/TableState.java2
3 files changed, 49 insertions, 0 deletions
diff --git a/shared/src/com/vaadin/shared/ui/table/CollapseMenuContent.java b/shared/src/com/vaadin/shared/ui/table/CollapseMenuContent.java
new file mode 100644
index 0000000000..22f28d193b
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/table/CollapseMenuContent.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.shared.ui.table;
+
+/**
+ * Defines whether only collapsible columns should be shown to the user in the
+ * column collapse menu.
+ *
+ * @see com.vaadin.ui.Table#setCollapseMenuContent(CollapseMenuContent)
+ *
+ * @since
+ * @author Vaadin Ltd
+ */
+public enum CollapseMenuContent {
+ /**
+ * All columns are shown in the collapse menu. Columns that are not
+ * collapsible are shown as disabled in the menu. This is the default
+ * setting.
+ */
+ ALL_COLUMNS,
+
+ /**
+ * Only collapsible columns are shown in the collapse menu.
+ */
+ COLLAPSIBLE_COLUMNS;
+}
diff --git a/shared/src/com/vaadin/shared/ui/table/TableConstants.java b/shared/src/com/vaadin/shared/ui/table/TableConstants.java
index 3a11e0a69a..a90bb7208a 100644
--- a/shared/src/com/vaadin/shared/ui/table/TableConstants.java
+++ b/shared/src/com/vaadin/shared/ui/table/TableConstants.java
@@ -45,4 +45,11 @@ public class TableConstants implements Serializable {
@Deprecated
public static final String ATTRIBUTE_KEY_MAPPER_RESET = "clearKeyMap";
+ /**
+ * Default value for {@link TableState#collapseMenuContent}.
+ *
+ * @since
+ */
+ public static final CollapseMenuContent DEFAULT_COLLAPSE_MENU_CONTENT = CollapseMenuContent.ALL_COLUMNS;
+
}
diff --git a/shared/src/com/vaadin/shared/ui/table/TableState.java b/shared/src/com/vaadin/shared/ui/table/TableState.java
index 7c60a78f57..9e225846b8 100644
--- a/shared/src/com/vaadin/shared/ui/table/TableState.java
+++ b/shared/src/com/vaadin/shared/ui/table/TableState.java
@@ -26,4 +26,6 @@ public class TableState extends AbstractSelectState {
{
primaryStyleName = "v-table";
}
+
+ public CollapseMenuContent collapseMenuContent = TableConstants.DEFAULT_COLLAPSE_MENU_CONTENT;
}