public interface WorkProgress extends SimpleListenable
| Modifier and Type | Interface and Description |
|---|---|
static interface |
WorkProgress.MultiTask
Interface for a multi-task progress, which is composed of sub-WorkProgress.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel(CancelException reason)
Cancel the underlying work.
|
void |
done()
Signal all the work has been done.
|
void |
error(Exception error)
Signal an error.
|
long |
getAmount()
Return the total amount of work to be done.
|
long |
getPosition()
Return the current position, which is the current amount of work already done.
|
long |
getRemainingWork()
Return the amount of remaining work.
|
String |
getSubText()
Return a sub-text describing the work being done.
|
IAsync<Exception> |
getSynch()
Return a synchronization point that will be unblocked by one of the method done, error or cancel.
|
String |
getText()
Return the text describing the work being done.
|
void |
interruptEvents()
Stop triggering events to listener, this may be useful before doing several modifications.
|
static void |
link(WorkProgress subTask,
WorkProgress progress,
long work)
Once the given sub-task is done, the given amount of work is added to the progress.
|
static void |
linkTo(WorkProgress progress,
IAsync<?> sp)
Link this WorkProgress with the given synchronization point: once the synchronization point is unblocked,
one of the done, error or cancel method is called.
|
static void |
linkTo(WorkProgress progress,
Task<?,?> task)
Link this WorkProgress with the given task: once the task is done,
one of the done, error or cancel method is called.
|
void |
progress(long amountDone)
Add an amount of work already done.
|
void |
resumeEvents(boolean trigger)
Resume triggering events after a call to interruptEvents(), and optionally trigger an event now.
|
void |
setAmount(long work)
Set the total amount of work to be done.
|
void |
setPosition(long position)
Set the position (amount of work already done).
|
void |
setSubText(String text)
Set the sub-text describing the work being done.
|
void |
setText(String text)
Set the text describing the work being done.
|
addListener, hasListeners, listen, removeListener, unlistenvoid setAmount(long work)
long getAmount()
void setPosition(long position)
long getPosition()
long getRemainingWork()
void progress(long amountDone)
void done()
void error(Exception error)
void cancel(CancelException reason)
IAsync<Exception> getSynch()
void interruptEvents()
void resumeEvents(boolean trigger)
String getText()
void setText(String text)
String getSubText()
void setSubText(String text)
static void linkTo(WorkProgress progress, IAsync<?> sp)
static void linkTo(WorkProgress progress, Task<?,?> task)
static void link(WorkProgress subTask, WorkProgress progress, long work)
Copyright © 2019. All rights reserved.