You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SectionState.java 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * Copyright 2000-2018 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.shared.ui.grid;
  17. import java.io.Serializable;
  18. import java.util.ArrayList;
  19. import java.util.HashMap;
  20. import java.util.List;
  21. import java.util.Map;
  22. import java.util.Set;
  23. import com.vaadin.shared.Connector;
  24. import com.vaadin.shared.ui.ContentMode;
  25. /**
  26. * Shared state for Grid headers and footers.
  27. *
  28. * @author Vaadin Ltd
  29. * @since 8.0
  30. */
  31. public class SectionState implements Serializable {
  32. /** The state of a header or footer row. */
  33. public static class RowState implements Serializable {
  34. /** The map from column ids to the cells in this row. */
  35. public Map<String, CellState> cells = new HashMap<>();
  36. /** The map from a joint cell to column id sets in this row. */
  37. public Map<CellState, Set<String>> cellGroups = new HashMap<>();
  38. /**
  39. * Whether this row is the default header row. Always false for footer
  40. * rows.
  41. */
  42. public boolean defaultHeader = false;
  43. /**
  44. * The style name for the row. Null if none.
  45. */
  46. public String styleName = null;
  47. }
  48. /** The state of a header or footer cell. */
  49. public static class CellState implements Serializable {
  50. public GridStaticCellType type = GridStaticCellType.TEXT;
  51. /** The style name for this cell. Null if none. */
  52. public String styleName = null;
  53. /** The textual caption of this cell. */
  54. public String text;
  55. /** The html content of this cell. */
  56. public String html;
  57. /**
  58. * The connector for the component that is set to be displayed in this
  59. * cell. Null if none.
  60. */
  61. public Connector connector = null;
  62. /** The id of the column that this cell belongs to. */
  63. public String columnId;
  64. /** The tooltip for the cell */
  65. public String description;
  66. /** The content mode for the tooltip for the cell */
  67. public ContentMode descriptionContentMode = ContentMode.TEXT;
  68. }
  69. /** The rows in this section. */
  70. public List<RowState> rows = new ArrayList<>();
  71. /**
  72. * Visibility of this section.
  73. *
  74. * @since 8.1.1
  75. */
  76. public boolean visible = true;
  77. }