Package jebl.util
Class ProgressListener.Wrapper
- java.lang.Object
-
- jebl.util.ProgressListener
-
- jebl.util.ProgressListener.Wrapper
-
- All Implemented Interfaces:
Cancelable
- Enclosing class:
- ProgressListener
public static class ProgressListener.Wrapper extends ProgressListener
A decorator progress listener which delegates all method calls to an internal progress listener.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jebl.util.ProgressListener
ProgressListener.Wrapper
-
-
Field Summary
-
Fields inherited from class jebl.util.ProgressListener
EMPTY
-
-
Constructor Summary
Constructors Constructor Description Wrapper(ProgressListener internalProgressListener)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFeedbackAction(java.lang.String label, java.lang.String description, SimpleListener listener)
Adds an action that can choose to provide feedback.void
addFeedbackAction(java.lang.String label, SimpleListener listener)
Equivalent toaddFeedbackAction(label,"",listener)
boolean
isCanceled()
This method must be implemented by all subclasses.void
removeFeedbackAction(java.lang.String label)
Removes a feedback action previously added usingProgressListener.addFeedbackAction(String, jebl.util.SimpleListener)
.void
setTitle(java.lang.String title)
Sets a title associated with whatever is being done.-
Methods inherited from class jebl.util.ProgressListener
setImage, setIndeterminateProgress, setMessage, setProgress, setProgress, setProgress
-
-
-
-
Constructor Detail
-
Wrapper
public Wrapper(ProgressListener internalProgressListener)
- Parameters:
internalProgressListener
- progress listener that all method calls are forwarded to.
-
-
Method Detail
-
isCanceled
public boolean isCanceled()
Description copied from class:ProgressListener
This method must be implemented by all subclasses. It is called fromProgressListener.setProgress(double)
,ProgressListener.setIndeterminateProgress()
andProgressListener.setMessage(java.lang.String)
to determine the return value of these methods.- Specified by:
isCanceled
in interfaceCancelable
- Specified by:
isCanceled
in classProgressListener
- Returns:
- true if the user has requested that this operation be canceled.
-
addFeedbackAction
public void addFeedbackAction(java.lang.String label, SimpleListener listener)
Description copied from class:ProgressListener
Equivalent toaddFeedbackAction(label,"",listener)
- Overrides:
addFeedbackAction
in classProgressListener
-
addFeedbackAction
public void addFeedbackAction(java.lang.String label, java.lang.String description, SimpleListener listener)
Description copied from class:ProgressListener
Adds an action that can choose to provide feedback. For example, an operation may choose to provide a "Skip to next step" button alongside the cancel button. There is no requirement that a ProgressListener actually present this to the user - it may choose to ignore this method, in which caselistener
will never be fired.- Overrides:
addFeedbackAction
in classProgressListener
- Parameters:
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 action
-
removeFeedbackAction
public void removeFeedbackAction(java.lang.String label)
Description copied from class:ProgressListener
Removes a feedback action previously added usingProgressListener.addFeedbackAction(String, jebl.util.SimpleListener)
.- Overrides:
removeFeedbackAction
in classProgressListener
- Parameters:
label
- The label used as a parameter toProgressListener.addFeedbackAction(String, jebl.util.SimpleListener)
-
setTitle
public void setTitle(java.lang.String title)
Description copied from class:ProgressListener
Sets a title associated with whatever is being done. This will not necessarily even be presented to the user, but typically will be presented as the title of a progress window.- Overrides:
setTitle
in classProgressListener
- Parameters:
title
- the title of a progress window (if any). Must not be null.
-
-