|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.swt.widgets.Dialog org.eclipse.ercp.swt.mobile.QueryDialog
A modal window used to prompt the end-user for data input.
A QueryDialog contains a prompt text and an entry field. The QueryDialog supports five types of entry fields: STANDARD, NUMERIC, PASSWORD, TIME and DATE. The position and size of the dialog is implementation-dependent.
Note: When the style is either DATE or TIME, the date or time input is locale specific. User entered data is constrained to a valid date or time and is converted to an ISO 8601 string format to be returned from open().
Example:
QueryDialog dialog = new QueryDialog(shell, SWT.NONE, QueryDialog.STANDARD);
dialog.setPromptText("Enter name:", "game1");
String gameName = dialog.open();
if (gameName != null) {
// OK
// do something
} else {
// Cancelled
// do something else
}
IMPORTANT: This class is not intended to be subclassed.
Field Summary | |
static int |
DATE
Date entry type. |
static int |
NUMERIC
Numerical data entry type. |
static int |
PASSWORD
Password entry type. |
static int |
STANDARD
Alphanumeric data entry type |
static int |
TIME
Time entry type. |
Constructor Summary | |
QueryDialog(Shell parent)
Constructs a new instance of this class given its parent. |
|
QueryDialog(Shell parent,
int style)
Constructs a new instance of this class given its parent and style . |
|
QueryDialog(Shell parent,
int style,
int queryType)
Constructs a new instance of this class given its parent, style and query type. |
Method Summary | |
java.lang.String |
open()
Creates the prompt dialog in front of its parent shell and waits for input. |
void |
setMaximum(int maximum)
Defines the maximum number of characters that can be entered. |
void |
setMinimum(int minimum)
Defines the minimum number of characters that must be entered before the dialog can be completed (not cancelled). |
void |
setPromptText(java.lang.String promptText,
java.lang.String defaultValue)
Sets the prompt text and default input value. |
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 |
Field Detail |
public static final int STANDARD
public static final int PASSWORD
public static final int NUMERIC
public static final int TIME
public static final int DATE
Constructor Detail |
public QueryDialog(Shell parent)
By default, APPLICATION_MODAL style and STANDARD query type is used.
parent
- a shell which will be the parent of the new instance
java.lang.IllegalArgumentException
- SWTException
- QueryDialog(Shell, int, int)
public QueryDialog(Shell parent, int style)
The style value is either one of the style constants defined in class
Dialog
. By default STANDARD query type is used.
parent
- a shell which will be the parent of the new instancestyle
- the style of control to construct
java.lang.IllegalArgumentException
- SWTException
- SWT.APPLICATION_MODAL
,
SWT.PRIMARY_MODAL
,
QueryDialog(Shell, int, int)
public QueryDialog(Shell parent, int style, int queryType)
The style value is either one of the style constants defined in class
Dialog
.
parent
- a shell which will be the parent of the new instancestyle
- the style of control to constructqueryType
- one of STANDARD, NUMERIC, PASSWORD, TIME, or DATE.
java.lang.IllegalArgumentException
- SWTException
- SWT.APPLICATION_MODAL
,
SWT.PRIMARY_MODAL
,
STANDARD
,
PASSWORD
,
NUMERIC
,
TIME
,
DATE
Method Detail |
public java.lang.String open()
SWTException
- public void setMaximum(int maximum)
maximum
- the maximum character length. Must be equal or greater than
zero. Zero means no limit.
java.lang.IllegalArgumentException
- setMinimum(int)
.Text.LIMIT
SWTException
- setMinimum(int)
public void setMinimum(int minimum)
minimum
- the minimum number of characters. Must be equal or greater than
zero. Zero means no limit.
java.lang.IllegalArgumentException
- setMaximum(int)
.SWTException
- setMaximum(int)
public void setPromptText(java.lang.String promptText, java.lang.String defaultValue)
promptText
- the prompt text. Can be null.defaultValue
- the initial value. Cannot be null. The open()
method may return the same value even when no input is
received from the end-user. If the value length is greater than
the maximum number of characters, only the maximum will be
displayed.
java.lang.IllegalArgumentException
- SWTException
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |