com.tensegrity.gui.swt.dialog
Class SWTYesNoDialog

java.lang.Object
  extended byorg.eclipse.swt.widgets.Dialog
      extended bycom.tensegrity.gui.swt.dialog.SWTYesNoDialog

public class SWTYesNoDialog
extends org.eclipse.swt.widgets.Dialog

A SWTYesNoDialog dialog contains an image, a description, optionally a "Do not show this dialog anymore" check box, a Yes and a No buttons.

By default the dialog will be created without the "Do not show this dialog anymore" check box unless it is created using the #SWTYesNoDialog(Shell, int, UIManager, String, String, boolean) constructor.

The method displayAgainNextTime() indicates whether or not the check box (if displayed) has been selected. In order to check which button has been pressed one can use the getResult() method which returns either SWT.YES or SWT.NO.

Version:
$Id: SWTYesNoDialog.java,v 1.1 2005/04/13 16:12:52 SebastienGuyon Exp $
Author:
S�bastien Guyon

Constructor Summary
SWTYesNoDialog(org.eclipse.swt.widgets.Shell parent, int style, UIManager uiManager, java.lang.String title, java.lang.String description, int imageType)
           Creates a basic SWTYesNoDialog without the check box asking the user if he wants to display this dialog the next time.
SWTYesNoDialog(org.eclipse.swt.widgets.Shell parent, int style, UIManager uiManager, java.lang.String title, java.lang.String description, int imageType, boolean showSkipMessage)
           Creates a SWTYesNoDialog with a check box asking the user if he wants to display this dialog the next time.
 
Method Summary
 boolean displayAgainNextTime()
           Indicates whether or not the user wants the dialog to be displayed the next time.
 int getResult()
           This method indicates which button has been pressed on the dialog.
 int open()
           This method open the dialog in a modal manner.
 
Methods inherited from class org.eclipse.swt.widgets.Dialog
checkSubclass, getParent, getStyle, getText, setText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SWTYesNoDialog

public SWTYesNoDialog(org.eclipse.swt.widgets.Shell parent,
                      int style,
                      UIManager uiManager,
                      java.lang.String title,
                      java.lang.String description,
                      int imageType)

Creates a basic SWTYesNoDialog without the check box asking the user if he wants to display this dialog the next time.

Parameters:
parent - a shell which will be the parent of the new instance
style - the style of control to construct
uiManager - the manager for localized strings
title - the dialog title
description - the confirmation text
imageType - One of

SWTYesNoDialog

public SWTYesNoDialog(org.eclipse.swt.widgets.Shell parent,
                      int style,
                      UIManager uiManager,
                      java.lang.String title,
                      java.lang.String description,
                      int imageType,
                      boolean showSkipMessage)

Creates a SWTYesNoDialog with a check box asking the user if he wants to display this dialog the next time.

Parameters:
parent - a shell which will be the parent of the new instance
style - the style of control to construct
uiManager - the manager for localized strings
title - the dialog title
description - the confirmation text
imageType - One of
showSkipMessage - if true a check box is displayed asking the user whether or not the dialog should be displayed the next time.
Method Detail

open

public int open()

This method open the dialog in a modal manner. It will be centered on top of its parent.

Returns:
SWT.NO or SWT.YES depending on which button has been pressed

displayAgainNextTime

public boolean displayAgainNextTime()

Indicates whether or not the user wants the dialog to be displayed the next time.

Returns:
true if the user wants the dialog to be displayed the next time, false otherwise.

getResult

public int getResult()

This method indicates which button has been pressed on the dialog. Notice that it only makes sense to call this method after the dialog has been displayed.

Returns:
SWT.NO or SWT.YES depending on which button has been pressed


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.