Class ErrorDialog

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class ErrorDialog extends JDialog
Helper class to display detailed message about application error.
Version:
$Id$
See Also:
  • Method Details

    • showError

      public static void showError(Component parentComponent, String title, String message)
      Displays error dialogue to the user.
      Parameters:
      parentComponent - parent component, may be null
      title - window title
      message - error message
    • showError

      public static void showError(Component parentComponent, String title, String message, Object data)
      Displays error dialogue to the user.
      Parameters:
      parentComponent - parent component, may be null
      title - window title
      message - error message
      data - error data, collections and arrays are handled specially, all other objects are shown using toString() method
    • showError

      public static void showError(Component parentComponent, String title, Object data, Throwable error)
      Displays error dialogue to the user.
      Parameters:
      parentComponent - parent component, may be null
      title - window title
      data - error data, collections and arrays are handled specially, all other objects are shown using toString() method
      error - an error to be shown in details section
    • showError

      public static void showError(Component parentComponent, String title, Throwable error)
      Displays error dialogue to the user.
      Parameters:
      parentComponent - parent component, may be null
      title - window title
      error - an error to be shown in details section
    • showError

      public static void showError(Component parentComponent, String title, String message, Throwable error)
      Displays error dialogue to the user.
      Parameters:
      parentComponent - parent component, may be null
      title - window title
      message - error message
      error - an error to be shown in details section
    • showError

      public static void showError(Component parentComponent, String title, String message, Object data, Throwable error)
      Displays error dialogue to the user.
      Parameters:
      parentComponent - parent component, may be null
      title - window title
      message - error message
      data - error data, collections and arrays are handled specially, all other objects are shown using toString() method
      error - an error to be shown in details section
    • showWarning

      public static boolean showWarning(Component parentComponent, String title, String message)
      Displays error dialogue to the user and lets him to make a decision with "Yes" and "No" buttons. The question should be in the given message.
      Parameters:
      parentComponent - parent component, may be null
      title - window title
      message - error message
      Returns:
      true if user chooses "Yes" answer
    • showWarning

      public static boolean showWarning(Component parentComponent, String title, String message, Object data)
      Displays error dialogue to the user and lets him to make a decision with "Yes" and "No" buttons. The question should be in the given message.
      Parameters:
      parentComponent - parent component, may be null
      title - window title
      message - error message
      data - error data, collections and arrays are handled specially, all other objects are shown using toString() method
      Returns:
      true if user chooses "Yes" answer
    • showWarning

      public static boolean showWarning(Component parentComponent, String title, String message, Throwable error)
      Displays error dialogue to the user and lets him to make a decision with "Yes" and "No" buttons. The question should be in the given message.
      Parameters:
      parentComponent - parent component, may be null
      title - window title
      message - error message
      error - an error to be shown in details section
      Returns:
      true if user chooses "Yes" answer
    • showWarning

      public static boolean showWarning(Component parentComponent, String title, String message, Object data, Throwable error)
      Displays error dialogue to the user and lets him to make a decision with "Yes" and "No" buttons. The question should be in the given message.
      Parameters:
      parentComponent - parent component, may be null
      title - window title
      message - error message
      data - error data, collections and arrays are handled specially, all other objects are shown using toString() method
      error - an error to be shown in details section
      Returns:
      true if user chooses "Yes" answer
    • getErrorDetails

      public static String getErrorDetails(Throwable t)
      Utility method to get detailed error report.
      Parameters:
      t - exception instance, may be null
      Returns:
      detailed error message with most important system information included
    • printError

      public static void printError(Throwable t, String header, StringBuilder sb)
      Prints detailed stack trace to the given buffer.
      Parameters:
      t - exception instance, may be null
      header - stack trace caption
      sb - output text buffer