@Nullable @Override protected ValidationInfo doValidate() { String command = getCommand(); if (command.isEmpty()) { return new ValidationInfo("Empty Go command is not allowed", myCommandTextField); } if (command.startsWith("go ")) { return new ValidationInfo("Go command shouldn't started with `go`", myCommandTextField); } return super.doValidate(); }
@Nullable @Override protected ValidationInfo doValidate() { if (selectedDir == null) { return new ValidationInfo("Please select a resource dir.", list); } return super.doValidate(); }
@Nullable @Override protected ValidationInfo doValidate() { String filePath = documentToImportTextField.getTextField().getText(); if (StringUtils.isBlank(filePath)) { return new ValidationInfo("Data file to import should be set", rootPanel); } File file; file = new File(filePath); if (!file.exists()) { return new ValidationInfo("Data file does not exist", rootPanel); } return super.doValidate(); }
@Nullable @Override protected ValidationInfo doValidate() { if (StringUtils.isEmpty(controller.getTargetRoot())) { return new ValidationInfo("Please select the resources root.", resRoot); } if (StringUtils.isEmpty(controller.getExportName())) { return new ValidationInfo("Please select a name for the drawable.", resExportName); } return super.doValidate(); }
@Nullable @Override protected ValidationInfo doValidate() { if(StringUtils.isBlank(commentText.getText())) { return new ValidationInfo("Comment text cannot be empty.", commentText); } return super.doValidate(); }
return super.doValidate();
}) .findFirst() .orElseGet(() -> super.doValidate());