public class XtextInputDialog
extends org.eclipse.jface.dialogs.Dialog
This concrete dialog class can be instantiated as is, or further subclassed as required.
This class is cloned from org.eclipse.jface.dialogs.InputDialog
,
with minimal changes required to instantiate a Styled text control X-Text aware.
blockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, DLG_IMG_ERROR, DLG_IMG_HELP, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSIS
Constructor and Description |
---|
XtextInputDialog(org.eclipse.swt.widgets.Shell parentShell,
java.lang.String dialogTitle,
java.lang.String dialogMessage,
java.lang.String initialValue,
org.eclipse.jface.dialogs.IInputValidator validator)
Creates an input dialog with OK and Cancel buttons.
|
XtextInputDialog(org.eclipse.swt.widgets.Shell parentShell,
java.lang.String dialogTitle,
java.lang.String dialogMessage,
java.lang.String initialValue,
org.eclipse.jface.dialogs.IInputValidator validator,
boolean xtextEnabled)
Creates an input dialog with OK and Cancel buttons.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getValue()
Returns the string typed into this input dialog.
|
void |
setErrorMessage(java.lang.String errorMessage)
Sets or clears the error message.
|
applyDialogFont, close, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, create, getBlockedHandler, getImage, setBlockedHandler, shortenText
getDefaultImage, getDefaultImages, getDefaultOrientation, getReturnCode, getShell, getWindowManager, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setWindowManager
public XtextInputDialog(org.eclipse.swt.widgets.Shell parentShell, java.lang.String dialogTitle, java.lang.String dialogMessage, java.lang.String initialValue, org.eclipse.jface.dialogs.IInputValidator validator)
Note that the open
method blocks for input dialogs.
parentShell
- the parent shell, or null
to create a top-level
shelldialogTitle
- the dialog title, or null
if nonedialogMessage
- the dialog message, or null
if noneinitialValue
- the initial input value, or null
if none
(equivalent to the empty string)validator
- an input validator, or null
if nonepublic XtextInputDialog(org.eclipse.swt.widgets.Shell parentShell, java.lang.String dialogTitle, java.lang.String dialogMessage, java.lang.String initialValue, org.eclipse.jface.dialogs.IInputValidator validator, boolean xtextEnabled)
Note that the open
method blocks for input dialogs.
parentShell
- the parent shell, or null
to create a top-level
shelldialogTitle
- the dialog title, or null
if nonedialogMessage
- the dialog message, or null
if noneinitialValue
- the initial input value, or null
if none
(equivalent to the empty string)validator
- an input validator, or null
if nonextextEnabled
- a flag that tells whether or not the dialog is XText-enabled i.e.
whether or not the dialog has XText auto-completion, coloring ... and so on
(When the flag is true the edit has full XText capabilities, otherwise when
the flag is false it is a normal edit, but it wraps its contents and so it makes
easier to read and edit its contents)public java.lang.String getValue()
public void setErrorMessage(java.lang.String errorMessage)
null
, the OK button is disabled.errorMessage
- the error message, or null
to clear