org.netbeans.spi.wizard
Class DeferredWizardResult

java.lang.Object
  extended by org.netbeans.spi.wizard.DeferredWizardResult
Direct Known Subclasses:
WizardPanelNavResult

public abstract class DeferredWizardResult
extends java.lang.Object

Object which can be returned from WizardPage.WizardResultProducer.finish() or WizardPanelProvider.finish(). A DeferredWizardResult does not immediately calculate its result; it is used for cases where some time consuming work needs to be performed to compute the result (such as creating files on disk), and a progress bar should be shown until the work is completed.

See Also:
ResultProgressHandle

Field Summary
protected  boolean useBusy
           
 
Constructor Summary
DeferredWizardResult()
          Creates a new instance of DeferredWizardResult which cannot be aborted.
DeferredWizardResult(boolean canAbort)
          Creates a new instance of DeferredWizardResult which may or may not be able to be aborted.
 
Method Summary
 void abort()
          Abort computation of the result.
 boolean canAbort()
          If true, the background thread can be aborted.
 boolean isUseBusy()
           
 void setUseBusy(boolean useBusy)
          Indicate "busy" icon is to be used instead of a progress bar.
abstract  void start(java.util.Map settings, ResultProgressHandle progress)
          Begin computing the result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

useBusy

protected boolean useBusy
Constructor Detail

DeferredWizardResult

public DeferredWizardResult()
Creates a new instance of DeferredWizardResult which cannot be aborted.


DeferredWizardResult

public DeferredWizardResult(boolean canAbort)
Creates a new instance of DeferredWizardResult which may or may not be able to be aborted.

Method Detail

start

public abstract void start(java.util.Map settings,
                           ResultProgressHandle progress)
Begin computing the result. This method is called on a background thread, not the AWT event thread, and computation can immediately begin. Use the progress handle to set progress as the work progresses. IMPORTANT: This method MUST call either progress.finished with the result, or progress.failed with an error message. If this method returns without calling either of those methods, it will be assumed to have failed.

Parameters:
settings - The settings gathered over the course of the wizard
progress - A handle which can be used to affect the progress bar.

canAbort

public boolean canAbort()
If true, the background thread can be aborted. If it is possible to abort, then the UI may allow the dialog to be closed while the result is being computed.


abort

public void abort()
Abort computation of the result. This method will usually be called on the event thread, after start() has been called, and before finished() has been called on the ResultProgressHandler that is passed to start(), for example, if the user clicks the close button on the dialog showing the wizard while the result is being computed.


isUseBusy

public boolean isUseBusy()

setUseBusy

public void setUseBusy(boolean useBusy)
Indicate "busy" icon is to be used instead of a progress bar. This can be called by the constructor to avoid an initial display of the progress bar.

Parameters:
useBusy -