public static class SplashScreen.SplashProgressMonitor extends SplashScreen.Task implements ProgressMonitor
ProgressMonitor
which stores the (sub)tasks in a tree.ProgressMonitor.CancelListener
Modifier and Type | Field and Description |
---|---|
private SplashScreen.SplashProgressMonitor |
latestSubtask |
private ChangeListener |
listener |
private String |
name |
private List<SplashScreen.Task> |
tasks |
ALL_TICKS, DEFAULT_TICKS
Constructor and Description |
---|
SplashProgressMonitor(String name,
ChangeListener listener) |
Modifier and Type | Method and Description |
---|---|
void |
addCancelListener(ProgressMonitor.CancelListener listener)
Add listener for user abort action
|
void |
appendLogMessage(String message)
Appends a message to the log managed by the progress monitor.
|
void |
beginTask(String title)
Starts this progress monitor.
|
void |
beginTask(String title,
int ticks)
Starts this progress monitor.
|
void |
cancel()
Abort current operation, usually called when user somehow requested an abort
|
ProgressMonitor |
createSubTaskMonitor(int ticks,
boolean internal)
Creates subtasks monitor.
|
void |
finishTask()
Deprecated.
Use
finishTask(String) instead. |
void |
finishTask(String title)
Displays the given task as finished.
|
ProgressTaskId |
getProgressTaskId()
Returns the task ID of the progress dialog
Should be used only by PleaseWaitRunnable
|
int |
getTicks()
Get the current number of work units
|
int |
getTicksCount()
Get the total number of work units
|
Component |
getWindowParent()
Return the parent windows of progress dialog
|
void |
indeterminateSubTask(String title)
Subtask that will show progress running back and forth
|
void |
invalidate()
Can be used if method receive ProgressMonitor but it's not interested progress monitoring.
|
boolean |
isCanceled()
Returns the state of user aborts
|
void |
removeCancelListener(ProgressMonitor.CancelListener listener)
Remove listener for user abort action
|
void |
setCustomText(String text)
Shows additional text
|
void |
setExtraText(String text)
Show extra text after normal task title.
|
void |
setProgressTaskId(ProgressTaskId taskId)
Set the task ID of the progress dialog
Should be used only by PleaseWaitRunnable.
|
void |
setTicks(int ticks)
Set the current number of work units
|
void |
setTicksCount(int ticks)
Set the total number of work units
|
void |
subTask(String title)
Normal subtask
|
StringBuilder |
toHtml(StringBuilder sb)
Returns a HTML representation for this task.
|
void |
worked(int ticks)
Increase number of already done work units by ticks
|
toString
private final ChangeListener listener
private final List<SplashScreen.Task> tasks
private SplashScreen.SplashProgressMonitor latestSubtask
public SplashProgressMonitor(String name, ChangeListener listener)
public StringBuilder toHtml(StringBuilder sb)
SplashScreen.Task
toHtml
in class SplashScreen.Task
sb
- a StringBuilder
used to build the HTML codesb
public void beginTask(String title)
ProgressMonitor
beginTask
in interface ProgressMonitor
title
- title text of the taskpublic void beginTask(String title, int ticks)
ProgressMonitor
beginTask
in interface ProgressMonitor
title
- title text of the taskticks
- number of work units (see ProgressMonitor.setTicksCount(int ticks)
)public void setCustomText(String text)
ProgressMonitor
setCustomText
in interface ProgressMonitor
text
- custom textpublic void setExtraText(String text)
ProgressMonitor
setExtraText
in interface ProgressMonitor
text
- extra textpublic void indeterminateSubTask(String title)
ProgressMonitor
indeterminateSubTask
in interface ProgressMonitor
title
- Can be null
, in that case task title is not changedpublic void subTask(String title)
ProgressMonitor
subTask
in interface ProgressMonitor
title
- Can be null
, in that case task title is not changedpublic ProgressMonitor createSubTaskMonitor(int ticks, boolean internal)
ProgressMonitor
createSubTaskMonitor
in interface ProgressMonitor
ticks
- Number of work units that should be done when subtask finishesinternal
- If true then subtask can't modify task title/custom text@Deprecated public void finishTask()
finishTask(String)
instead.ProgressMonitor
finishTask
in interface ProgressMonitor
public void finishTask(String title)
title
- the task titlepublic void invalidate()
ProgressMonitor
ProgressMonitor.beginTask(String)
and ProgressMonitor.finishTask()
This method can be also used in finally section if method expects that some exception
might prevent it from passing progressMonitor away. If ProgressMonitor.beginTask(String)
was
already called then this method does nothing.invalidate
in interface ProgressMonitor
public void setTicksCount(int ticks)
ProgressMonitor
setTicksCount
in interface ProgressMonitor
ticks
- Number of total work unitspublic int getTicksCount()
ProgressMonitor
getTicksCount
in interface ProgressMonitor
public void setTicks(int ticks)
ProgressMonitor
setTicks
in interface ProgressMonitor
ticks
- Number of work units already donepublic int getTicks()
ProgressMonitor
getTicks
in interface ProgressMonitor
public void worked(int ticks)
ProgressMonitor
worked
in interface ProgressMonitor
ticks
- number of ticks to addpublic boolean isCanceled()
ProgressMonitor
isCanceled
in interface ProgressMonitor
true
if user aborted operationpublic void cancel()
ProgressMonitor
cancel
in interface ProgressMonitor
public void addCancelListener(ProgressMonitor.CancelListener listener)
ProgressMonitor
addCancelListener
in interface ProgressMonitor
listener
- the listener for cancel operationpublic void removeCancelListener(ProgressMonitor.CancelListener listener)
ProgressMonitor
removeCancelListener
in interface ProgressMonitor
listener
- the listener for cancel operationpublic void appendLogMessage(String message)
ProgressMonitor
appendLogMessage
in interface ProgressMonitor
message
- the log message. Ignored if null or white space only.public void setProgressTaskId(ProgressTaskId taskId)
ProgressMonitor
<> null
then "In background" button will be shownsetProgressTaskId
in interface ProgressMonitor
taskId
- the task IDpublic ProgressTaskId getProgressTaskId()
ProgressMonitor
getProgressTaskId
in interface ProgressMonitor
public Component getWindowParent()
ProgressMonitor
getWindowParent
in interface ProgressMonitor