Interface DialogHandler

All Known Implementing Classes:
DialogHandlerAdapter

public interface DialogHandler
Specification for a component that handles native dialogs.

A dialog need not have a user-interface. For example, a login dialog could load credentials from a file or system properties and programmatically deal with the dialog.

Implementations should use MediaPlayerFactory.dialogs() to interact with the dialogs.

  • Method Details

    • displayError

      void displayError(Long userData, String title, String text)
      Present an error dialog.
      Parameters:
      userData - user data
      title - dialog title
      text - error text
    • displayLogin

      void displayLogin(Long userData, DialogId id, String title, String text, String defaultUsername, boolean askStore)
      Present a login dialog.
      Parameters:
      userData - user data
      id - dialog id, used to interact with this dialog
      title - dialog title
      text - login text
      defaultUsername - default username to display in the dialog
      askStore - if true, ask if the credentials should be stored
    • displayQuestion

      void displayQuestion(Long userData, DialogId id, String title, String text, DialogQuestionType type, String cancel, String action1, String action2)
      Present a question dialog.
      Parameters:
      userData - user data
      id - dialog id, used to interact with this dialog
      title - dialog title
      text - question text
      type - type of question
      cancel - cancel action text
      action1 - first action text
      action2 - second action text
    • displayProgress

      void displayProgress(Long userData, DialogId id, String title, String text, int indeterminate, float position, String cancel)
      Present a progress dialog.
      Parameters:
      userData - user data
      id - dialog id, used to interact with this dialog
      title - dialog title
      text - progress text
      indeterminate - true if the progress is indeterminate; false if it is not
      position - percent completion
      cancel - cancel action text
    • cancel

      void cancel(Long userData, DialogId id)
      Present a cancel dialog.
      Parameters:
      userData - user data
      id - dialog id, used to interact with this dialog
    • updateProgress

      void updateProgress(Long userData, DialogId id, float position, String text)
      Update a progress dialog.
      Parameters:
      userData - user data
      id - dialog id, used to interact with this dialog
      position - percent completion
      text - progress text