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.

HeaderRow.java 2.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * Copyright 2000-2016 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.ui.components.grid;
  17. import java.io.Serializable;
  18. import java.util.Set;
  19. import com.vaadin.ui.Grid;
  20. import com.vaadin.ui.Grid.Column;
  21. /**
  22. * A header row in a Grid.
  23. *
  24. * @author Vaadin Ltd
  25. * @since 8.0
  26. */
  27. public interface HeaderRow extends Serializable {
  28. /**
  29. * Returns the cell on this row corresponding to the given column id.
  30. *
  31. * @see Column#setId(String)
  32. *
  33. * @param columnId
  34. * the id of the column whose header cell to get, not null
  35. * @return the header cell
  36. * @throws IllegalArgumentException
  37. * if there is no such column in the grid
  38. */
  39. public HeaderCell getCell(String columnId);
  40. /**
  41. * Returns the cell on this row corresponding to the given column.
  42. *
  43. * @param column
  44. * the column whose header cell to get, not null
  45. * @return the header cell
  46. * @throws IllegalArgumentException
  47. * if there is no such column in the grid
  48. */
  49. public HeaderCell getCell(Grid.Column<?, ?> column);
  50. /**
  51. * Merges column cells in the row. Original cells are hidden, and new merged
  52. * cell is shown instead. The cell has a width of all merged cells together,
  53. * inherits styles of the first merged cell but has empty caption.
  54. *
  55. * @param cellsToMerge
  56. * the cells which should be merged. The cells should not be
  57. * merged to any other cell set.
  58. * @return the remaining visible cell after the merge
  59. *
  60. * @see #join(HeaderCell...)
  61. * @see com.vaadin.ui.AbstractComponent#setCaption(String) setCaption
  62. */
  63. HeaderCell join(Set<HeaderCell> cellsToMerge);
  64. /**
  65. * Merges column cells in the row. Original cells are hidden, and new merged
  66. * cell is shown instead. The cell has a width of all merged cells together,
  67. * inherits styles of the first merged cell but has empty caption.
  68. *
  69. * @param cellsToMerge
  70. * the cells which should be merged. The cells should not be
  71. * merged to any other cell set.
  72. * @return the remaining visible cell after the merge
  73. *
  74. * @see #join(Set)
  75. * @see com.vaadin.ui.AbstractComponent#setCaption(String) setCaption
  76. */
  77. HeaderCell join(HeaderCell... cellsToMerge);
  78. }