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:
JCCResultListener
,StarterPanel.KillListener
,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 IFunctionalExceptionListener
customExceptionListener
Custom result listenerprotected IFunctionalResultListener<E>
customResultListener
Custom result listenerprotected java.awt.Component
parent
The 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 void
commandAvailable(java.lang.Object command)
Called when a command is available.void
customCommandAvailable(java.lang.Object command)
Called when a command is available.void
customExceptionOccurred(java.lang.Exception exception)
Called when an exception occurred.void
customResultAvailable(E result)
Called when the result is available.void
exceptionOccurred(java.lang.Exception exception)
Called when an exception occurred.void
resultAvailable(E result)
Called when the result is available.protected static void
unblock(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:
resultAvailable
in interfaceIFunctionalResultListener<E>
- Parameters:
result
- The result.
-
exceptionOccurred
public final void exceptionOccurred(java.lang.Exception exception)
Called when an exception occurred.- Specified by:
exceptionOccurred
in interfaceIFunctionalExceptionListener
- Overrides:
exceptionOccurred
in 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:
commandAvailable
in interfaceIFutureCommandResultListener<E>
- Overrides:
commandAvailable
in classDefaultResultListener<E>
-
customCommandAvailable
public void customCommandAvailable(java.lang.Object command)
Called when a command is available.
-
-