de.esprit.appsuite.gui.dialog

## Class MessageDialog

- java.lang.Object
- - java.awt.Component
  - - java.awt.Container
    - - java.awt.Window
      - - java.awt.Dialog
        - - javax.swing.JDialog
          - - de.esprit.common.gui.ZDialog
            - - de.esprit.appsuite.gui.ToolDialog
              - - de.esprit.appsuite.gui.dialog.MessageDialog

- All Implemented Interfaces:
    ApplicationToolWindow, ApplicationObject, Applieable, BorderLayoutConstants, Cancellable, Closeable, ToolWindow, SimpleLogSupport, Clearable, Dumpable, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants
  Direct Known Subclasses:
    ErrorDialog, InfoDialog, WarningDialog

      public class MessageDialog
      extends ToolDialog

  This dialog is used for most user notifications. It displays an error/warning/info header (icon and type-text), up to two multi-line messages and an exception argument whereas the exception message is printed in red color. It supports various error types as defined in the `ErrorType` interface.
  Note that this dialog can not be instantiated directly - use it's static creation methods - or even better: use the `Gui.showError(Object, Exception)`, `Gui.showWarning(Object, String)`, `Gui.showInfo(Object, String)` methods instead!
  The dialog has a built-in timer that automatically closes it after a default delay of 5 minutes. This is because error messages may tend to accumulate on the screen. The timer delay is defined by the `SysConfig.getErrorAutoCloseDelay()` property. A forced press (SHIFT or CNTRL) on the close button closes all open message dialogs.
  Note that the messages passed to the dialog should be translated ones. The MessageDialog itself does no translation at all.
  Author:
    Rainer Buesch
  See Also:
    `ErrorType`, `Gui`, Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class javax.swing.JDialog

      `javax.swing.JDialog.AccessibleJDialog`

    - ### Nested classes/interfaces inherited from class java.awt.Dialog

      `java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType`

    - ### Nested classes/interfaces inherited from class java.awt.Window

      `java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type`

    - ### Nested classes/interfaces inherited from class java.awt.Container

      `java.awt.Container.AccessibleAWTContainer`

    - ### Nested classes/interfaces inherited from class java.awt.Component

      `java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy`

  - ### Field Summary

    - ### Fields inherited from class javax.swing.JDialog

      `accessibleContext, rootPane, rootPaneCheckingEnabled`

    - ### Fields inherited from class java.awt.Dialog

      `DEFAULT_MODALITY_TYPE`

    - ### Fields inherited from class java.awt.Component

      `BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT`

    - ### Fields inherited from interface de.esprit.common.gui.comp.BorderLayoutConstants

      `CENTER, EAST, NORTH, SOUTH, WEST`

    - ### Fields inherited from interface javax.swing.WindowConstants

      `DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE`

    - ### Fields inherited from interface java.awt.image.ImageObserver

      `ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `MessageDialog(java.awt.Window hook, MessageDialogType msgType, java.lang.String message, java.lang.String details, java.lang.Exception error)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected javax.swing.Icon` | `createHeaderIcon(MessageDialogType msgType, ErrorType errType)`
    `protected java.lang.String` | `createHeaderText(MessageDialogType msgType, ErrorType errType)`
    `protected boolean` | `doOnClose()` Closes the dialog.
    `protected boolean` | `hasCloseButton()` Defines whether a Close button should be displayed (default false).
    `protected boolean` | `isErrorAttachable()` This method defines whether error dialogs may attach to this dialog.
    `protected void` | `locate()` Locates this dialog relative to its parent or, if specified relative to its calling component (usually a Button)
    `static void` | `popupMessageDialog(MessageDialogType msgType, java.lang.String message, java.lang.String details, java.lang.Exception e)` Pops up the error dialog attached to the main-frame.
    `static void` | `popupMessageDialog(java.awt.Window hook, MessageDialogType msgType, java.lang.String message, java.lang.String details, java.lang.Exception e)` Pops up the error dialog attached to the given window, which must be either a JFrame or a JDialog instance.

    - ### Methods inherited from class de.esprit.appsuite.gui.ToolDialog

      `addApplyListener, apply, cancel, clear, close, closeByIcon, createButtonPanel, createWindowAdapter, doOnApply, doOnApplyError, doOnCancel, doOnPopup, getApplicationContext, getApplier, getApplyAndCloseButton, getApplyButton, getButtonPanel, getCaller, getCancelButton, getClearButton, getCloseButton, getLogChannel, getPreferredWindowAlignment, getWindowAdapter, hasApplyAndCloseButton, hasApplyButton, hasButtonPanel, hasCancelButton, hasClearButton, isClosedOnApply, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, pack, popup, removeApplyListener, setDefaultButton, setLogChannel, setRelocateOnPopup, wasCancelled`

    - ### Methods inherited from class de.esprit.common.gui.ZDialog

      `dispose, getMinimumHeight, getMinimumWidth, isDisposeOnClose, isLocated, isPacked, registerSubDialog, repack, setLocation, setLocationRelativeTo, setLocationRelativeTo, setLocationToCenter, setTitle, setVisible, shiftLocation, toDumpString, toDumpString, toString, toString`

    - ### Methods inherited from class javax.swing.JDialog

      `addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update`

    - ### Methods inherited from class java.awt.Dialog

      `addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBack`

    - ### Methods inherited from class java.awt.Window

      `addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocationByPlatform, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront`

    - ### Methods inherited from class java.awt.Container

      `add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree`

    - ### Methods inherited from class java.awt.Component

      `action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle`

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

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

    - ### Methods inherited from interface de.esprit.appsuite.gui.ApplicationToolWindow

      `getRootPane`

    - ### Methods inherited from interface de.esprit.common.gui.ToolWindow

      `getLocation, getMinimumHeight, getMinimumWidth, getSize, getTitle, getToolkit, isPacked, setLocation, setLocationRelativeTo, setMinimumSize, setPreferredSize, shiftLocation`

    - ### Methods inherited from interface de.esprit.common.type.Dumpable

      `toDumpString, toDumpString, toString, toString`

- - ### Constructor Detail

    - #### MessageDialog

          protected MessageDialog(java.awt.Window hook,
                       MessageDialogType msgType,
                       java.lang.String message,
                       java.lang.String details,
                       java.lang.Exception error)

  - ### Method Detail

    - #### hasCloseButton

          protected boolean hasCloseButton()

      Description copied from class: `ToolDialog`
      Defines whether a Close button should be displayed (default false). Note that the Close button just calls the close() method.
      Overrides:
        `hasCloseButton` in class `ToolDialog`

    - #### locate

          protected void locate()

      Description copied from class: `ToolDialog`
      Locates this dialog relative to its parent or, if specified relative to its calling component (usually a Button)
      Overrides:
        `locate` in class `ToolDialog`

    - #### createHeaderIcon

          protected javax.swing.Icon createHeaderIcon(MessageDialogType msgType,
                                          ErrorType errType)

    - #### createHeaderText

          protected java.lang.String createHeaderText(MessageDialogType msgType,
                                          ErrorType errType)

    - #### isErrorAttachable

          protected final boolean isErrorAttachable()

      Description copied from class: `ZDialog`
      This method defines whether error dialogs may attach to this dialog.
      Overrides:
        `isErrorAttachable` in class `ZDialog`
      Returns:
        true by default.

    - #### doOnClose

          protected boolean doOnClose()
                               throws java.lang.Exception

      Closes the dialog.
      Overrides:
        `doOnClose` in class `ToolDialog`
      Returns:
        true by default.
      Throws:
        `java.lang.Exception`

    - #### popupMessageDialog

          public static void popupMessageDialog(MessageDialogType msgType,
                                java.lang.String message,
                                java.lang.String details,
                                java.lang.Exception e)

      Pops up the error dialog attached to the main-frame. If there is no main-frame, the current frame is used.

    - #### popupMessageDialog

          public static void popupMessageDialog(java.awt.Window hook,
                                MessageDialogType msgType,
                                java.lang.String message,
                                java.lang.String details,
                                java.lang.Exception e)

      Pops up the error dialog attached to the given window, which must be either a JFrame or a JDialog instance.

Copyright © 2014 EsprIT-Systems. All Rights Reserved.