org.netbeans.spi.wizard
Class WizardController

java.lang.Object
  extended by org.netbeans.spi.wizard.WizardController

public final class WizardController
extends java.lang.Object

Controller which can be used to modify the UI state of a wizard. Passed as an argument to methods of WizardPanelProvider. Use this interface to determine whether the Next/Finish buttons should be enabled, and if some problem explanation text should be displayed.

If you are using WizardPage, methods equivalent to this interface are available directly on instances of WizardPage.

Author:
Tim Boudreau
See Also:
WizardPanelProvider

Field Summary
Modifier and Type Field and Description
static int MODE_CAN_CONTINUE
          Constant that can be passed to setForwardNavigationMode to indicate that the Next button can be enabled if the problem string is null.
static int MODE_CAN_CONTINUE_OR_FINISH
          Constant that can be passed to setForwardNavigationMode to indicate that both the Finish and Next buttons can be enabled if the problem string is null.
static int MODE_CAN_FINISH
          Constant that can be passed to setForwardNavigationMode to indicate that the Finish button can be enabled if the problem string is null.
 
Method Summary
Modifier and Type Method and Description
 void setBusy(boolean busy)
          Indicate that some sort of background process is happening (presumably a progress bar is being shown to the user) which cannot be interrupted.
 void setForwardNavigationMode(int navigationMode)
          Set the forward navigation mode.
 void setProblem(java.lang.String value)
          Indicate that there is a problem with what the user has (or has not) input, such that the Next/Finish buttons should be disabled until the user has made some change.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODE_CAN_CONTINUE

public static final int MODE_CAN_CONTINUE
Constant that can be passed to setForwardNavigationMode to indicate that the Next button can be enabled if the problem string is null. Value is identical to the similarly named constant on Wizard.

See Also:
Constant Field Values

MODE_CAN_FINISH

public static final int MODE_CAN_FINISH
Constant that can be passed to setForwardNavigationMode to indicate that the Finish button can be enabled if the problem string is null. Value is identical to the similarly named constant on Wizard.

See Also:
Constant Field Values

MODE_CAN_CONTINUE_OR_FINISH

public static final int MODE_CAN_CONTINUE_OR_FINISH
Constant that can be passed to setForwardNavigationMode to indicate that both the Finish and Next buttons can be enabled if the problem string is null. This value is a bitmask - i.e. MODE_CAN_CONTINUE_OR_FINISH == MODE_CAN_CONTINUE | MODE_CAN_FINISH. Value is identical to the similarly named constant on Wizard.

See Also:
Constant Field Values
Method Detail

setProblem

public void setProblem(java.lang.String value)
Indicate that there is a problem with what the user has (or has not) input, such that the Next/Finish buttons should be disabled until the user has made some change.

If you want to disable the Next/Finish buttons, do that by calling this method with a short description of what is wrong.

Pass null to indicate there is no problem; non-null indicates there is a problem - the passed string should be a localized, human-readable description that assists the user in correcting the situation. It will be displayed in the UI.


setForwardNavigationMode

public void setForwardNavigationMode(int navigationMode)
Set the forward navigation mode. This method determines whether the Next button, the Finish button or both should be enabled if the problem string is set to null.

On panels where, based on the UI state, the only reasonable next step is to finish the wizard (even though there may be more panels if the UI is in a different state), set the navigation mode to MODE_CAN_FINISH, and the Finish button will be enabled, and the Next button not.

On panels where, based on the UI state, the user could either continue or complete the wizard at that point, set the navigation mode to MODE_CAN_CONTINUE_OR_FINISH.

If the finish button should not be enabled, set the navigation mode to MODE_CAN_CONTINUE. This is the default on any panel if no explicit call to setForwardNavigationMode() has been made.

Parameters:
navigationMode - Legal values are MODE_CAN_CONTINUE, MODE_CAN_FINISH or MODE_CAN_CONTINUE_OR_FINISH

setBusy

public void setBusy(boolean busy)
Indicate that some sort of background process is happening (presumably a progress bar is being shown to the user) which cannot be interrupted. Calling this menu disables all navigation and the ability to close the wizard dialog. Use this option with caution and liberal use of finally to reenable navigation.