summaryrefslogtreecommitdiffstats
path: root/shared
diff options
context:
space:
mode:
authorJohannes Dahlström <johannesd@vaadin.com>2014-07-18 15:33:55 +0300
committerJohannes Dahlström <johannesd@vaadin.com>2014-07-24 13:11:03 +0300
commitff310e8bdbfc773153e4faa9eb5749bb3e44700e (patch)
treebd76ffae2a26ef15f7a59b8e53004bbaf46a385f /shared
parent7b749fb90f159ce285bc562a17293fbcd0d97400 (diff)
downloadvaadin-framework-ff310e8bdbfc773153e4faa9eb5749bb3e44700e.tar.gz
vaadin-framework-ff310e8bdbfc773153e4faa9eb5749bb3e44700e.zip
Grid header/footer rewrite: add partial shared state support (#13334)
Currently supported: * Adding and removal of header and footer rows * Header is single-row by default * Footer is zero-row by default * Text captions * Showing and hiding the whole header or footer * Passing captions and visibility in shared state TODO: * Column spanning * HTML content * Widget content * Component content * Sorting/Indicators * Server side API * Rest of shared state handling Change-Id: Iddd1a596597c3b11ead50bd7d5d7011cd81e2c83
Diffstat (limited to 'shared')
-rw-r--r--shared/src/com/vaadin/shared/ui/grid/GridColumnState.java2
-rw-r--r--shared/src/com/vaadin/shared/ui/grid/GridState.java10
-rw-r--r--shared/src/com/vaadin/shared/ui/grid/GridStaticSectionState.java41
3 files changed, 45 insertions, 8 deletions
diff --git a/shared/src/com/vaadin/shared/ui/grid/GridColumnState.java b/shared/src/com/vaadin/shared/ui/grid/GridColumnState.java
index b9bae35db6..5c0d04d968 100644
--- a/shared/src/com/vaadin/shared/ui/grid/GridColumnState.java
+++ b/shared/src/com/vaadin/shared/ui/grid/GridColumnState.java
@@ -37,11 +37,13 @@ public class GridColumnState implements Serializable {
/**
* Header caption for the column
*/
+ @Deprecated
public String header;
/**
* Footer caption for the column
*/
+ @Deprecated
public String footer;
/**
diff --git a/shared/src/com/vaadin/shared/ui/grid/GridState.java b/shared/src/com/vaadin/shared/ui/grid/GridState.java
index ef1b9a806a..68ee64dfe4 100644
--- a/shared/src/com/vaadin/shared/ui/grid/GridState.java
+++ b/shared/src/com/vaadin/shared/ui/grid/GridState.java
@@ -98,15 +98,9 @@ public class GridState extends AbstractComponentState {
*/
public List<GridColumnState> columns = new ArrayList<GridColumnState>();
- /**
- * Is the column header row visible
- */
- public boolean columnHeadersVisible = true;
+ public GridStaticSectionState header = new GridStaticSectionState();
- /**
- * Is the column footer row visible
- */
- public boolean columnFootersVisible = false;
+ public GridStaticSectionState footer = new GridStaticSectionState();
/**
* The column groups added to the grid
diff --git a/shared/src/com/vaadin/shared/ui/grid/GridStaticSectionState.java b/shared/src/com/vaadin/shared/ui/grid/GridStaticSectionState.java
new file mode 100644
index 0000000000..358c06d089
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/grid/GridStaticSectionState.java
@@ -0,0 +1,41 @@
+/*
+ * 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.grid;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Shared state for Grid headers and footers.
+ *
+ * @since
+ * @author Vaadin Ltd
+ */
+public class GridStaticSectionState implements Serializable {
+
+ public static class CellState implements Serializable {
+ public String text = "";
+ }
+
+ public static class RowState implements Serializable {
+ public List<CellState> cells = new ArrayList<CellState>();
+ }
+
+ public List<RowState> rows = new ArrayList<RowState>();
+
+ public boolean visible = true;
+}