org.xnap.commons.io
Interface ProgressMonitor

All Known Implementing Classes:
NullProgressMonitor, ProgressDialog, SubTaskProgressMonitor, UserAbortProgressMonitor

public interface ProgressMonitor

Defines the requirements for classes that monitor operations to display user visible feedback.


Method Summary
 Component getComponent()
          Returns the component that displays the progress.
 boolean isCancelled()
          Returns true, if the operation has been cancelled by the user.
 void setCancelEnabled(boolean enabled)
          Enables the cancel button.
 void setText(String text)
          Sets the message text.
 void setTotalSteps(long max)
          Sets the maximum value.
 void setValue(long value)
          Sets the current value.
 void work(long amount)
          Increase the value by amount.
 

Method Detail

getComponent

Component getComponent()
Returns the component that displays the progress. This could be a dialog, a progress bar or null.

Returns:
null, if this monitor is not displayed by a component; the component, otherwise

isCancelled

boolean isCancelled()
Returns true, if the operation has been cancelled by the user.


setCancelEnabled

void setCancelEnabled(boolean enabled)
Enables the cancel button.

Per default we assume cancelling is enabled.


setTotalSteps

void setTotalSteps(long max)
Sets the maximum value.


setValue

void setValue(long value)
Sets the current value.

Parameters:
value - min <= value <= max

setText

void setText(String text)
Sets the message text.


work

void work(long amount)
Increase the value by amount.



Copyright © 2004-2007 XNap Commons Team. All Rights Reserved.