public class DefaultUIProgressMonitor extends Object implements UIProgressMonitor
UIProgressMonitor
UNKNOWN
Constructor and Description |
---|
DefaultUIProgressMonitor() |
Modifier and Type | Method and Description |
---|---|
void |
beginTask(String name,
int totalWork)
Notifies that the main task is beginning.
|
void |
done()
Notifies that the work is done; that is, either the main task is completed or the user canceled it.
|
int |
getCurrentWork() |
String |
getSubtask() |
String |
getTaskName() |
int |
getTotalWork() |
boolean |
isCancelled()
Returns whether cancellation of current operation has been requested.
|
void |
setCancelled(boolean value)
Sets the cancel state to the given value.
|
void |
setTaskName(String name)
Sets the task name to the given value.
|
void |
subTask(String name)
Notifies that a subtask of the main task is beginning.
|
void |
worked(int work)
Notifies that a given number of work unit of the main task has been completed.
|
public void beginTask(String name, int totalWork)
UIProgressMonitor
beginTask
in interface UIProgressMonitor
name
- the name (or description) of the main tasktotalWork
- the total number of work units into which the main task is been subdivided. If the value is
UNKNOWN
the implementation is free to indicate progress in a way which doesn't require the
total number of work units in advance.public void done()
UIProgressMonitor
done
in interface UIProgressMonitor
public boolean isCancelled()
UIProgressMonitor
isCancelled
in interface UIProgressMonitor
true
if cancellation has been requested, and false
otherwiseUIProgressMonitor.setCancelled(boolean)
public void setCancelled(boolean value)
UIProgressMonitor
setCancelled
in interface UIProgressMonitor
value
- true
indicates that cancellation has been requested (but not necessarily acknowledged);
false
clears this flagUIProgressMonitor.isCancelled()
public void setTaskName(String name)
UIProgressMonitor
setTaskName
in interface UIProgressMonitor
name
- the name (or description) of the main taskUIProgressMonitor.beginTask(java.lang.String, int)
public void subTask(String name)
UIProgressMonitor
subTask
in interface UIProgressMonitor
name
- the name (or description) of the subtaskpublic void worked(int work)
UIProgressMonitor
worked
in interface UIProgressMonitor
work
- a non-negative number of work units just completedpublic String getTaskName()
public int getTotalWork()
public int getCurrentWork()
public String getSubtask()
Copyright © 2015 JBoss by Red Hat. All rights reserved.