diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2016-09-21 13:08:16 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2016-09-27 14:14:38 +0000 |
commit | 680b7009d4f453dc8eec42975192094b2e0e8e2f (patch) | |
tree | 1b9685d189e29de82f4afdfff324044b8b7f461b /shared/src | |
parent | 211dd5336e47f31556f3f6f42f11b7f7a62ec887 (diff) | |
download | vaadin-framework-680b7009d4f453dc8eec42975192094b2e0e8e2f.tar.gz vaadin-framework-680b7009d4f453dc8eec42975192094b2e0e8e2f.zip |
Initial support for multiple headers in new Grid
Change-Id: I7a3fa34749322451ab5cef4465d4d7c76029c097
Diffstat (limited to 'shared/src')
-rw-r--r-- | shared/src/main/java/com/vaadin/shared/ui/grid/GridState.java | 3 | ||||
-rw-r--r-- | shared/src/main/java/com/vaadin/shared/ui/grid/SectionState.java | 57 |
2 files changed, 60 insertions, 0 deletions
diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/GridState.java b/shared/src/main/java/com/vaadin/shared/ui/grid/GridState.java index 4f480139d5..6c9631b598 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/grid/GridState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/GridState.java @@ -99,6 +99,9 @@ public class GridState extends AbstractSingleSelectState { primaryStyleName = "v-grid"; } + /** The state of the header section. */ + public SectionState header = new SectionState(); + /** * Column order in grid. */ diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/SectionState.java b/shared/src/main/java/com/vaadin/shared/ui/grid/SectionState.java new file mode 100644 index 0000000000..55a8df99b8 --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/SectionState.java @@ -0,0 +1,57 @@ +/* + * Copyright 2000-2016 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.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Shared state for Grid headers and footers. + * + * @author Vaadin Ltd + * @since 7.4 + */ +public class SectionState implements Serializable { + + /** The state of a header or footer row. */ + public static class RowState implements Serializable { + + /** The map from column ids to the cells in this row. */ + public Map<String, CellState> cells = new HashMap<>(); + + /** + * Whether this row is the default header row. Always false for footer + * rows. + */ + public boolean defaultHeader = false; + } + + /** The state of a header or footer cell. */ + public static class CellState implements Serializable { + + /** The textual caption of this cell. */ + public String text; + + /** The id of the column that this cell belongs to. */ + public String columnId; + } + + /** The rows in this section. */ + public List<RowState> rows = new ArrayList<>(); +} |