To create a input dialog,
InputDialog fileNameDialog = new InputDialog(shell, "Rename Item", "New Name:", "", new validator());
The last parameter in the InputDialog is the object "new validator()".
class validator implements IInputValidator {
public String isValid(String newText) {
if (newText==null)
return "Error Caused!";
}
}
InputDialog fileNameDialog = new InputDialog(shell, "Rename Item", "New Name:", "", new validator());
The last parameter in the InputDialog is the object "new validator()".
class validator implements IInputValidator {
public String isValid(String newText) {
if (newText==null)
return "Error Caused!";
}
}
The error message is displayed while disabling the "ok" button as shown below,
Super !!!
ReplyDeleteThankyou for your feedback :)
Delete