ValidationInfo () { String taskName = myNameField.getText().trim(); if (taskName.isEmpty()) { return new ValidationInfo(TaskBundle.message("dialog.message.task.name.should.not.be.empty"), myNameField); } for (TaskDialogPanel panel : myPanels) { ValidationInfo validate = panel.validate(); if (validate != null) return validate; } return null; }