Class ActionWorker<R,P>
- java.lang.Object
-
- javax.swing.SwingWorker<R,P>
-
- org.nuiton.jaxx.runtime.swing.application.ActionWorker<R,P>
-
- All Implemented Interfaces:
Runnable,Future<R>,RunnableFuture<R>
public class ActionWorker<R,P> extends SwingWorker<R,P>
Action worker to execute a incoming action.- Since:
- 2.1
- Author:
- Tony Chemit - dev@tchemit.fr
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classActionWorker.ActionStatusState of a running action-
Nested classes/interfaces inherited from class javax.swing.SwingWorker
SwingWorker.StateValue
-
-
Constructor Summary
Constructors Constructor Description ActionWorker(String actionLabel)ActionWorker(String actionLabel, Runnable target)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected RdoInBackground()protected voiddone()StringgetActionLabel()longgetEndTime()ExceptiongetError()longgetStartTime()ActionWorker.ActionStatusgetStatus()Callable<R>getTarget()StringgetTime()booleanisFailed()voidsetTarget(Runnable target)voidsetTarget(Callable<R> target)Set the target to execute.-
Methods inherited from class javax.swing.SwingWorker
addPropertyChangeListener, cancel, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, process, publish, removePropertyChangeListener, run, setProgress
-
-
-
-
Field Detail
-
actionLabel
protected final String actionLabel
-
status
protected ActionWorker.ActionStatus status
-
error
protected Exception error
-
startTime
protected long startTime
-
endTime
protected long endTime
-
-
Method Detail
-
setTarget
public void setTarget(Runnable target)
-
setTarget
public void setTarget(Callable<R> target)
Set the target to execute.- Parameters:
target- the target to execute- Since:
- 2.5.1
-
doInBackground
protected R doInBackground()
- Specified by:
doInBackgroundin classSwingWorker<R,P>
-
isFailed
public boolean isFailed()
-
getError
public Exception getError()
-
getStatus
public ActionWorker.ActionStatus getStatus()
-
getActionLabel
public String getActionLabel()
-
done
protected void done()
- Overrides:
donein classSwingWorker<R,P>
-
getTime
public String getTime()
-
getStartTime
public long getStartTime()
-
getEndTime
public long getEndTime()
-
-