Package jaxx.runtime.swing.application
Class ActionWorker<R,P>
java.lang.Object
javax.swing.SwingWorker<R,P>
jaxx.runtime.swing.application.ActionWorker<R,P>
- All Implemented Interfaces:
java.lang.Runnable,java.util.concurrent.Future<R>,java.util.concurrent.RunnableFuture<R>
public class ActionWorker<R,P>
extends javax.swing.SwingWorker<R,P>
Action worker to execute a incoming action.
- Since:
- 2.1
- Author:
- Tony Chemit - chemit@codelutin.com
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classActionWorker.ActionStatusState of a running actionNested classes/interfaces inherited from class javax.swing.SwingWorker
javax.swing.SwingWorker.StateValue -
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringactionLabelprotected longendTimeprotected java.lang.Exceptionerrorprotected longstartTimeprotected ActionWorker.ActionStatusstatusprotected java.util.concurrent.Callable<R>target -
Constructor Summary
Constructors Constructor Description ActionWorker(java.lang.String actionLabel)ActionWorker(java.lang.String actionLabel, java.lang.Runnable target) -
Method Summary
Modifier and Type Method Description protected RdoInBackground()protected voiddone()java.lang.StringgetActionLabel()longgetEndTime()java.lang.ExceptiongetError()longgetStartTime()ActionWorker.ActionStatusgetStatus()java.util.concurrent.Callable<R>getTarget()java.lang.StringgetTime()booleanisFailed()voidsetTarget(java.lang.Runnable target)voidsetTarget(java.util.concurrent.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, setProgressMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
actionLabel
protected final java.lang.String actionLabel -
target
-
status
-
error
protected java.lang.Exception error -
startTime
protected long startTime -
endTime
protected long endTime
-
-
Constructor Details
-
ActionWorker
public ActionWorker(java.lang.String actionLabel) -
ActionWorker
public ActionWorker(java.lang.String actionLabel, java.lang.Runnable target)
-
-
Method Details
-
getTarget
-
setTarget
public void setTarget(java.lang.Runnable target) -
setTarget
Set the target to execute.- Parameters:
target- the target to execute- Since:
- 2.5.1
-
doInBackground
-
isFailed
public boolean isFailed() -
getError
public java.lang.Exception getError() -
getStatus
-
getActionLabel
public java.lang.String getActionLabel() -
done
protected void done() -
getTime
public java.lang.String getTime() -
getStartTime
public long getStartTime() -
getEndTime
public long getEndTime()
-