public class SubProgressReceiver extends Object implements ProgressReceiver
ProgressReceiver.OperationCancelled, ProgressReceiver.OperationCancelledByUser| Constructor and Description |
|---|
SubProgressReceiver(ProgressReceiver progressReceiver,
float offset,
float extent) |
SubProgressReceiver(ProgressReceiver progressReceiver,
String message,
float offset,
float extent) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(ProgressReceiver listener)
Adds an additional progress receiver, to which the
setProgress(float), setMessage(java.lang.String),
done() and exceptionThrown(java.lang.Throwable) methods
will be forwarded (without remapping the progress). |
void |
checkForCancellation()
Check whether the operation has been canceled.
|
void |
done()
Report that the operation has succeeded successfully.
|
void |
exceptionThrown(Throwable exception)
Report that the operation has been aborted due to an exception having
been thrown.
|
Throwable |
getCreationTrace() |
String |
getLastMessage() |
ProgressReceiver |
getParent() |
void |
removeListener(ProgressReceiver listener) |
void |
reset()
Restart the progress bar.
|
void |
setMessage(String message)
Change the message describing the current operation.
|
void |
setProgress(float progress)
Set the progress as a value from 0.0f to 1.0f (inclusive).
|
void |
subProgressStarted(SubProgressReceiver subProgressReceiver)
Invoked when a subordinate
SubProgressReceiver is started,
reporting to this progress receiver. |
public SubProgressReceiver(ProgressReceiver progressReceiver, float offset, float extent) throws ProgressReceiver.OperationCancelled
public SubProgressReceiver(ProgressReceiver progressReceiver, String message, float offset, float extent) throws ProgressReceiver.OperationCancelled
public void addListener(ProgressReceiver listener)
setProgress(float), setMessage(java.lang.String),
done() and exceptionThrown(java.lang.Throwable) methods
will be forwarded (without remapping the progress). Note that recursive
invocations of setMessage(), exceptionThrown()
and done() are not reported.public void removeListener(ProgressReceiver listener)
public ProgressReceiver getParent()
public String getLastMessage()
public Throwable getCreationTrace()
public void setProgress(float progress)
throws ProgressReceiver.OperationCancelled
ProgressReceiversetProgress in interface ProgressReceiverprogress - The progress to report.ProgressReceiver.OperationCancelled - If the
operation has been canceled, for instance by the user, or because
of an exception on another thread.public void exceptionThrown(Throwable exception)
ProgressReceiverexceptionThrown in interface ProgressReceiverexception - The exception which has been thrown.public void done()
ProgressReceiverdone in interface ProgressReceiverpublic void setMessage(String message) throws ProgressReceiver.OperationCancelled
ProgressReceiversetMessage in interface ProgressReceivermessage - A message describing the current operation.ProgressReceiver.OperationCancelled - If the
operation has been canceled, for instance by the user, or because
of an exception on another thread.public void checkForCancellation()
throws ProgressReceiver.OperationCancelled
ProgressReceiverOperationCancelled exception will be thrown if it has.checkForCancellation in interface ProgressReceiverProgressReceiver.OperationCancelled - If the
operation has been canceled, for instance by the user, or because
of an exception on another thread.public void reset()
ProgressReceiverreset in interface ProgressReceiverpublic void subProgressStarted(SubProgressReceiver subProgressReceiver) throws ProgressReceiver.OperationCancelled
ProgressReceiverSubProgressReceiver is started,
reporting to this progress receiver.subProgressStarted in interface ProgressReceiversubProgressReceiver - The sub progress receiver which has been
started.ProgressReceiver.OperationCancelled - If the
operation has been canceled, for instance by the user, or because
of an exception on another thread.Copyright © 2011–2023 pepsoft.org. All rights reserved.