Class FWMessageDialog

All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, Runnable, EventListener, Accessible, RootPaneContainer, WindowConstants

public final class FWMessageDialog extends JDialog implements ActionListener, Runnable
This class serves as replacement for the JOptionpane.
See Also:
  • Field Details

    • INFO_ICON

      public static final Icon INFO_ICON
      Icon for InfoDialogs.
    • QUESTION_ICON

      public static final Icon QUESTION_ICON
      Icon for QuestionDialogs.
    • CONFIRM_ICON

      public static final Icon CONFIRM_ICON
      Icon for ConfirmDialogs.
    • WARNING_ICON

      public static final Icon WARNING_ICON
      Icon for WarningDialogs.
    • EXCEPTION_ICON

      public static final Icon EXCEPTION_ICON
      Icon for ThrowableDialogs.
    • PROGRESS_ICON

      public static final Icon PROGRESS_ICON
      Icon for InfoDialogs.
    • QUESTION_TITLE

      public static final String QUESTION_TITLE
      Title for questions.
    • WARNING_TITLE

      public static final String WARNING_TITLE
      Title for warnings.
    • PROGRESS_TITLE

      public static final String PROGRESS_TITLE
      Title for warnings.
    • AUTODISPOSE_INFINITE_WAITING_TIME

      public static final int AUTODISPOSE_INFINITE_WAITING_TIME
      Infinite waiting time for the autodispose-messagepane.
      See Also:
    • QUESTION_YES

      public static final int QUESTION_YES
      Represents a possitive answer to a question.
      See Also:
    • QUESTION_NO

      public static final int QUESTION_NO
      Represents a negative answer to a question.
      See Also:
    • QUESTION_CANCEL

      public static final int QUESTION_CANCEL
      Represents a break to a question.
      See Also:
    • CONFIRM_OK

      public static final int CONFIRM_OK
      Represents a possitive confirm.
      See Also:
    • CONFIRM_CANCEL

      public static final int CONFIRM_CANCEL
      Represents a negative confirm.
      See Also:
    • QUESTION_MESSAGE

      public static final int QUESTION_MESSAGE
      Represents a possitive answer to a question.
      See Also:
    • INFO_MESSAGE

      public static final int INFO_MESSAGE
      Represents a negative answer to a question.
      See Also:
    • SEND_EMAIL

      public static final int SEND_EMAIL
      Represents a email send option.
      See Also:
    • FILE_CHOOSER_MULTISELECT

      public static final int FILE_CHOOSER_MULTISELECT
      Represents File Chooser with selection option.
      See Also:
    • FILE_CHOOSER_SELECT

      public static final int FILE_CHOOSER_SELECT
      Represents File Chooser to select or give File Name option.
      See Also:
    • FILE_CHOOSER_DIR

      public static final int FILE_CHOOSER_DIR
      Represents File chooser to select existing directory option.
      See Also:
    • FILE_CHOOSER_EXISTING

      public static final int FILE_CHOOSER_EXISTING
      Represents File chooser to select existing file option.
      See Also:
  • Method Details

    • pack

      public void pack()
      Overrides java.awt.Window to recognize minimum-size.
      Overrides:
      pack in class Window
    • actionPerformed

      public void actionPerformed(ActionEvent aActionEvent)
      Is called after one of the button is pressed.
      Specified by:
      actionPerformed in interface ActionListener
    • showOptionPaneDialog

      public static int showOptionPaneDialog(Window aParent, String aMessage, String aTitle, int aIconType, int aButtonType)
      Parameters:
      aParent -
      aMessage -
      aTitle -
      aIconType -
      aButtonType -
      Returns:
      int representing the choice user has done.
    • showCustomDialog

      public static int showCustomDialog(Window aParent, String aTitle, Icon aIcon, String aMessage, String[] aButtonCaptions)
      Shows a dialog with the custom settings.
      Parameters:
      aParent -
      aTitle -
      aIcon -
      aMessage -
      aButtonCaptions -
      Returns:
      index of the clicked Button
    • showCustomDialog

      public static int showCustomDialog(Window aParent, String aTitle, Icon aIcon, String aMessage, int aDefaultButtonIndex)
      Shows a dialog with the custom settings.
      Parameters:
      aParent -
      aTitle -
      aIcon -
      aMessage -
      aDefaultButtonIndex -
      Returns:
      index of the clicked Button
    • showInfoDialog

      public static void showInfoDialog(Window aParent, String aInfo)
      Shows a simple infopanel.
      Parameters:
      aParent -
      aInfo -
    • showInfoDialog

      public static void showInfoDialog(Window aParent, String aInfo, String aMessageID)
      Shows a simple infopanel.
      Parameters:
      aParent -
      aInfo -
      aMessageID -
    • showAutodisposeInfoDialog

      public static void showAutodisposeInfoDialog(Window aParent, String aInfo, int aAutodisposeWaitingTime)
      Shows a simple infopanel.
      Parameters:
      aParent -
      aInfo -
      aAutodisposeWaitingTime -
    • showInfoDialog

      public static void showInfoDialog(Window aParent, String aInfo, int aAutodisposeWaitingTime, String aMessageID)
      Shows a simple infopanel.
      Parameters:
      aParent -
      aInfo -
      aAutodisposeWaitingTime -
      aMessageID -
    • showInputDialogWithoutCancelButton

      public static String showInputDialogWithoutCancelButton(Window aParent, String aTitle, String aInfo)
      Shows a simple input panel.
      Parameters:
      aParent -
      aTitle -
      aInfo -
      Returns:
      the input dialog result
    • showInputDialog

      public static String showInputDialog(Window aParent, String aTitle, String aInfo)
      Shows a simple input panel.
      Parameters:
      aParent -
      aTitle -
      aInfo -
      Returns:
      the input dialog result
    • showInputDialog

      public static String showInputDialog(Window aParent, String aTitle, String aInfo, Icon aIcon)
      Shows a simple input panel.
      Parameters:
      aParent -
      aTitle -
      aInfo -
      aIcon -
      Returns:
      the input dialog result
    • showInputDialog

      public static String showInputDialog(Window aParent, String aTitle, String aInfo, boolean aPasswordField)
      Shows a simple input panel.
      Parameters:
      aParent -
      aTitle -
      aInfo -
      aPasswordField -
      Returns:
      the input dialog result
    • showInputDialog

      public static String showInputDialog(Window aParent, String aTitle, String aInfo, String aDefaultValue)
      Shows a simple input panel.
      Parameters:
      aParent -
      aTitle -
      aInfo -
      aDefaultValue -
      Returns:
      the input dialog result
    • showInputDialog

      public static String showInputDialog(Window aParent, String aTitle, String aInfo, String aDefaultValue, boolean aPasswordField)
      Shows a simple input panel.
      Parameters:
      aParent -
      aTitle -
      aInfo -
      aDefaultValue -
      aPasswordField -
      Returns:
      the input dialog result
    • showInputDialog

      public static String showInputDialog(Window aParent, String aTitle, String aInfo, String aDefaultValue, boolean aPasswordField, boolean aShowCancelButton)
      Shows a simple input panel.
      Parameters:
      aParent -
      aTitle -
      aInfo -
      aDefaultValue -
      aPasswordField -
      aShowCancelButton -
      Returns:
      the input dialog result
    • showInputDialog

      public static String showInputDialog(Window aParent, String aTitle, String aInfo, String aDefaultValue, boolean aPasswordField, boolean aShowCancelButton, Icon aIcon)
      Shows a simple input panel.
      Parameters:
      aParent -
      aTitle -
      aInfo -
      aDefaultValue -
      aPasswordField -
      aShowCancelButton -
      aIcon -
      Returns:
      the input dialog result
    • showFileChooserDialog

      public static String showFileChooserDialog(Window aParent, String aTitle, String aInfo, String aDefaultValue, Integer aFileChooserOption)
      Shows a simple input panel.
      Parameters:
      aParent -
      aTitle -
      aInfo -
      aDefaultValue -
      aFileChooserOption -
      Returns:
      the input dialog result
    • showChooserDialog

      public static Object showChooserDialog(Window aParent, String aTitle, String aInfo, Collection<Object> aValueCollection)
      Shows a simple input panel.
      Parameters:
      aParent -
      aTitle -
      aInfo -
      aValueCollection -
      Returns:
      the input dialog result
    • showChooserDialog

      public static Object showChooserDialog(Window aParent, String aTitle, String aInfo, Collection<Object> aValueCollection, Object aDefaultValue)
      Shows a simple input panel.
      Parameters:
      aParent -
      aTitle -
      aInfo -
      aValueCollection -
      aDefaultValue -
      Returns:
      the input dialog result
    • showDoubleChooserDialog

      public static Object[] showDoubleChooserDialog(Window aParent, String aTitle, String aInfo, Collection aSourceValueCollection, Collection aTargetValueCollection)
      Parameters:
      aParent -
      aTitle -
      aInfo -
      aSourceValueCollection -
      aTargetValueCollection -
      Returns:
      the 2 selected values or null if cancel was pressed
    • showQuestionDialog

      public static int showQuestionDialog(Window aParent, String aQuestion, boolean aShowCancel)
      Shows a dialog, which asks the user to press either yes, no and perhaps cancel.
      Parameters:
      aParent -
      aQuestion -
      aShowCancel -
      Returns:
      int representing the choice user has done.
    • showQuestionDialog

      public static int showQuestionDialog(Window aParent, String aQuestion, boolean aShowCancel, int aDefaultButtonIndex)
      Shows a dialog, whichs ask the user to press either yes, no and perhaps cancel.
      Parameters:
      aParent -
      aQuestion -
      aShowCancel -
      aDefaultButtonIndex -
      Returns:
      int representing the choice user has done.
    • showOptionDialog

      public static int showOptionDialog(Window aParent, String aMessage, String[] aOptions, int aMessageType)
      Shows a dialog, which asks the user to press either yes, no and perhaps cancel.
      Parameters:
      aParent -
      aMessage -
      aOptions -
      aMessageType -
      Returns:
      int representing the choice user has done.
    • showFormDialog

      public static FWObservable showFormDialog(Window aParent, String aTitle, String aInfo, org.jdom2.Element aFormElement, FWObservable aObservable, boolean aShowCancelButton)
      Parameters:
      aParent -
      aTitle -
      aInfo -
      aFormElement -
      aObservable -
      aShowCancelButton -
      Returns:
      the given Observable
    • showQuestionDialog

      public static int showQuestionDialog(Window aParent, String aLocaleBundle, String aLocaleKey, boolean aShowCancel)
      Shows a dialog, which asks the user to press either yes, no and perhaps cancel.
      Parameters:
      aParent -
      aLocaleBundle -
      aLocaleKey -
      aShowCancel -
      Returns:
      int representing the choice user has done.
    • showQuestionDialog

      public static int showQuestionDialog(Window aParent, String aMessage)
      Shows a dialog, whichs ask the user to press either yes, no.
      Parameters:
      aParent -
      aMessage -
      Returns:
      int representing the choice user has done.
    • showQuestionDialog

      public static int showQuestionDialog(Window aParent, String aLocaleBundle, String aLocaleKey)
      Shows a dialog, whichs ask the user to press either yes, no.
      Parameters:
      aParent -
      aLocaleBundle -
      aLocaleKey -
      Returns:
      int representing the choice user has done.
    • showConfirmDialog

      public static int showConfirmDialog(Window aParent, String aMessage)
      Shows a dialog which asks the user to either confirm or break a process;
      Parameters:
      aParent -
      aMessage -
      Returns:
      int representing the choice user has done.
    • showConfirmDialog

      public static int showConfirmDialog(Window aParent, String aMessage, String aMessageID)
      Shows a dialog which asks the user to either confirm or break a process;
      Parameters:
      aParent -
      aMessage -
      aMessageID -
      Returns:
      int representing the choice user has done.
    • showWarningQuestion

      public static int showWarningQuestion(Window aParent, String aQuestion)
      Shows a dialog which asks the user with warning him/her of the importance.
      Parameters:
      aParent -
      aQuestion -
      Returns:
      int representing the choice user has done.
    • showWarningQuestion

      public static int showWarningQuestion(Window aParent, String aQuestion, int aDefaultButtonIndex)
      Shows a dialog which asks the user with warning him/her of the importance.
      Parameters:
      aParent - The parent window
      aQuestion - Question to pose
      aDefaultButtonIndex - 1=NO , 0=YES, -1=DefaultSettings
      Returns:
      int representing the choice user has done.
    • showWarningDialog

      public static void showWarningDialog(Window aParent, String aWarning, Throwable aThrowable)
      Shows a dialog which warns user of a minor Throwable.
      Parameters:
      aParent -
      aWarning -
      aThrowable -
    • showWarningDialog

      public static void showWarningDialog(Window aParent, String aWarning, String aMessageID, Throwable aThrowable)
      Shows a dialog which warns user of a minor Throwable.
      Parameters:
      aParent -
      aWarning -
      aMessageID -
      aThrowable -
    • showWarningDialog

      public static void showWarningDialog(Window aParent, String aWarning)
      Shows a dialog which warns user of something.
      Parameters:
      aParent -
      aWarning -
    • showWarningDialog

      public static void showWarningDialog(Window aParent, String aLocaleBundle, String aLocaleKey)
      Shows a dialog which warns user of something.
      Parameters:
      aParent -
      aLocaleBundle -
      aLocaleKey -
    • showExceptionDialog

      public static void showExceptionDialog(Window aParent, String aMessage, Throwable aThrowable)
      Shows a dialog, which warns the user, that a Throwable has happened.
      Parameters:
      aParent -
      aMessage -
      aThrowable -
    • showEmailExceptionDialog

      public static int showEmailExceptionDialog(Window aParent, String aMessage, Throwable aThrowable)
      Shows a dialog, which warns the user, that a Throwable has happened and also the Email functionality button. This should be used if a functionality is implemented for email sending.
      Parameters:
      aParent -
      aMessage -
      aThrowable -
      Returns:
      int representing the choice user has done.
    • showExceptionDialog

      public static void showExceptionDialog(Window aParent, String aLocaleBundle, String aLocaleKey, Throwable aThrowable)
      Shows a dialog, which warns the user, that a Throwable has happened.
      Parameters:
      aParent -
      aLocaleBundle -
      aLocaleKey -
      aThrowable -
    • run

      public void run()
      Waits the autodispose time and closes the dialog, if it isn`t closed manually in the given time.
      Specified by:
      run in interface Runnable
    • showMessage

      public static void showMessage(Window aWindow, FWMessage aMessage)
      Displays the given Message object.
      Parameters:
      aWindow -
      aMessage -