de.esprit.appsuite.gui

## Class Gui

- java.lang.Object
- - de.esprit.appsuite.gui.Gui

-     public class Gui
      extends java.lang.Object

  This class contains global variables as well as static helper methods. Everything in this class is static.

  #### Frame/dialog management

  This class contains a `DialogManager` which stores a reference to the current window which is either a `ZDialog` or a `ZFrame`. This reference is used for hooking up `MessageDialog` or `ConfirmDialog` instances.

  #### Error dialog management

  The `DialogManager` also manages the automatic attachments of `MessageDialog`s for reporting error/warning/info messages. It provides a set of the show* methods for thread safe popping up of `MessageDialog`s.
  Note that errors may be thrown by classes that have no idea about GUI frames or dialogs and thus don't know where to attach the error dialog. A ZFrame or a ZDialog automatically becomes the current window if it has got the input focus.

  Note that neither of the message dialogs does any translation. So the programmer is responsible for translating the messages passed to them.

  Author:
    Rainer Buesch
  See Also:
    `ZFrame`, `ToolDialog`, `MessageDialog`, `ConfirmDialog`

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.awt.Window` | `getCurrentWindow()`
    `static DialogManager` | `getDialogManager()`
    `static javax.swing.JFrame` | `getMainFrame()`
    `static void` | `invokeLater(java.lang.Runnable r)` Delegates to the event dispatcher thread in a GUI environment but ensures that the event dispatcher thread is NOT called in a headless environment.
    `static void` | `popupFrame(ZFrame frame)` Thread-safe popup of the given frame
    `static void` | `popupRootFrame(java.awt.Component comp)` Thread-safe popup of the root frame in which this component resides
    `static void` | `resetCursor(java.awt.Window window)`
    `static java.awt.Window` | `setBusyCursor()`
    `static boolean` | `showError(java.lang.Object caller, java.lang.Exception e)`
    `static boolean` | `showError(java.lang.Object caller, java.lang.String message, java.lang.Exception e)`
    `static boolean` | `showError(java.lang.Object caller, java.lang.String message, java.lang.String details, java.lang.Exception e)`
    `static void` | `showInfo(java.lang.Object caller, java.lang.String message)`
    `static void` | `showInfo(java.lang.Object caller, java.lang.String message, java.lang.String details)`
    `static void` | `showText(java.lang.String text)` Thread-safe popup of a TextEditor which has the given text loaded
    `static void` | `showText(java.lang.String title, java.lang.String text)` Thread-safe popup of a `TextEditorFrame` which has the given text loaded
    `static void` | `showWarning(java.lang.Object caller, java.lang.String message)`
    `static void` | `showWarning(java.lang.Object caller, java.lang.String message, java.lang.String details)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getDialogManager

          public static DialogManager getDialogManager()

    - #### getCurrentWindow

          public static java.awt.Window getCurrentWindow()

    - #### getMainFrame

          public static javax.swing.JFrame getMainFrame()

    - #### setBusyCursor

          public static java.awt.Window setBusyCursor()

    - #### resetCursor

          public static void resetCursor(java.awt.Window window)

    - #### showInfo

          public static void showInfo(java.lang.Object caller,
                      java.lang.String message)

    - #### showInfo

          public static void showInfo(java.lang.Object caller,
                      java.lang.String message,
                      java.lang.String details)

    - #### showWarning

          public static void showWarning(java.lang.Object caller,
                         java.lang.String message)

    - #### showWarning

          public static void showWarning(java.lang.Object caller,
                         java.lang.String message,
                         java.lang.String details)

    - #### showError

          public static boolean showError(java.lang.Object caller,
                          java.lang.String message,
                          java.lang.Exception e)

    - #### showError

          public static boolean showError(java.lang.Object caller,
                          java.lang.String message,
                          java.lang.String details,
                          java.lang.Exception e)

    - #### showError

          public static boolean showError(java.lang.Object caller,
                          java.lang.Exception e)

    - #### popupFrame

          public static void popupFrame(ZFrame frame)

      Thread-safe popup of the given frame

    - #### popupRootFrame

          public static void popupRootFrame(java.awt.Component comp)

      Thread-safe popup of the root frame in which this component resides

    - #### showText

          public static void showText(java.lang.String text)

      Thread-safe popup of a TextEditor which has the given text loaded
      See Also:
        `showText(String, String)`

    - #### showText

          public static void showText(java.lang.String title,
                      java.lang.String text)

      Thread-safe popup of a `TextEditorFrame` which has the given text loaded
      Parameters:
        `title` - The title string in the text editor
        `text` - the text loaded in the `TextEditorFrame`

    - #### invokeLater

          public static void invokeLater(java.lang.Runnable r)

      Delegates to the event dispatcher thread in a GUI environment but ensures that the event dispatcher thread is NOT called in a headless environment.

Copyright © 2014 EsprIT-Systems. All Rights Reserved.