Modifier and Type | Class and Description |
---|---|
static interface |
PossiblyLengthyTask.MonitoredRunnable
A Runnable which can be monitored.
|
Modifier and Type | Field and Description |
---|---|
int |
graceMillis
After this amount of milliseconds, a feedback dialog box is
displayed allowing the user to cancel the task.
|
Component |
parentComponent
The parent of the feedback dialog box.
|
Runnable |
task
The possibly lengthy task.
|
String |
title
The title of the feedback dialog box.
|
Constructor and Description |
---|
PossiblyLengthyTask(Component parentComponent,
String title,
Runnable task,
int graceMillis)
Constructs a possibly lengthy task.
|
Modifier and Type | Method and Description |
---|---|
protected ThreadMonitorDialog |
createThreadMonitorDialog(Component parentComponent,
String title,
String subTitle,
int rows,
int columns,
boolean hasProgressBar) |
String |
execute()
Execute the task.
|
int |
getAnimateMillis()
Returns the duration specified using
setAnimateMillis(int) . |
void |
setAnimateMillis(int ms)
Wait specified duration, expressed in milliseconds, between
the different execution steps of a
PossiblyLengthyTask.MonitoredRunnable . |
public final Component parentComponent
public final String title
public final Runnable task
PossiblyLengthyTask.MonitoredRunnable
.public final int graceMillis
public PossiblyLengthyTask(Component parentComponent, String title, Runnable task, int graceMillis)
parentComponent
- parent of the feedback dialog boxtitle
- title of the feedback dialog boxtask
- the possibly lengthy task.
May implement PossiblyLengthyTask.MonitoredRunnable
.graceMillis
- after this amount of milliseconds,
a feedback dialog box is displayed allowing the user to cancel the taskpublic void setAnimateMillis(int ms)
PossiblyLengthyTask.MonitoredRunnable
.
This method is mainly useful during tests where otherwise the task would be too quick to execute.
getAnimateMillis()
public int getAnimateMillis()
setAnimateMillis(int)
.public String execute()
null
if the task completed successfully;
error message otherwiseprotected ThreadMonitorDialog createThreadMonitorDialog(Component parentComponent, String title, String subTitle, int rows, int columns, boolean hasProgressBar)