org.springframework.richclient.progress
Interface ProgressMonitor

Show UML class diagram
All Known Implementing Classes:
InfiniteProgressPanelProgressMonitor, NullProgressMonitor, ProgressBarProgressMonitor, StatusBarProgressMonitor

public interface ProgressMonitor

A interface for monitoring task progress.

Author:
Keith Donald

Method Summary
 void done()
          Notifies that the work is done; that is, either the main task is completed or the user cancelled it.
 boolean isCanceled()
          Returns true if the user does some UI action to cancel this operation.
 void setCanceled(boolean b)
          Attempts to cancel the monitored task.
 void subTaskStarted(String name)
          Notifies that a subtask of the main task is beginning.
 void taskStarted(String name, int totalWork)
          Notifies that the main task is beginning.
 void worked(int work)
          Notifies that a percentage of the work has been completed.
 

Method Detail

taskStarted

void taskStarted(String name,
                 int totalWork)
Notifies that the main task is beginning.

Parameters:
name - the name (or description) of the main task
totalWork - the total number of work units into which the main task is been subdivided. If the value is 0 or UNKNOWN the implemenation is free to indicate progress in a way which doesn't require the total number of work units in advance. In general users should use the UNKNOWN value if they don't know the total amount of work units.

subTaskStarted

void subTaskStarted(String name)
Notifies that a subtask of the main task is beginning. Subtasks are optional; the main task might not have subtasks.

Parameters:
name - the name (or description) of the subtask

worked

void worked(int work)
Notifies that a percentage of the work has been completed. This is called by clients when the work is performed and is used to update the progress monitor.

Parameters:
work - the percentage complete (0..100)

done

void done()
Notifies that the work is done; that is, either the main task is completed or the user cancelled it. done() can be called more than once; an implementation should be prepared to handle this case.


isCanceled

boolean isCanceled()
Returns true if the user does some UI action to cancel this operation. (like hitting the Cancel button on the progress dialog). The long running operation typically polls isCanceled().


setCanceled

void setCanceled(boolean b)
Attempts to cancel the monitored task.



Copyright © 2004-2009 The Spring Framework. All Rights Reserved.