You can use Text.addModifyListener
to add a ModifyListener
which will be called each time the text is changed. You can also use Text.addVerifyListener
to add VerifyListener
which can actually prevent text being entered.
For TitleAreaDialog
you can call setMessage
or setErrorMessage
to display a message in the title area.
You can disable the OK
button on the dialog using:
getButton(IDialogConstants.OK_ID).setEnabled(false);
Note: getButton(xxx)
can return null
if you call it too early in the dialog construction. Buttons are created during the createContents
method after the createDialogArea
method has been called.
So you can access the buttons by overriding createContents
like this:
@Override
protected Control createContents(final Composite parent)
{
Control control = super.createContents(parent);
// TODO access buttons here
return control;
}