Class DefaultMessageHandler

  • All Implemented Interfaces:
    MessageHandler

    public class DefaultMessageHandler
    extends java.lang.Object
    implements MessageHandler
    Default implementation of the message handler provider that shows the messages in Swing dialogs and printing stacktraces to the console
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private javax.swing.JFrame ownerFrame  
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultMessageHandler​(javax.swing.JFrame ownerFrame)
      Constructor for the message handler.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void handleError​(java.lang.String title, java.lang.String errorText, java.lang.Throwable throwable)
      Show an error .
      void handleException​(java.lang.Throwable throwable)
      handle an exception however it should be handled
      void handleInformation​(java.awt.Container parent, java.lang.String title, java.lang.String info)
      Show information
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ownerFrame

        private javax.swing.JFrame ownerFrame
    • Constructor Detail

      • DefaultMessageHandler

        public DefaultMessageHandler​(javax.swing.JFrame ownerFrame)
        Constructor for the message handler.
        Parameters:
        ownerFrame - The frame that should own the Swing message dialogs (to avoid them shown behind and locking)
    • Method Detail

      • handleError

        public void handleError​(java.lang.String title,
                                java.lang.String errorText,
                                java.lang.Throwable throwable)
        Show an error .
        Specified by:
        handleError in interface MessageHandler
        Parameters:
        title - The title of the error message
        errorText - The error text
        throwable - The exception causing the error, can not be null
      • handleException

        public void handleException​(java.lang.Throwable throwable)
        handle an exception however it should be handled
        Specified by:
        handleException in interface MessageHandler
        Parameters:
        throwable - The exception causing the error, can not be null
      • handleInformation

        public void handleInformation​(java.awt.Container parent,
                                      java.lang.String title,
                                      java.lang.String info)
        Show information
        Specified by:
        handleInformation in interface MessageHandler
        Parameters:
        parent - frame (based on the spell checker dialog parent frame)
        title - The title of the information message
        info - The information message from the dictionary