Package jadex.commons.gui.future
Class SwingDefaultResultListener<E>
- java.lang.Object
 - 
- jadex.commons.future.DefaultResultListener<E>
 - 
- jadex.commons.gui.future.SwingDefaultResultListener<E>
 
 
 
- 
- All Implemented Interfaces:
 IFunctionalExceptionListener,IFunctionalResultListener<E>,IFutureCommandResultListener<E>,IResultListener<E>
- Direct Known Subclasses:
 SwingIntermediateDefaultResultListener
public class SwingDefaultResultListener<E> extends DefaultResultListener<E> implements IFutureCommandResultListener<E>
Result listener that redirects callbacks on the swing thread. 
- 
- 
Field Summary
Fields Modifier and Type Field Description protected IFunctionalExceptionListenercustomExceptionListenerCustom result listenerprotected IFunctionalResultListener<E>customResultListenerCustom result listenerprotected java.awt.ComponentparentThe component. 
- 
Constructor Summary
Constructors Constructor Description SwingDefaultResultListener()Create a new listener.SwingDefaultResultListener(IFunctionalResultListener<E> customResultListener)Create a new listener with functional interfaces.SwingDefaultResultListener(IFunctionalResultListener<E> customResultListener, IFunctionalExceptionListener customExceptionListener)Create a new listener with functional interfaces.SwingDefaultResultListener(IFunctionalResultListener<E> customResultListener, IFunctionalExceptionListener customExceptionListener, java.awt.Component parent)Create a new listener with functional interfaces.SwingDefaultResultListener(java.awt.Component parent)Create a new listener.SwingDefaultResultListener(java.util.logging.Logger logger)Create a new listener. 
- 
Method Summary
All Methods Static 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.voidresultAvailable(E result)Called when the result is available.protected static voidunblock(Future<java.lang.Void> adblock) 
 - 
 
- 
- 
Field Detail
- 
parent
protected java.awt.Component parent
The component. 
- 
customResultListener
protected IFunctionalResultListener<E> customResultListener
Custom result listener 
- 
customExceptionListener
protected IFunctionalExceptionListener customExceptionListener
Custom result listener 
 - 
 
- 
Constructor Detail
- 
SwingDefaultResultListener
public SwingDefaultResultListener(IFunctionalResultListener<E> customResultListener)
Create a new listener with functional interfaces.- Parameters:
 listener- The listener.
 
- 
SwingDefaultResultListener
public SwingDefaultResultListener(IFunctionalResultListener<E> customResultListener, IFunctionalExceptionListener customExceptionListener)
Create a new listener with functional interfaces.- Parameters:
 customResultListener- The custom result listener.customExceptionListener- The listener that is called on exceptions.
 
- 
SwingDefaultResultListener
public SwingDefaultResultListener(IFunctionalResultListener<E> customResultListener, IFunctionalExceptionListener customExceptionListener, java.awt.Component parent)
Create a new listener with functional interfaces.- Parameters:
 customResultListener- The custom result listener.customExceptionListener- The listener that is called on exceptions.parent- The parent component (when errors should be shown as dialog).
 
- 
SwingDefaultResultListener
public SwingDefaultResultListener()
Create a new listener. 
- 
SwingDefaultResultListener
public SwingDefaultResultListener(java.awt.Component parent)
Create a new listener.- Parameters:
 parent- The parent component (when errors should be shown as dialog).
 
- 
SwingDefaultResultListener
public SwingDefaultResultListener(java.util.logging.Logger logger)
Create a new listener.- Parameters:
 logger- The logger.
 
 - 
 
- 
Method Detail
- 
unblock
protected static void unblock(Future<java.lang.Void> adblock)
 
- 
resultAvailable
public final void resultAvailable(E result)
Called when the result is available.- Specified by:
 resultAvailablein interfaceIFunctionalResultListener<E>- Parameters:
 result- The result.
 
- 
exceptionOccurred
public final void exceptionOccurred(java.lang.Exception exception)
Called when an exception occurred.- Specified by:
 exceptionOccurredin interfaceIFunctionalExceptionListener- Overrides:
 exceptionOccurredin classDefaultResultListener<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.
 
- 
commandAvailable
public final void commandAvailable(java.lang.Object command)
Called when a command is available.- Specified by:
 commandAvailablein interfaceIFutureCommandResultListener<E>- Overrides:
 commandAvailablein classDefaultResultListener<E>
 
- 
customCommandAvailable
public void customCommandAvailable(java.lang.Object command)
Called when a command is available. 
 - 
 
 -