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.

ReconnectDialog.java 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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.client.communication;
  17. import com.vaadin.client.ApplicationConnection;
  18. /**
  19. * Interface which must be implemented by the reconnect dialog
  20. *
  21. * @since 7.6
  22. * @author Vaadin Ltd
  23. */
  24. public interface ReconnectDialog {
  25. /**
  26. * Sets the main text shown in the dialog
  27. *
  28. * @param text
  29. * the text to show
  30. */
  31. void setText(String text);
  32. /**
  33. * Sets the reconnecting state, which is true if we are trying to
  34. * re-establish a connection with the server.
  35. *
  36. * @param reconnecting
  37. * true if we are trying to re-establish the server connection,
  38. * false if we have given up
  39. */
  40. void setReconnecting(boolean reconnecting);
  41. /**
  42. * Checks if the reconnect dialog is visible to the user
  43. *
  44. * @return true if the user can see the dialog, false otherwise
  45. */
  46. boolean isVisible();
  47. /**
  48. * Shows the dialog to the user
  49. *
  50. * @param connection
  51. * the application connection this is related to
  52. */
  53. void show(ApplicationConnection connection);
  54. /**
  55. * Hides the dialog from the user
  56. */
  57. void hide();
  58. /**
  59. * Sets the modality of the dialog. If the dialog is set to modal, it will
  60. * prevent the usage of the application while the dialog is being shown. If
  61. * not modal, the user can continue to use the application as normally and
  62. * all server events will be queued until connection has been
  63. * re-established.
  64. *
  65. * @param modal
  66. * true to make the dialog modal, false to allow usage while
  67. * dialog is shown
  68. */
  69. void setModal(boolean modal);
  70. /**
  71. * Checks the modality of the dialog.
  72. *
  73. * @see #setModal(boolean)
  74. * @return true if the dialog is modal, false otherwise
  75. */
  76. boolean isModal();
  77. /**
  78. * Called once after initialization to allow the reconnect dialog to preload
  79. * required resources, which might not be available when the server
  80. * connection is gone
  81. */
  82. void preload(ApplicationConnection connection);
  83. }