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.

GridServerRpc.java 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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.shared.ui.grid;
  17. import java.util.List;
  18. import com.vaadin.shared.MouseEventDetails;
  19. import com.vaadin.shared.communication.ServerRpc;
  20. import com.vaadin.shared.data.sort.SortDirection;
  21. import com.vaadin.shared.ui.grid.GridConstants.Section;
  22. /**
  23. * Client-to-server RPC interface for the Grid component.
  24. *
  25. * @since 7.4
  26. * @author Vaadin Ltd
  27. */
  28. public interface GridServerRpc extends ServerRpc {
  29. void sort(String[] columnIds, SortDirection[] directions,
  30. boolean userOriginated);
  31. /**
  32. * Informs the server that an item has been clicked in Grid.
  33. *
  34. * @param rowKey
  35. * a key identifying the clicked item
  36. * @param columnInternalId
  37. * column internal id identifying the clicked property
  38. * @param details
  39. * mouse event details
  40. * @param rowIndex
  41. * the row index of the clicked item
  42. */
  43. void itemClick(String rowKey, String columnInternalId,
  44. MouseEventDetails details, int rowIndex);
  45. /**
  46. * Informs the server that a context click has happened inside of Grid.
  47. *
  48. * @since 7.6
  49. * @param rowIndex
  50. * index of clicked row in Grid section
  51. * @param rowKey
  52. * a key identifying the clicked item
  53. * @param columnInternalId
  54. * column internal id identifying the clicked property
  55. * @param section
  56. * grid section (header, footer, body)
  57. * @param details
  58. * mouse event details
  59. */
  60. void contextClick(int rowIndex, String rowKey, String columnInternalId,
  61. Section section, MouseEventDetails details);
  62. /**
  63. * Informs the server that the columns of the Grid have been reordered.
  64. *
  65. * @since 7.5.0
  66. * @param newColumnOrder
  67. * a list of column internal ids in the new order
  68. * @param oldColumnOrder
  69. * a list of column internal ids in order before the change
  70. */
  71. void columnsReordered(List<String> newColumnOrder,
  72. List<String> oldColumnOrder);
  73. /**
  74. * Informs the server that a column's visibility has been changed.
  75. *
  76. * @since 8.0
  77. * @param columnInternalId
  78. * the internal id of the column
  79. * @param hidden
  80. * <code>true</code> if hidden, <code>false</code> if unhidden
  81. */
  82. void columnVisibilityChanged(String columnInternalId, boolean hidden);
  83. /**
  84. * Informs the server that a column has been resized by the user.
  85. *
  86. * @since 7.6
  87. * @param columnInternalId
  88. * the internal id of the column
  89. * @param pixels
  90. * the new width of the column in pixels
  91. */
  92. void columnResized(String columnInternalId, double pixels);
  93. }