public class WorkProgressImpl extends SimpleListenableContainer<AsyncEvent> implements WorkProgress
WorkProgress.MultiTask| Modifier and Type | Field and Description |
|---|---|
protected long |
amount |
protected boolean |
eventsInterrupted |
protected long |
position |
protected String |
subText |
protected Async<Exception> |
synch |
protected String |
text |
event| Constructor and Description |
|---|
WorkProgressImpl(long amount)
Constructor.
|
WorkProgressImpl(long amount,
String text)
Constructor.
|
WorkProgressImpl(long amount,
String text,
String subText)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel(CancelException reason)
Cancel the underlying work.
|
protected void |
changed() |
protected AsyncEvent |
createEvent() |
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.
|
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, removeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitlink, linkTo, linkToaddListener, hasListeners, listen, removeListener, unlistenprotected long amount
protected long position
protected String text
protected String subText
protected boolean eventsInterrupted
public WorkProgressImpl(long amount,
String text)
public WorkProgressImpl(long amount)
protected AsyncEvent createEvent()
createEvent in class SimpleListenableContainer<AsyncEvent>public void setAmount(long work)
WorkProgresssetAmount in interface WorkProgresspublic long getAmount()
WorkProgressgetAmount in interface WorkProgresspublic void setPosition(long position)
WorkProgresssetPosition in interface WorkProgresspublic long getPosition()
WorkProgressgetPosition in interface WorkProgresspublic void progress(long amountDone)
WorkProgressprogress in interface WorkProgresspublic void done()
WorkProgressdone in interface WorkProgresspublic void error(Exception error)
WorkProgresserror in interface WorkProgresspublic void cancel(CancelException reason)
WorkProgresscancel in interface WorkProgresspublic IAsync<Exception> getSynch()
WorkProgressgetSynch in interface WorkProgresspublic long getRemainingWork()
WorkProgressgetRemainingWork in interface WorkProgresspublic String getText()
WorkProgressgetText in interface WorkProgresspublic void setText(String text)
WorkProgresssetText in interface WorkProgresspublic String getSubText()
WorkProgressgetSubText in interface WorkProgresspublic void setSubText(String text)
WorkProgresssetSubText in interface WorkProgresspublic void interruptEvents()
WorkProgressinterruptEvents in interface WorkProgresspublic void resumeEvents(boolean trigger)
WorkProgressresumeEvents in interface WorkProgressprotected void changed()
Copyright © 2019. All rights reserved.