MessageBox

Instances of this class are used to inform or warn the user. <dl> <dt><b>Styles:</b></dt> <dd>ICON_ERROR, ICON_INFORMATION, ICON_QUESTION, ICON_WARNING, ICON_WORKING</dd> <dd>OK, OK | CANCEL</dd> <dd>YES | NO, YES | NO | CANCEL</dd> <dd>RETRY | CANCEL</dd> <dd>ABORT | RETRY | IGNORE</dd> <dt><b>Events:</b></dt> <dd>(none)</dd> </dl> <p> Note: Only one of the styles ICON_ERROR, ICON_INFORMATION, ICON_QUESTION, ICON_WARNING and ICON_WORKING may be specified. </p><p> IMPORTANT: This class is intended to be subclassed <em>only</em> within the SWT implementation. </p>

@see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample, Dialog tab</a> @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>

Constructors

this
this(Shell parent)

Constructs a new instance of this class given only its parent.

this
this(Shell parent, int style)

Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. <p> The style value is either one of the style constants defined in class <code>SWT</code> which is applicable to instances of this class, or must be built by <em>bitwise OR</em>'ing together (that is, using the <code>int</code> "|" operator) two or more of those <code>SWT</code> style constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses.

this
this(int style)

SWT extension, a MessageBox with no parent

Members

Aliases

showInformation
alias showInformation = showInfo

SWT extension

Functions

getMessage
String getMessage()

Returns the dialog's message, or an empty string if it does not have one. The message is a description of the purpose for which the dialog was opened. This message will be visible in the dialog while it is open.

open
int open()

Makes the dialog visible and brings it to the front of the display.

setMessage
void setMessage(String string)

Sets the dialog's message, which is a description of the purpose for which it was opened. This message will be visible on the dialog while it is open.

Static functions

showError
int showError(String str, String title = null, Shell shell = null)

SWT extension

showInfo
int showInfo(String str, String title = null, Shell shell = null)

SWT extension

showMessageBox
int showMessageBox(String str, String title, Shell shell, int style)

SWT extension

showWarning
int showWarning(String str, String title = null, Shell shell = null)

SWT extension

Inherited Members

From Dialog

checkSubclass
void checkSubclass()

Checks that this class can be subclassed. <p> IMPORTANT: See the comment in <code>Widget.checkSubclass()</code>. </p>

checkParent
void checkParent(Shell parent)

Throws an exception if the specified widget can not be used as a parent for the receiver.

error
void error(int code)

Does whatever dialog specific cleanup is required, and then uses the code in <code>SWTError.error</code> to handle the error.

getParent
Shell getParent()

Returns the receiver's parent, which must be a <code>Shell</code> or null.

getStyle
int getStyle()

Returns the receiver's style information. <p> Note that, the value which is returned by this method <em>may not match</em> the value which was provided to the constructor when the receiver was created. </p>

getText
String getText()

Returns the receiver's text, which is the string that the window manager will typically display as the receiver's <em>title</em>. If the text has not previously been set, returns an empty string.

setText
void setText(String string)

Sets the receiver's text, which is the string that the window manager will typically display as the receiver's <em>title</em>, to the argument, which must not be null.

Meta