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.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. * Copyright 2000-2022 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.v7.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.v7.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 columnId
  37. * column id identifying the clicked property
  38. * @param details
  39. * mouse event details
  40. */
  41. void itemClick(String rowKey, String columnId, MouseEventDetails details);
  42. /**
  43. * Informs the server that a context click has happened inside of Grid.
  44. *
  45. * @since 7.6
  46. * @param rowIndex
  47. * index of clicked row in Grid section
  48. * @param rowKey
  49. * a key identifying the clicked item
  50. * @param columnId
  51. * column id identifying the clicked property
  52. * @param section
  53. * grid section (header, footer, body)
  54. * @param details
  55. * mouse event details
  56. */
  57. void contextClick(int rowIndex, String rowKey, String columnId,
  58. Section section, MouseEventDetails details);
  59. /**
  60. * Informs the server that the columns of the Grid have been reordered.
  61. *
  62. * @since 7.5.0
  63. * @param newColumnOrder
  64. * a list of column ids in the new order
  65. * @param oldColumnOrder
  66. * a list of column ids in order before the change
  67. */
  68. void columnsReordered(List<String> newColumnOrder,
  69. List<String> oldColumnOrder);
  70. /**
  71. * Informs the server that a column's visibility has been changed.
  72. *
  73. * @since 7.5.0
  74. * @param id
  75. * the id of the column
  76. * @param hidden
  77. * <code>true</code> if hidden, <code>false</code> if unhidden
  78. * @param userOriginated
  79. * <code>true</code> if triggered by user, <code>false</code> if
  80. * by code
  81. */
  82. void columnVisibilityChanged(String id, boolean hidden,
  83. boolean userOriginated);
  84. /**
  85. * Informs the server that a column has been resized by the user.
  86. *
  87. * @since 7.6
  88. * @param id
  89. * the id of the column
  90. * @param pixels
  91. * the new width of the column in pixels
  92. */
  93. void columnResized(String id, double pixels);
  94. }