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.

ErrorMessage.java 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. @ITMillApache2LicenseForJavaFiles@
  3. */
  4. package com.itmill.toolkit.terminal;
  5. /**
  6. * Interface for rendering error messages to terminal. All the visible errors
  7. * shown to user must implement this interface.
  8. *
  9. * @author IT Mill Ltd.
  10. * @version
  11. * @VERSION@
  12. * @since 3.0
  13. */
  14. public interface ErrorMessage extends Paintable {
  15. /**
  16. * Error code for system errors and bugs.
  17. */
  18. public static final int SYSTEMERROR = 5000;
  19. /**
  20. * Error code for critical error messages.
  21. */
  22. public static final int CRITICAL = 4000;
  23. /**
  24. * Error code for regular error messages.
  25. */
  26. public static final int ERROR = 3000;
  27. /**
  28. * Error code for warning messages.
  29. */
  30. public static final int WARNING = 2000;
  31. /**
  32. * Error code for informational messages.
  33. */
  34. public static final int INFORMATION = 1000;
  35. /**
  36. * Gets the errors level.
  37. *
  38. * @return the level of error as an integer.
  39. */
  40. public int getErrorLevel();
  41. /**
  42. * Error messages are inmodifiable and thus listeners are not needed. This
  43. * method should be implemented as empty.
  44. *
  45. * @param listener
  46. * the listener to be added.
  47. * @see com.itmill.toolkit.terminal.Paintable#addListener(Paintable.RepaintRequestListener)
  48. */
  49. public void addListener(RepaintRequestListener listener);
  50. /**
  51. * Error messages are inmodifiable and thus listeners are not needed. This
  52. * method should be implemented as empty.
  53. *
  54. * @param listener
  55. * the listener to be removed.
  56. * @see com.itmill.toolkit.terminal.Paintable#removeListener(Paintable.RepaintRequestListener)
  57. */
  58. public void removeListener(RepaintRequestListener listener);
  59. /**
  60. * Error messages are inmodifiable and thus listeners are not needed. This
  61. * method should be implemented as empty.
  62. *
  63. * @see com.itmill.toolkit.terminal.Paintable#requestRepaint()
  64. */
  65. public void requestRepaint();
  66. }