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.

DataProviderRpc.java 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * Copyright 2000-2014 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.data;
  17. import com.vaadin.shared.annotations.NoLayout;
  18. import com.vaadin.shared.communication.ClientRpc;
  19. /**
  20. * RPC interface used for pushing container data to the client.
  21. *
  22. * @since
  23. * @author Vaadin Ltd
  24. */
  25. public interface DataProviderRpc extends ClientRpc {
  26. /**
  27. * Sends updated row data to a client.
  28. * <p>
  29. * rowDataJson represents a JSON array of JSON objects in the following
  30. * format:
  31. *
  32. * <pre>
  33. * [{
  34. * "d": [COL_1_JSON, COL_2_json, ...],
  35. * "k": "1"
  36. * },
  37. * ...
  38. * ]
  39. * </pre>
  40. *
  41. * where COL_INDEX is the index of the column (as a string), and COL_n_JSON
  42. * is valid JSON of the column's data.
  43. *
  44. * @param firstRowIndex
  45. * the index of the first updated row
  46. * @param rowDataJson
  47. * the updated row data
  48. * @see com.vaadin.shared.ui.grid.GridState#JSONKEY_DATA
  49. * @see com.vaadin.ui.components.grid.Renderer#encode(Object)
  50. */
  51. @NoLayout
  52. public void setRowData(int firstRowIndex, String rowDataJson);
  53. /**
  54. * Informs the client to remove row data.
  55. *
  56. * @param firstRowIndex
  57. * the index of the first removed row
  58. * @param count
  59. * the number of rows removed from <code>firstRowIndex</code> and
  60. * onwards
  61. */
  62. @NoLayout
  63. public void removeRowData(int firstRowIndex, int count);
  64. /**
  65. * Informs the client to insert new row data.
  66. *
  67. * @param firstRowIndex
  68. * the index of the first new row
  69. * @param count
  70. * the number of rows inserted at <code>firstRowIndex</code>
  71. */
  72. @NoLayout
  73. public void insertRowData(int firstRowIndex, int count);
  74. /**
  75. * Resets all data and defines a new size for the data.
  76. * <p>
  77. * This should be used in the cases where the data has changed in some
  78. * unverifiable way. I.e. "something happened". This will lead to a
  79. * re-rendering of the current Grid viewport
  80. *
  81. * @param size
  82. * the size of the new data set
  83. */
  84. public void resetDataAndSize(int size);
  85. }