public class Dialog
extends java.lang.Object
Modifier and Type | Class | Description |
---|---|---|
static class |
Dialog.CenterOption |
|
static class |
Dialog.OpalDialogType |
Types of opal dialog
|
Constructor | Description |
---|---|
Dialog() |
Constructor
|
Dialog(boolean resizable) |
Constructor
|
Dialog(org.eclipse.swt.widgets.Shell parent) |
Constructor
|
Dialog(org.eclipse.swt.widgets.Shell parent,
boolean resizable) |
Constructor
|
Modifier and Type | Method | Description |
---|---|---|
static java.lang.String |
ask(java.lang.String title,
java.lang.String text,
java.lang.String defaultValue) |
Create a dialog box that asks a question
|
static java.lang.String |
ask(org.eclipse.swt.widgets.Shell shell,
java.lang.String title,
java.lang.String text,
java.lang.String defaultValue) |
Create a dialog box that asks a question
|
static int |
choice(java.lang.String title,
java.lang.String text,
int defaultSelection,
ChoiceItem... items) |
Create a dialog box with a choice
|
static int |
choice(org.eclipse.swt.widgets.Shell shell,
java.lang.String title,
java.lang.String text,
int defaultSelection,
ChoiceItem... items) |
Create a dialog box with a choice
|
void |
close() |
Close the dialog box
|
static void |
error(java.lang.String title,
java.lang.String errorMessage) |
Create a dialog box that displays an error message
|
static void |
error(org.eclipse.swt.widgets.Shell shell,
java.lang.String title,
java.lang.String errorMessage) |
Create a dialog box that displays an error message
|
Dialog.OpalDialogType |
getButtonType() |
|
Dialog.CenterOption |
getCenterPolicy() |
|
boolean |
getCheckboxValue() |
|
FooterArea |
getFooterArea() |
|
MessageArea |
getMessageArea() |
|
int |
getMinimumHeight() |
|
int |
getMinimumWidth() |
|
int |
getSelectedButton() |
|
org.eclipse.swt.widgets.Shell |
getShell() |
|
java.lang.String |
getTitle() |
|
static void |
inform(java.lang.String title,
java.lang.String text) |
Create a dialog box that inform the user
|
static void |
inform(org.eclipse.swt.widgets.Shell shell,
java.lang.String title,
java.lang.String text) |
Create a dialog box that inform the user
|
static boolean |
isConfirmed(java.lang.String title,
java.lang.String text) |
Create a dialog box that asks the user a confirmation
|
static boolean |
isConfirmed(java.lang.String title,
java.lang.String text,
int timer) |
Create a dialog box that asks the user a confirmation.
|
static boolean |
isConfirmed(org.eclipse.swt.widgets.Shell shell,
java.lang.String title,
java.lang.String text) |
Create a dialog box that asks the user a confirmation
|
static boolean |
isConfirmed(org.eclipse.swt.widgets.Shell shell,
java.lang.String title,
java.lang.String text,
int timer) |
Create a dialog box that asks the user a confirmation.
|
static int |
radioChoice(java.lang.String title,
java.lang.String text,
int defaultSelection,
java.lang.String... values) |
Create a dialog box with a radio choice
|
static int |
radioChoice(org.eclipse.swt.widgets.Shell shell,
java.lang.String title,
java.lang.String text,
int defaultSelection,
java.lang.String... values) |
Create a dialog box with a radio choice
|
void |
setButtonType(Dialog.OpalDialogType buttonType) |
|
void |
setCenterPolicy(Dialog.CenterOption centerPolicy) |
|
void |
setMinimumHeight(int minimumHeight) |
|
void |
setMinimumWidth(int minimumWidth) |
|
void |
setTitle(java.lang.String title) |
|
int |
show() |
Show the dialog box
|
static void |
showException(java.lang.Throwable exception) |
Display a dialog box with an exception
|
public Dialog()
public Dialog(boolean resizable)
resizable
- if true
, the window is resizablepublic Dialog(org.eclipse.swt.widgets.Shell parent)
parent
- parent shellpublic Dialog(org.eclipse.swt.widgets.Shell parent, boolean resizable)
parent
- parent shellresizable
- if true
, the window is resizablepublic int show()
public void close()
public static java.lang.String ask(java.lang.String title, java.lang.String text, java.lang.String defaultValue)
title
- title of the dialog boxtext
- text of the questiondefaultValue
- default value of the inputpublic static java.lang.String ask(org.eclipse.swt.widgets.Shell shell, java.lang.String title, java.lang.String text, java.lang.String defaultValue)
title
- title of the dialog boxtext
- text of the questiondefaultValue
- default value of the inputpublic static void error(java.lang.String title, java.lang.String errorMessage)
title
- title of the dialog boxerrorMessage
- Error messagepublic static void error(org.eclipse.swt.widgets.Shell shell, java.lang.String title, java.lang.String errorMessage)
shell
- parent shelltitle
- title of the dialog boxerrorMessage
- Error messagepublic static void inform(java.lang.String title, java.lang.String text)
title
- title of the dialog boxtext
- text to displaypublic static void inform(org.eclipse.swt.widgets.Shell shell, java.lang.String title, java.lang.String text)
shell
- parent shelltitle
- title of the dialog boxtext
- text to displaypublic static boolean isConfirmed(java.lang.String title, java.lang.String text)
title
- title of the dialog boxtext
- text to displaytrue
if the user confirmed, false
otherwisepublic static boolean isConfirmed(org.eclipse.swt.widgets.Shell shell, java.lang.String title, java.lang.String text)
shell
- parent shelltitle
- title of the dialog boxtext
- text to displaytrue
if the user confirmed, false
otherwisepublic static boolean isConfirmed(java.lang.String title, java.lang.String text, int timer)
title
- title of the dialog boxtext
- text to displaytimer
- number of seconds before enabling the yes buttontrue
if the user confirmed, false
otherwisepublic static boolean isConfirmed(org.eclipse.swt.widgets.Shell shell, java.lang.String title, java.lang.String text, int timer)
shell
- parent shelltitle
- title of the dialog boxtext
- text to displaytimer
- number of seconds before enabling the yes buttontrue
if the user confirmed, false
otherwisepublic static int radioChoice(java.lang.String title, java.lang.String text, int defaultSelection, java.lang.String... values)
title
- title of the dialog boxtext
- text to displaydefaultSelection
- index of the default selectionvalues
- values to displaypublic static int radioChoice(org.eclipse.swt.widgets.Shell shell, java.lang.String title, java.lang.String text, int defaultSelection, java.lang.String... values)
shell
- parent shelltitle
- title of the dialog boxtext
- text to displaydefaultSelection
- index of the default selectionvalues
- values to displaypublic static void showException(java.lang.Throwable exception)
exception
- exception to displaypublic static int choice(java.lang.String title, java.lang.String text, int defaultSelection, ChoiceItem... items)
title
- title of the dialog boxtext
- text to displaydefaultSelection
- index of the default selectionitems
- items to displaypublic static int choice(org.eclipse.swt.widgets.Shell shell, java.lang.String title, java.lang.String text, int defaultSelection, ChoiceItem... items)
shell
- parent shelltitle
- title of the dialog boxtext
- text to displaydefaultSelection
- index of the default selectionitems
- items to displaypublic java.lang.String getTitle()
public void setTitle(java.lang.String title)
title
- the title to setpublic Dialog.OpalDialogType getButtonType()
public void setButtonType(Dialog.OpalDialogType buttonType)
buttonType
- the buttonType to setpublic MessageArea getMessageArea()
public FooterArea getFooterArea()
public org.eclipse.swt.widgets.Shell getShell()
public int getSelectedButton()
public boolean getCheckboxValue()
public int getMinimumWidth()
public void setMinimumWidth(int minimumWidth)
minimumWidth
- the minimum width of the dialog box to setpublic int getMinimumHeight()
public void setMinimumHeight(int minimumHeight)
minimumHeight
- the minimum height of the dialog box to setpublic Dialog.CenterOption getCenterPolicy()
public void setCenterPolicy(Dialog.CenterOption centerPolicy)
centerPolicy
- center policy