Class SwingDelegationResultListener<E>

    • Field Detail

      • future

        protected Future<E> future
        The future to which calls are delegated.
      • undone

        protected boolean undone
        Flag if undone methods should be used.
      • customResultListener

        protected java.util.function.Consumer<E> customResultListener
        Custom result listener
      • customExceptionListener

        protected java.util.function.Consumer<java.lang.Exception> customExceptionListener
        Custom result listener
    • Constructor Detail

      • SwingDelegationResultListener

        public SwingDelegationResultListener​(Future<E> fut,
                                             java.util.function.Consumer<E> customResultListener)
        Create a new listener with functional interfaces.
        Parameters:
        fut - The Delegate.
        customResultListener - The listener.
      • SwingDelegationResultListener

        public SwingDelegationResultListener​(Future<E> fut,
                                             java.util.function.Consumer<E> customResultListener,
                                             java.util.function.Consumer<java.lang.Exception> customExceptionListener)
        Create a new listener with functional interfaces.
        Parameters:
        fut - The Delegate.
        customResultListener - The custom result listener.
        customExceptionListener - The listener that is called on exceptions.
      • SwingDelegationResultListener

        public SwingDelegationResultListener​(Future<E> future)
        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.