|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjebl.util.ProgressListener
public abstract class ProgressListener
| Nested Class Summary | |
|---|---|
static class |
ProgressListener.Wrapper
A decorator progress listener which delegates all method calls to an internal progress listener. |
| Field Summary | |
|---|---|
static ProgressListener |
EMPTY
A ProgressListener that ignores all events and always returns false from isCanceled(). |
| Constructor Summary | |
|---|---|
ProgressListener()
|
|
| Method Summary | |
|---|---|
void |
addFeedbackAction(java.lang.String label,
SimpleListener listener)
Equivalent to addFeedbackAction(label,"",listener) |
void |
addFeedbackAction(java.lang.String label,
java.lang.String description,
SimpleListener listener)
Adds an action that can choose to provide feedback. |
abstract boolean |
isCanceled()
This method must be implemented by all subclasses. |
void |
removeFeedbackAction(java.lang.String label)
Removes a feedback action previously added using addFeedbackAction(String, jebl.util.SimpleListener). |
boolean |
setImage(java.awt.Image image)
Set an image associated with the current progress. |
boolean |
setIndeterminateProgress()
Sets indefinite progress (i.e. |
boolean |
setMessage(java.lang.String message)
Set visible user message. |
boolean |
setProgress(double fractionCompleted)
|
boolean |
setProgress(int currentStep,
int numberOfSteps)
Same as calling setProgress(((double)currentStep)/numberOfSteps) |
boolean |
setProgress(long currentStep,
long numberOfSteps)
Same as calling setProgress(((double)currentStep)/numberOfSteps) |
void |
setTitle(java.lang.String title)
Sets a title associated with whatever is being done. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final ProgressListener EMPTY
isCanceled(). Useful when you don't care about the progress
results or canceling the operation.
| Constructor Detail |
|---|
public ProgressListener()
| Method Detail |
|---|
public final boolean setProgress(double fractionCompleted)
fractionCompleted - a number between 0 and 1 inclusive
representing the fraction of the operation completed.
If you are unsure of the fraction completed, call setIndeterminateProgress() instead.
public final boolean setProgress(int currentStep,
int numberOfSteps)
setProgress(((double)currentStep)/numberOfSteps)
currentStep - between 0 and numberOfSteps inclusivenumberOfSteps - the total number of steps. Must be greater than 0.
public final boolean setProgress(long currentStep,
long numberOfSteps)
setProgress(((double)currentStep)/numberOfSteps)
currentStep - between 0 and numberOfSteps inclusivenumberOfSteps - the total number of steps. Must be greater than 0.
public final boolean setIndeterminateProgress()
public final boolean setMessage(java.lang.String message)
message - a user visible message. If this is null, it will be automatically replaced with an empty string.
public final boolean setImage(java.awt.Image image)
image - an image
public void addFeedbackAction(java.lang.String label,
SimpleListener listener)
addFeedbackAction(label,"",listener)
public void addFeedbackAction(java.lang.String label,
java.lang.String description,
SimpleListener listener)
listener will
never be fired.
label - a label describing this feedback action. For example, "Skip to next step"listener - a listener to be notified when the user chooses to invoke
this actionpublic void removeFeedbackAction(java.lang.String label)
addFeedbackAction(String, jebl.util.SimpleListener).
label - The label used as a parameter to addFeedbackAction(String, jebl.util.SimpleListener)public void setTitle(java.lang.String title)
title - the title of a progress window (if any). Must not be null.public abstract boolean isCanceled()
setProgress(double), setIndeterminateProgress() and setMessage(java.lang.String)
to determine the return value of these methods.
isCanceled in interface Cancelable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||