fixed PY-8398 Change Signature: disable refactor and preview buttons in case of validation error in the dialog

This commit is contained in:
Ekaterina Tuzova
2013-01-11 13:52:17 +04:00
parent 66a708b93b
commit 7809540191
@@ -194,6 +194,12 @@ public class PyChangeSignatureDialog extends ChangeSignatureDialogBase<PyParamet
@Override
protected ValidationInfo doValidate() {
final String message = validateAndCommitData();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
getRefactorAction().setEnabled(message == null);
getPreviewAction().setEnabled(message == null);
}
});
if (message != null) return new ValidationInfo(message);
return super.doValidate();
}