org.springframework.richclient.application.splash
Class InfiniteProgressPanelProgressMonitor

java.lang.Object
  extended by org.springframework.richclient.application.splash.InfiniteProgressPanelProgressMonitor
All Implemented Interfaces:
ProgressMonitor

public class InfiniteProgressPanelProgressMonitor
extends Object
implements ProgressMonitor

ProgressMonitor adapter implementation for the InfiniteProgressPanel.

Author:
Peter De Bruycker

Constructor Summary
InfiniteProgressPanelProgressMonitor(InfiniteProgressPanel progressPanel)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InfiniteProgressPanelProgressMonitor

public InfiniteProgressPanelProgressMonitor(InfiniteProgressPanel progressPanel)
Method Detail

worked

public void worked(int work)
Description copied from interface: ProgressMonitor
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.

Specified by:
worked in interface ProgressMonitor
Parameters:
work - the percentage complete (0..100)

taskStarted

public void taskStarted(String name,
                        int totalWork)
Description copied from interface: ProgressMonitor
Notifies that the main task is beginning.

Specified by:
taskStarted in interface ProgressMonitor
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

public void subTaskStarted(String name)
Description copied from interface: ProgressMonitor
Notifies that a subtask of the main task is beginning. Subtasks are optional; the main task might not have subtasks.

Specified by:
subTaskStarted in interface ProgressMonitor
Parameters:
name - the name (or description) of the subtask

setCanceled

public void setCanceled(boolean b)
Description copied from interface: ProgressMonitor
Attempts to cancel the monitored task.

Specified by:
setCanceled in interface ProgressMonitor

isCanceled

public boolean isCanceled()
Description copied from interface: ProgressMonitor
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().

Specified by:
isCanceled in interface ProgressMonitor

done

public void done()
Description copied from interface: ProgressMonitor
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.

Specified by:
done in interface ProgressMonitor


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