WizardContext (install4j API)
Description: declaration: package: com.install4j.api.context, interface: WizardContext

# Interface WizardContext

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

See Also:
  - `Context.getWizardContext()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `focusControlButton(ControlButtonType controlButtonType)`
  Transfer the focus to a particular control button.
  `void`
  `focusNextButton()`
  Deprecated.
  use `focusControlButton(ControlButtonType)` with `ControlButtonType.NEXT` instead
  `StyleManager`
  `getStyleManager()`
  Get the screen style manager.
  `void`
  `pressCancelButton()`
  Deprecated.
  use `pressControlButton(ControlButtonType)` with `ControlButtonType.CANCEL` instead
  `void`
  `pressControlButton(ControlButtonType controlButtonType)`
  Perform the action associated with a particular control button.
  `void`
  `pressNextButton()`
  Deprecated.
  use `pressControlButton(ControlButtonType)` with `ControlButtonType.NEXT` instead
  `void`
  `pressPreviousButton()`
  Deprecated.
  use `pressControlButton(ControlButtonType)` with `ControlButtonType.PREVIOUS` instead
  `void`
  `setBackButtonEnabled(boolean enabled)`
  Deprecated.
  use `setControlButtonEnabled(ControlButtonType, boolean)` with `ControlButtonType.PREVIOUS` instead
  `void`
  `setBackButtonVisible(boolean visible)`
  Deprecated.
  use `setControlButtonVisible(ControlButtonType, boolean)` with `ControlButtonType.PREVIOUS` instead
  `void`
  `setCancelButtonEnabled(boolean enabled)`
  Deprecated.
  use `setControlButtonEnabled(ControlButtonType, boolean)` with `ControlButtonType.CANCEL` instead
  `void`
  `setCancelButtonText(String text)`
  Deprecated.
  use `setControlButtonText(ControlButtonType, String)` with `ControlButtonType.CANCEL` instead
  `void`
  `setCancelButtonVisible(boolean visible)`
  Deprecated.
  use `setControlButtonVisible(ControlButtonType, boolean)` with `ControlButtonType.CANCEL` instead
  `void`
  `setControlButtonEnabled(ControlButtonType controlButtonType, boolean enabled)`
  Change the enabled status of control buttons on the current screen.
  `void`
  `setControlButtonText(ControlButtonType controlButtonType, String text)`
  Set the text of control buttons on the current screen.
  `void`
  `setControlButtonVisible(ControlButtonType controlButtonType, boolean visible)`
  Change the visibility of control buttons on the current screen.
  `void`
  `setNextButtonEnabled(boolean enabled)`
  Deprecated.
  use `setControlButtonEnabled(ControlButtonType, boolean)` with `ControlButtonType.NEXT` instead
  `void`
  `setNextButtonText(String text)`
  Deprecated.
  use `setControlButtonText(ControlButtonType, String)` with `ControlButtonType.NEXT` instead
  `void`
  `setNextButtonVisible(boolean visible)`
  Deprecated.
  use `setControlButtonVisible(ControlButtonType, boolean)` with `ControlButtonType.NEXT` instead
  `void`
  `setPreviousButtonText(String text)`
  Deprecated.
  use `setControlButtonText(ControlButtonType, String)` with `ControlButtonType.PREVIOUS` instead
  `void`
  `setWindowSize(int width, int height)`
  Sets the size of the application window.
  `void`
  `setWindowTitle(String title)`
  Sets the title of the application window.
  `void`
  `setWizardIndex(WizardIndex wizardIndex)`
  Install a wizard index on the left side of the window to show overall installation progress.
  `void`
  `setWizardIndexKey(String key)`
  Change the highlighted step in the currently installed wizard index.

- ## Method Details

  - ### setControlButtonEnabled

    void setControlButtonEnabled(ControlButtonType controlButtonType, boolean enabled)
    Change the enabled status of control buttons on the current screen. This setting applies only to the currently displayed screen.
    Parameters:
      `controlButtonType` - the type of the control buttons
      `enabled` - if the buttons should be enabled or not

  - ### setControlButtonVisible

    void setControlButtonVisible(ControlButtonType controlButtonType, boolean visible)
    Change the visibility of control buttons on the current screen. This setting applies only to the currently displayed screen.
    Parameters:
      `controlButtonType` - the type of the control buttons
      `visible` - if the buttons should be visible or not

  - ### pressControlButton

    void pressControlButton(ControlButtonType controlButtonType)
    Perform the action associated with a particular control button.
    Parameters:
      `controlButtonType` - the type of the control button

  - ### focusControlButton

    void focusControlButton(ControlButtonType controlButtonType)
    Transfer the focus to a particular control button. If there are multiple control buttons of the specified type, the first one will be used.
    Parameters:
      `controlButtonType` - the type of the control button

  - ### setControlButtonText

    void setControlButtonText(ControlButtonType controlButtonType, String text)
    Set the text of control buttons on the current screen. This setting applies only to the currently displayed screen.
    Parameters:
      `controlButtonType` - the type of the control buttons
      `text` - the new text

  - ### setNextButtonEnabled

    @Deprecated void setNextButtonEnabled(boolean enabled)
    Deprecated.
    use `setControlButtonEnabled(ControlButtonType, boolean)` with `ControlButtonType.NEXT` instead
    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

    @Deprecated void setBackButtonEnabled(boolean enabled)
    Deprecated.
    use `setControlButtonEnabled(ControlButtonType, boolean)` with `ControlButtonType.PREVIOUS` instead
    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

    @Deprecated void setCancelButtonEnabled(boolean enabled)
    Deprecated.
    use `setControlButtonEnabled(ControlButtonType, boolean)` with `ControlButtonType.CANCEL` instead
    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

    @Deprecated void setNextButtonVisible(boolean visible)
    Deprecated.
    use `setControlButtonVisible(ControlButtonType, boolean)` with `ControlButtonType.NEXT` instead
    Change the visibility of the "Next" button at the bottom of the current screen. This setting applies only to the currently displayed screen.
    Parameters:
      `visible` - if the button should be visible or not

  - ### setBackButtonVisible

    @Deprecated void setBackButtonVisible(boolean visible)
    Deprecated.
    use `setControlButtonVisible(ControlButtonType, boolean)` with `ControlButtonType.PREVIOUS` instead
    Change the visibility of the "Back" button at the bottom of the current screen. This setting applies only to the currently displayed screen.
    Parameters:
      `visible` - if the button should be visible or not

  - ### setCancelButtonVisible

    @Deprecated void setCancelButtonVisible(boolean visible)
    Deprecated.
    use `setControlButtonVisible(ControlButtonType, boolean)` with `ControlButtonType.CANCEL` instead
    Change the visibility of the "Cancel" button at the bottom of the current screen. This setting applies only to the currently displayed screen.
    Parameters:
      `visible` - if the button should be visible or not

  - ### pressNextButton

    @Deprecated void pressNextButton()
    Deprecated.
    use `pressControlButton(ControlButtonType)` with `ControlButtonType.NEXT` instead
    Move to the next screen. This has the same effect as if the user clicks on the Next button.

  - ### pressPreviousButton

    @Deprecated void pressPreviousButton()
    Deprecated.
    use `pressControlButton(ControlButtonType)` with `ControlButtonType.PREVIOUS` instead
    Move to the previous screen. This has the same effect as if the user clicks on the Back button.

  - ### pressCancelButton

    @Deprecated void pressCancelButton()
    Deprecated.
    use `pressControlButton(ControlButtonType)` with `ControlButtonType.CANCEL` instead
    Cancel the installer or uninstaller. This has the same effect as if the user clicks on the Cancel button.

  - ### focusNextButton

    @Deprecated void focusNextButton()
    Deprecated.
    use `focusControlButton(ControlButtonType)` with `ControlButtonType.NEXT` instead
    Transfer the focus to the Next button. This could be called in the "Post-activation" script of a screen.

  - ### setNextButtonText

    @Deprecated void setNextButtonText(String text)
    Deprecated.
    use `setControlButtonText(ControlButtonType, String)` with `ControlButtonType.NEXT` instead
    Set the text on the "Next" button.
    Parameters:
      `text` - the new text

  - ### setPreviousButtonText

    @Deprecated void setPreviousButtonText(String text)
    Deprecated.
    use `setControlButtonText(ControlButtonType, String)` with `ControlButtonType.PREVIOUS` instead
    Set the text on the "Previous" button.
    Parameters:
      `text` - the new text

  - ### setCancelButtonText

    @Deprecated void setCancelButtonText(String text)
    Deprecated.
    use `setControlButtonText(ControlButtonType, String)` with `ControlButtonType.CANCEL` instead
    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. It 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(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.

  - ### getStyleManager

    StyleManager getStyleManager()
    Get the screen style manager. This is useful if you need to nest screen styles or if you have to reference screen styles from screens or form components.
    Returns:
      the screen style manager

  - ### setWindowSize

    void setWindowSize(int width, int height)
    Sets the size of the application window. This can also be called before any window is shown.
    Parameters:
      `width` - the width of the window
      `height` - the height of the window

  - ### setWindowTitle

    void setWindowTitle(String title)
    Sets the title of the application window. This can also be called before any window is shown. For installer variables in the title, live binding will replace them whenever they change.
    Parameters:
      `title` - the title