de.esprit.appsuite.gui.dialog

## Class ConfirmDialog

- 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.ConfirmDialog

- 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:
    ClientShutdownDialog, ServerShutdownDialog

      public class ConfirmDialog
      extends ToolDialog

  This dialog requests the user for a confirmation. It contains up to two multiline messages as well as a YES and NO button. You must use one of the static `confirm(...)` methods which create a `ConfirmDialog` for you. Each of them returns true or false depending on whether the user has confirmed or not.
  Note that the messages passed to the dialog are seen by the user and thus should be translated ones.
  Author:
    Rainer Buesch
  See Also:
    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` | `ConfirmDialog(boolean isWarning, java.lang.String msg1)`
    `protected` | `ConfirmDialog(boolean isWarning, java.lang.String msg1, java.lang.String msg2)`
    `protected` | `ConfirmDialog(java.awt.Window dialog, boolean isWarning, java.lang.String msg1)`
    `protected` | `ConfirmDialog(java.awt.Window hook, boolean isWarning, java.lang.String msg1, java.lang.String msg2)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `confirm(NlsKey msg1)`
    `static boolean` | `confirm(NlsKey msg1, NlsKey msg2)`
    `static boolean` | `confirm(java.lang.String msg1)` Pops up the dialog attached to the main-frame.
    `static boolean` | `confirm(java.lang.String msg1, NlsKey msg2)`
    `static boolean` | `confirm(java.lang.String msg1, java.lang.String msg2)` Pops up the dialog attached to the main-frame.
    `static boolean` | `confirm(java.awt.Window hook, NlsKey nls)`
    `static boolean` | `confirm(java.awt.Window hook, NlsKey msg1, NlsKey msg2)`
    `static boolean` | `confirm(java.awt.Window hook, java.lang.String msg)` Pops up a ConfirmDialog with the given message, which should already be translated.
    `static boolean` | `confirm(java.awt.Window hook, java.lang.String msg1, java.lang.String msg2)` Pops up a ConfirmDialog with the given messages, which should already be translated.
    `protected IconKey` | `createHeaderIcon()`
    `protected NlsKey` | `createHeaderText()`
    `protected void` | `doOnApply()` Should be overridden in order to provide an apply action
    `IconKey` | `getApplyButtonIcon()`
    `java.lang.String` | `getApplyButtonText()`
    `boolean` | `hasApplyButton()` Defines whether an Apply button should be displayed (default false).
    `boolean` | `hasCloseButton()` Defines whether a Close button should be displayed (default false).
    `protected boolean` | `isClosedOnApply()` Defines whether the dialog should be closed on apply - default is true
    `boolean` | `isConfirmed()`
    `protected boolean` | `isErrorAttachable()` This method defines whether error dialogs may attach to this dialog.
    `static boolean` | `warning(java.lang.String msg1)`
    `static boolean` | `warning(java.lang.String msg1, java.lang.String msg2)`
    `static boolean` | `warning(java.awt.Window hook, java.lang.String msg)`
    `static boolean` | `warning(java.awt.Window hook, java.lang.String msg1, java.lang.String msg2)`

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

      `addApplyListener, apply, cancel, clear, close, closeByIcon, createButtonPanel, createWindowAdapter, doOnApplyError, doOnCancel, doOnClose, doOnPopup, getApplicationContext, getApplier, getApplyAndCloseButton, getApplyButton, getButtonPanel, getCaller, getCancelButton, getClearButton, getCloseButton, getLogChannel, getPreferredWindowAlignment, getWindowAdapter, hasApplyAndCloseButton, hasButtonPanel, hasCancelButton, hasClearButton, isLogDebug, isLogVerbose, locate, 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

    - #### ConfirmDialog

          protected ConfirmDialog(java.awt.Window dialog,
                       boolean isWarning,
                       java.lang.String msg1)

    - #### ConfirmDialog

          protected ConfirmDialog(boolean isWarning,
                       java.lang.String msg1)

    - #### ConfirmDialog

          protected ConfirmDialog(boolean isWarning,
                       java.lang.String msg1,
                       java.lang.String msg2)

    - #### ConfirmDialog

          protected ConfirmDialog(java.awt.Window hook,
                       boolean isWarning,
                       java.lang.String msg1,
                       java.lang.String msg2)

  - ### Method Detail

    - #### createHeaderText

          protected NlsKey createHeaderText()

    - #### createHeaderIcon

          protected IconKey createHeaderIcon()

    - #### getApplyButtonText

          public java.lang.String getApplyButtonText()

    - #### getApplyButtonIcon

          public IconKey getApplyButtonIcon()

    - #### hasApplyButton

          public boolean hasApplyButton()

      Description copied from class: `ToolDialog`
      Defines whether an Apply button should be displayed (default false). Note that the Apply button just calls the apply() method.
      Overrides:
        `hasApplyButton` in class `ToolDialog`

    - #### hasCloseButton

          public 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`

    - #### 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.

    - #### doOnApply

          protected void doOnApply()
                            throws java.lang.Exception

      Description copied from class: `ToolDialog`
      Should be overridden in order to provide an apply action
      Overrides:
        `doOnApply` in class `ToolDialog`
      Throws:
        `java.lang.Exception`

    - #### isClosedOnApply

          protected boolean isClosedOnApply()

      Description copied from class: `ToolDialog`
      Defines whether the dialog should be closed on apply - default is true
      Overrides:
        `isClosedOnApply` in class `ToolDialog`

    - #### isConfirmed

          public final boolean isConfirmed()

    - #### confirm

          public static boolean confirm(java.awt.Window hook,
                        java.lang.String msg)

      Pops up a ConfirmDialog with the given message, which should already be translated. The hook reference must be either a JFrame or a JDialog instance.

    - #### confirm

          public static boolean confirm(java.awt.Window hook,
                        NlsKey nls)

    - #### confirm

          public static boolean confirm(java.awt.Window hook,
                        java.lang.String msg1,
                        java.lang.String msg2)

      Pops up a ConfirmDialog with the given messages, which should already be translated. The hook reference must be either a JFrame or a JDialog instance.

    - #### confirm

          public static boolean confirm(java.awt.Window hook,
                        NlsKey msg1,
                        NlsKey msg2)

    - #### confirm

          public static boolean confirm(java.lang.String msg1,
                        java.lang.String msg2)

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

    - #### confirm

          public static boolean confirm(NlsKey msg1,
                        NlsKey msg2)

    - #### confirm

          public static boolean confirm(java.lang.String msg1,
                        NlsKey msg2)

    - #### confirm

          public static boolean confirm(java.lang.String msg1)

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

    - #### confirm

          public static boolean confirm(NlsKey msg1)

    - #### warning

          public static boolean warning(java.awt.Window hook,
                        java.lang.String msg)

    - #### warning

          public static boolean warning(java.lang.String msg1)

    - #### warning

          public static boolean warning(java.lang.String msg1,
                        java.lang.String msg2)

    - #### warning

          public static boolean warning(java.awt.Window hook,
                        java.lang.String msg1,
                        java.lang.String msg2)

Copyright © 2014 EsprIT-Systems. All Rights Reserved.