net.sourceforge.java.feednread.frontend.dialog
Class DialogUtils

java.lang.Object
  extended bynet.sourceforge.java.feednread.frontend.dialog.DialogUtils

public class DialogUtils
extends Object

Contains Dialog specific utility methods.

Author:
Sebastian Machhausen

Constructor Summary
DialogUtils()
           
 
Method Summary
static AutoCloseConfirmationDialog createAutoCloseConfirmDialog(Shell parentShell, String dialogTitle, String headerText, String headerSubText, String message, Image dialogImage, Image headerImage, int secondsToClose)
           Creates an AutoCloseConfirmationDialog instance which displays an information message along with a confirmation Button (OK) which closes itself after the time span as specified by secondsToClose if the end-user does not close the dialog before this time span elapses.
static MessageDialog createQuestionDialog(Shell parentShell, String title, String message, Image titleImage)
           Creates a question dialog.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DialogUtils

public DialogUtils()
Method Detail

createQuestionDialog

public static MessageDialog createQuestionDialog(Shell parentShell,
                                                 String title,
                                                 String message,
                                                 Image titleImage)

Creates a question dialog. Note that the dialog will have no visual representation (no widgets) until it is told to open. The open method will return either IDialogConstants.YES_ID if the question dialog was confirmed with YES, IDialogConstants.NO_ID if the dialog was left with NO or -1 if the dialog was dismissed without pressing a button(ESC, etc.). Note that the open method blocks.

Parameters:
parentShell - the parent shell
title - the dialog title, or null if none
message - the dialog message
titleImage - the dialog title image, or null if none
Returns:
the created MessageDialog

createAutoCloseConfirmDialog

public static AutoCloseConfirmationDialog createAutoCloseConfirmDialog(Shell parentShell,
                                                                       String dialogTitle,
                                                                       String headerText,
                                                                       String headerSubText,
                                                                       String message,
                                                                       Image dialogImage,
                                                                       Image headerImage,
                                                                       int secondsToClose)

Creates an AutoCloseConfirmationDialog instance which displays an information message along with a confirmation Button (OK) which closes itself after the time span as specified by secondsToClose if the end-user does not close the dialog before this time span elapses. The time begins to run once the open methods is called on the returned AutoCloseConfirmationDialog instance.

Parameters:
parentShell - the parent Shell or null if this AutoCloseConfirmationDialog should be created as top level Shell
dialogTitle - the dialog title
headerText - the header text
headerSubText - the accompanying text of the header
message - the message
dialogImage - the Image for the dialog
headerImage - the Image to display in the header
secondsToClose - the time in seconds after which this AutoCloseConfirmationDialog closes automatically