# 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.

Version:
  $Id: ProgressListener.java 1068 2010-09-08 23:59:59Z matt_kearse $ ProgressListener guarantees the following contract: A call to any of the methods setProgress(), setMessage(), isCanceled() and setIndeterminateProgress() at a given time yields the same result as a call to another of these methods would have resulted at the same time. Once the task whose progress we are observing has been canceled, calls to either of these methods reflect this. This does not prevent subclasses from introducing a way to "reset" a ProgressListener that was previously canceled from not being canceled any more. Any object may exhibit undefined behaviour when dealing with a ProgressListener that is not fulfilling this contract.
Author:
  Matt Kearse

## Nested Class Summary

### Nested classes/interfaces inherited from class ProgressListener

`ProgressListener.Wrapper`

## Field Summary

### Fields inherited from class ProgressListener

`EMPTY`

## Constructor Summary

Constructors
Constructor
Description
`Wrapper(ProgressListener internalProgressListener)`

## Method Summary

Modifier and Type
Method
Description
`void`
`addFeedbackAction(String label, String description, SimpleListener listener)`
Adds an action that can choose to provide feedback.
`void`
`addFeedbackAction(String label, SimpleListener listener)`
Equivalent to `addFeedbackAction(label,"",listener)`
`boolean`
`isCanceled()`
This method must be implemented by all subclasses.
`void`
`removeFeedbackAction(String label)`
Removes a feedback action previously added using `ProgressListener.addFeedbackAction(String, jebl.util.SimpleListener)`.
`void`
`setTitle(String title)`
Sets a title associated with whatever is being done.

### Methods inherited from class ProgressListener

`setImage, setIndeterminateProgress, setMessage, setProgress, setProgress, setProgress`

### Methods inherited from class Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### Wrapper

public Wrapper(ProgressListener internalProgressListener)

Parameters:
  `internalProgressListener` - progress listener that all method calls are forwarded to.

## Method Details

### isCanceled

public boolean isCanceled()
Description copied from class: `ProgressListener`
This method must be implemented by all subclasses. It is called from `ProgressListener.setProgress(double)`, `ProgressListener.setIndeterminateProgress()` and `ProgressListener.setMessage(String)` to determine the return value of these methods.

Specified by:
  `isCanceled` in interface `Cancelable`
Specified by:
  `isCanceled` in class `ProgressListener`
Returns:
  true if the user has requested that this operation be canceled.

### addFeedbackAction

public void addFeedbackAction(String label, SimpleListener listener)
Description copied from class: `ProgressListener`
Equivalent to `addFeedbackAction(label,"",listener)`

Overrides:
  `addFeedbackAction` in class `ProgressListener`

### addFeedbackAction

public void addFeedbackAction(String label, 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 case `listener` will never be fired.

Overrides:
  `addFeedbackAction` in class `ProgressListener`
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(String label)
Description copied from class: `ProgressListener`
Removes a feedback action previously added using `ProgressListener.addFeedbackAction(String, jebl.util.SimpleListener)`.

Overrides:
  `removeFeedbackAction` in class `ProgressListener`
Parameters:
  `label` - The label used as a parameter to `ProgressListener.addFeedbackAction(String, jebl.util.SimpleListener)`

### setTitle

public void setTitle(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 class `ProgressListener`
Parameters:
  `title` - the title of a progress window (if any). Must not be null.