public abstract class ProgressMonitorTask extends java.lang.Object implements java.lang.Runnable, CancelTask
ProgressMonitor
Modifier and Type | Field and Description |
---|---|
protected boolean |
cancel |
protected boolean |
done |
protected java.lang.String |
error |
protected java.lang.String |
note |
protected int |
progress |
protected boolean |
success |
Constructor and Description |
---|
ProgressMonitorTask() |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
ProgressMonitor will call this when the user cancels.
|
java.lang.String |
getErrorMessage()
Applications call this to get an error message.
|
java.lang.String |
getNote()
ProgressMonitor displays this note in the ProgressMonitor.
|
int |
getProgress()
ProgressMonitor displays this progress value in the ProgressMonitor.
|
boolean |
isCancel()
Application calls to see if task is cancelled.
|
boolean |
isDone()
ProgressMonitor calls to see if task is done.
|
boolean |
isError()
Applications call this to find out if there was an error.
|
boolean |
isSuccess()
Application calls to see if task is success.
|
abstract void |
run()
Here is where the work gets done.
|
void |
setError(java.lang.String error)
for compatibility with ucar.nc2.CancelTask
|
void |
setProgress(java.lang.String msg,
int progress)
Called routine may optionally show a progress message for calling program to show to user.
|
protected boolean done
protected boolean success
protected boolean cancel
protected java.lang.String error
protected java.lang.String note
protected int progress
public abstract void run()
run
in interface java.lang.Runnable
public boolean isSuccess()
public boolean isCancel()
isCancel
in interface CancelTask
public boolean isError()
public java.lang.String getErrorMessage()
public boolean isDone()
public void cancel()
public java.lang.String getNote()
public int getProgress()
public void setError(java.lang.String error)
setError
in interface CancelTask
error
- message to show userpublic void setProgress(java.lang.String msg, int progress)
CancelTask
setProgress
in interface CancelTask
msg
- message to show userprogress
- count of progress