Class MessageDialog

java.lang.Object
com.ben12.reta.view.control.MessageDialog

public final class MessageDialog extends Object
Author:
BenoƮt Moreau (ben.12)
  • Method Details

    • setDefaultParent

      public static void setDefaultParent(javafx.stage.Window newDefaultParent)
      Parameters:
      newDefaultParent - the defaultParent to set
    • showErrorMessage

      public static void showErrorMessage(javafx.stage.Window parent, String message)
      Parameters:
      parent - dialog parent, if null default parent is used
      message - Error message to show
    • showErrorMessage

      public static void showErrorMessage(javafx.stage.Window parent, String message, Throwable t)
      Parameters:
      parent - dialog parent, if null default parent is used
      message - Error message to show
      t - Throwable shown as details
    • showWarningMessage

      public static void showWarningMessage(javafx.stage.Window parent, String message)
      Parameters:
      parent - dialog parent, if null default parent is used
      message - Warning message to show
    • showConfirmationMessage

      public static boolean showConfirmationMessage(javafx.stage.Window parent, String message)
      Parameters:
      parent - dialog parent, if null default parent is used
      message - Confirmation message to show
      Returns:
      true if confirmed by "yes" option, false otherwise
    • showQuestionMessage

      public static boolean showQuestionMessage(javafx.stage.Window parent, String message)
      Parameters:
      parent - dialog parent, if null default parent is used
      message - Question message to show
      Returns:
      true if confirmed by "ok" option, false otherwise
    • showOptionsMessage

      @SafeVarargs public static <T> T showOptionsMessage(javafx.stage.Window parent, String message, T... choices)
      Type Parameters:
      T - choice type
      Parameters:
      parent - dialog parent, if null default parent is used
      message - Question message to show
      choices - possible choices
      Returns:
      selected choice or null if canceled
    • showOptionsMessage

      public static <T> T showOptionsMessage(javafx.stage.Window parent, String message, Collection<javafx.util.Pair<T,String>> choices)
      Type Parameters:
      T - choice type
      Parameters:
      parent - dialog parent, if null default parent is used
      message - Question message to show
      choices - possible choices where Pair value is the choice label displayed
      Returns:
      selected choice or null if canceled
    • showProgressBar

      public static void showProgressBar(javafx.stage.Window parent, String title, javafx.concurrent.Task<?> task)
      Parameters:
      parent - dialog parent, if null default parent is used
      title - dialog title
      task - progress task