Class SwingResultListener<E>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected IResultListener<E> listener
      The delegation listener.
      protected boolean undone
      Flag if undone methods should be used.
    • Constructor Summary

      Constructors 
      Constructor Description
      SwingResultListener​(IResultListener<E> listener)
      Create a new listener.
      SwingResultListener​(java.util.function.Consumer<E> listener)
      Create a new listener with functional interfaces.
      SwingResultListener​(java.util.function.Consumer<E> listener, java.util.function.Consumer<java.lang.Exception> exceptionListener)
      Create a new listener with functional interfaces.
    • Field Detail

      • undone

        protected boolean undone
        Flag if undone methods should be used.
    • Constructor Detail

      • SwingResultListener

        public SwingResultListener​(java.util.function.Consumer<E> listener)
        Create a new listener with functional interfaces.
        Parameters:
        listener - The listener.
        exceptionListener - The listener that is called on exceptions.
      • SwingResultListener

        public SwingResultListener​(java.util.function.Consumer<E> listener,
                                   java.util.function.Consumer<java.lang.Exception> exceptionListener)
        Create a new listener with functional interfaces.
        Parameters:
        listener - The listener.
        exceptionListener - The listener that is called on exceptions.
      • SwingResultListener

        public SwingResultListener​(IResultListener<E> listener)
        Create a new listener.
    • Method Detail

      • resultAvailable

        public final void resultAvailable​(E result)
        Called when the result is available.
        Specified by:
        resultAvailable in interface IResultListener<E>
        Parameters:
        result - The result.
      • exceptionOccurred

        public final void exceptionOccurred​(java.lang.Exception exception)
        Called when an exception occurred.
        Specified by:
        exceptionOccurred in interface IResultListener<E>
        Parameters:
        exception - The exception.
      • customResultAvailable

        public void customResultAvailable​(E result)
        Called when the result is available.
        Parameters:
        result - The result.
      • customExceptionOccurred

        public void customExceptionOccurred​(java.lang.Exception exception)
        Called when an exception occurred.
        Parameters:
        exception - The exception.
      • customCommandAvailable

        public void customCommandAvailable​(java.lang.Object command)
        Called when a command is available.
      • exceptionOccurredIfUndone

        public void exceptionOccurredIfUndone​(java.lang.Exception exception)
        Called when an exception occurred.
        Specified by:
        exceptionOccurredIfUndone in interface IUndoneResultListener<E>
        Parameters:
        exception - The exception.
      • isUndone

        public boolean isUndone()
        Get the undone.
        Returns:
        The undone.