Package jadex.commons.gui.future
Class SwingDelegationResultListener<E>
- java.lang.Object
- 
- jadex.commons.gui.future.SwingDelegationResultListener<E>
 
- 
- All Implemented Interfaces:
- IFunctionalExceptionListener,- IFunctionalResultListener<E>,- IFutureCommandResultListener<E>,- IResultListener<E>,- IUndoneResultListener<E>
 
 public class SwingDelegationResultListener<E> extends java.lang.Object implements IUndoneResultListener<E>, IFutureCommandResultListener<E> Delegation result listener that calls customResultAvailable and customExceptionOccurred on swing thread.
- 
- 
Field SummaryFields Modifier and Type Field Description protected IFunctionalExceptionListenercustomExceptionListenerCustom result listenerprotected IFunctionalResultListener<E>customResultListenerCustom result listenerprotected Future<E>futureThe future to which calls are delegated.protected booleanundoneFlag if undone methods should be used.
 - 
Constructor SummaryConstructors Constructor Description SwingDelegationResultListener(Future<E> future)Create a new listener.SwingDelegationResultListener(Future<E> fut, IFunctionalResultListener<E> customResultListener)Create a new listener with functional interfaces.SwingDelegationResultListener(Future<E> fut, IFunctionalResultListener<E> customResultListener, IFunctionalExceptionListener customExceptionListener)Create a new listener with functional interfaces.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcommandAvailable(java.lang.Object command)Called when a command is available.voidcustomCommandAvailable(java.lang.Object command)Called when a command is available.voidcustomExceptionOccurred(java.lang.Exception exception)Called when an exception occurred.voidcustomResultAvailable(E result)Called when the result is available.voidexceptionOccurred(java.lang.Exception exception)Called when an exception occurred.voidexceptionOccurredIfUndone(java.lang.Exception exception)Called when an exception occurred.booleanisUndone()Get the undone.voidresultAvailable(E result)Called when the result is available.voidresultAvailableIfUndone(E result)Called when the result is available.
 
- 
- 
- 
Field Detail- 
undoneprotected boolean undone Flag if undone methods should be used.
 - 
customResultListenerprotected IFunctionalResultListener<E> customResultListener Custom result listener
 - 
customExceptionListenerprotected IFunctionalExceptionListener customExceptionListener Custom result listener
 
- 
 - 
Constructor Detail- 
SwingDelegationResultListenerpublic SwingDelegationResultListener(Future<E> fut, IFunctionalResultListener<E> customResultListener) Create a new listener with functional interfaces.- Parameters:
- fut- The Delegate.
- customResultListener- The listener.
 
 - 
SwingDelegationResultListenerpublic SwingDelegationResultListener(Future<E> fut, IFunctionalResultListener<E> customResultListener, IFunctionalExceptionListener 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.
 
 
- 
 - 
Method Detail- 
resultAvailablepublic final void resultAvailable(E result) Called when the result is available.- Specified by:
- resultAvailablein interface- IFunctionalResultListener<E>
- Parameters:
- result- The result.
 
 - 
exceptionOccurredpublic final void exceptionOccurred(java.lang.Exception exception) Called when an exception occurred.- Specified by:
- exceptionOccurredin interface- IFunctionalExceptionListener
- Parameters:
- exception- The exception.
 
 - 
customResultAvailablepublic void customResultAvailable(E result) Called when the result is available.- Parameters:
- result- The result.
 
 - 
customExceptionOccurredpublic void customExceptionOccurred(java.lang.Exception exception) Called when an exception occurred.- Parameters:
- exception- The exception.
 
 - 
commandAvailablepublic final void commandAvailable(java.lang.Object command) Called when a command is available.- Specified by:
- commandAvailablein interface- IFutureCommandResultListener<E>
 
 - 
customCommandAvailablepublic void customCommandAvailable(java.lang.Object command) Called when a command is available.
 - 
resultAvailableIfUndonepublic void resultAvailableIfUndone(E result) Called when the result is available.- Specified by:
- resultAvailableIfUndonein interface- IUndoneResultListener<E>
- Parameters:
- result- The result.
 
 - 
exceptionOccurredIfUndonepublic void exceptionOccurredIfUndone(java.lang.Exception exception) Called when an exception occurred.- Specified by:
- exceptionOccurredIfUndonein interface- IUndoneResultListener<E>
- Parameters:
- exception- The exception.
 
 - 
isUndonepublic boolean isUndone() Get the undone.- Returns:
- The undone.
 
 
- 
 
-