org.mailster.gui.utils
Class DialogUtils

java.lang.Object
  extended by org.mailster.gui.utils.DialogUtils

public class DialogUtils
extends java.lang.Object

Contains Dialog specific utility methods.

Author:
Sebastian Machhausen This file has been used and modified., Edouard De Oliveira

Constructor Summary
DialogUtils()
           
 
Method Summary
static void centerShellOnParentShell(org.eclipse.swt.widgets.Shell shell)
          Center a shell relatively to it's parent.
static void centerShellOnScreen(org.eclipse.swt.widgets.Shell shell)
          Center a shell on screen.
static org.eclipse.jface.dialogs.MessageDialog createQuestionDialog(org.eclipse.swt.widgets.Shell parentShell, java.lang.String title, java.lang.String message, org.eclipse.swt.graphics.Image titleImage)
          Creates a question dialog.
static void selectComboValue(org.eclipse.jface.viewers.ComboViewer viewer, java.lang.String key, org.eclipse.jface.preference.IPreferenceStore store)
           
 
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

centerShellOnScreen

public static void centerShellOnScreen(org.eclipse.swt.widgets.Shell shell)
Center a shell on screen.

Parameters:
shell - the shell to center on screen

centerShellOnParentShell

public static void centerShellOnParentShell(org.eclipse.swt.widgets.Shell shell)
Center a shell relatively to it's parent.

Parameters:
shell - the shell to center on screen

createQuestionDialog

public static org.eclipse.jface.dialogs.MessageDialog createQuestionDialog(org.eclipse.swt.widgets.Shell parentShell,
                                                                           java.lang.String title,
                                                                           java.lang.String message,
                                                                           org.eclipse.swt.graphics.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

selectComboValue

public static void selectComboValue(org.eclipse.jface.viewers.ComboViewer viewer,
                                    java.lang.String key,
                                    org.eclipse.jface.preference.IPreferenceStore store)