WizardContext (install4j help)
Date: 2010-09-29

## install4j API documentation

## com.install4j.api.context
Interface WizardContext

    public interface WizardContext

The wizard context allows you to modify the GUI installer or uninstaller. It is returned by `Context.getWizardContext()` and is only functional if the installer or uninstaller is running in GUI mode.

Author:
  ej-technologies GmbH
See Also:
  `Context.getWizardContext()`

Method Summary
`void` | `focusNextButton()` Transfer the focus the Next button.
`void` | `pressCancelButton()` Cancel the installer or uninstaller.
`void` | `pressNextButton()` Move to the next screen.
`void` | `pressPreviousButton()` Move to the previous screen.
`void` | `setBackButtonEnabled(boolean enabled)` Change the enabled status of the "Back" button at the bottom of the current screen.
`void` | `setBackButtonVisible(boolean enabled)` Change the visibility of the "Back" button at the bottom of the current screen.
`void` | `setCancelButtonEnabled(boolean enabled)` Change the enabled status of the "Cancel" button at the bottom of the current screen.
`void` | `setCancelButtonText(java.lang.String text)` Set the text on the "Cancel" button.
`void` | `setCancelButtonVisible(boolean enabled)` Change the visibility of the "Cancel" button at the bottom of the current screen.
`void` | `setNextButtonEnabled(boolean enabled)` Change the enabled status of the "Next" button at the bottom of the current screen.
`void` | `setNextButtonText(java.lang.String text)` Set the text on the "Next" button.
`void` | `setNextButtonVisible(boolean enabled)` Change the visibility of the "Next" button at the bottom of the current screen.
`void` | `setPreviousButtonText(java.lang.String text)` Set the text on the "Previous" button.
`void` | `setWizardIndex(WizardIndex wizardIndex)` Install a wizard index on the left side of the window to show overall installation progress.
`void` | `setWizardIndexKey(java.lang.String key)` Change the highlighted step in the currently installed wizard index.

Method Detail

### setNextButtonEnabled

    void setNextButtonEnabled(boolean enabled)

  Change the enabled status of the "Next" button at the bottom of the current screen. This setting applies only to the currently displayed screen.

  Parameters:
    `enabled` - if the button should be enabled or not

### setBackButtonEnabled

    void setBackButtonEnabled(boolean enabled)

  Change the enabled status of the "Back" button at the bottom of the current screen. This setting applies only to the currently displayed screen.

  Parameters:
    `enabled` - if the button should be enabled or not

### setCancelButtonEnabled

    void setCancelButtonEnabled(boolean enabled)

  Change the enabled status of the "Cancel" button at the bottom of the current screen. This setting applies only to the currently displayed screen.

  Parameters:
    `enabled` - if the button should be enabled or not

### setNextButtonVisible

    void setNextButtonVisible(boolean enabled)

  Change the visibility of the "Next" button at the bottom of the current screen. This setting applies only to the currently displayed screen.

  Parameters:
    `enabled` - if the button should be enabled or not

### setBackButtonVisible

    void setBackButtonVisible(boolean enabled)

  Change the visibility of the "Back" button at the bottom of the current screen. This setting applies only to the currently displayed screen.

  Parameters:
    `enabled` - if the button should be enabled or not

### setCancelButtonVisible

    void setCancelButtonVisible(boolean enabled)

  Change the visibility of the "Cancel" button at the bottom of the current screen. This setting applies only to the currently displayed screen.

  Parameters:
    `enabled` - if the button should be enabled or not

### pressNextButton

    void pressNextButton()

  Move to the next screen. This has the same effect as if the user clicks on the Next button.

### pressPreviousButton

    void pressPreviousButton()

  Move to the previous screen. This has the same effect as if the user clicks on the Back button.

### pressCancelButton

    void pressCancelButton()

  Cancel the installer or uninstaller. This has the same effect as if the user clicks on the Cancel button.

### focusNextButton

    void focusNextButton()

  Transfer the focus the Next button. This could be called in the "Post-activation" script of a screen.

### setNextButtonText

    void setNextButtonText(java.lang.String text)

  Set the text on the "Next" button.

  Parameters:
    `text` - the new text

### setPreviousButtonText

    void setPreviousButtonText(java.lang.String text)

  Set the text on the "Previous" button.

  Parameters:
    `text` - the new text

### setCancelButtonText

    void setCancelButtonText(java.lang.String text)

  Set the text on the "Cancel" button.

  Parameters:
    `text` - the new text

### setWizardIndex

    void setWizardIndex(WizardIndex wizardIndex)

  Install a wizard index on the left side of the window to show overall installation progress. See `WizardIndex` for more information. The first step in the wizard index will be highlighted immediately. This setting is not restricted to the current screen, it remains active for subsequent screens.

  Note that a wizard index will not be shown on banner screens or on custom screens that return `false` in `Screen.isShowIndex()`. Is is suggested to increase the window width of your installer, if you use wizard indices.

  Parameters:
    `wizardIndex` - the new wizard index or `null` if the current wizard index should be removed.

### setWizardIndexKey

    void setWizardIndexKey(java.lang.String key)

  Change the highlighted step in the currently installed wizard index. If no wizard index is set, this has no effect.

  Parameters:
    `key` - the index key of the step that should be highlighted. If the key cannot be found in the current wizard index, no step will be highlighted.