PasswordDialogHandle (install4j API)
Description: declaration: package: com.install4j.api.test.ui, interface: PasswordDialogHandle

# Interface PasswordDialogHandle

All Superinterfaces:
  `DialogHandle, UiContainer`

public interface PasswordDialogHandle extends DialogHandle
Typed handle for a password dialog.

The dialog has two modes: password-only and user-plus-password. The user methods only do something useful in the latter case, since the user text field is not laid out otherwise.

Reach this handle via `Session.passwordDialog()`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `cancel()`
  Cancel the dialog without submitting credentials.
  `void`
  `confirm()`
  Confirm the dialog.
  `String`
  `getPassword()`
  The plain-text password currently typed in the password field.
  `String`
  `getUser()`
  The username currently typed in the user field.
  `PasswordDialogHandle`
  `setPassword(String password)`
  Set the password.
  `PasswordDialogHandle`
  `setUser(String user)`
  Set the username.

  ### Methods inherited from interface DialogHandle

  `clickWindowClose, getTitle`

  ### Methods inherited from interface UiContainer

  `dumpAsString, saveScreenshot`

- ## Method Details

  - ### setUser

    @NotNull PasswordDialogHandle setUser(@NotNull String user)
    Set the username. Only meaningful in user-plus-password mode.

  - ### getUser

    @NotNull String getUser()
    The username currently typed in the user field.

  - ### setPassword

    @NotNull PasswordDialogHandle setPassword(@NotNull String password)
    Set the password.

  - ### getPassword

    @NotNull String getPassword()
    The plain-text password currently typed in the password field.

  - ### confirm

    void confirm()
    Confirm the dialog. The runtime then runs whatever validator the caller configured and either accepts the input or re-opens the dialog.

  - ### cancel

    void cancel()
    Cancel the dialog without submitting credentials.