private boolean isValidPath(TextFieldWithBrowseButton withBrowseButton, ProjectFileIndex index, String osName) {
    final String text = withBrowseButton.getText();
    if (StringUtil.isEmptyOrSpaces(text)) return true;
    final VirtualFile virtualFile = VfsUtil.findFileByIoFile(new File(text.trim()), false);
    if (virtualFile == null || !virtualFile.exists() || virtualFile.isDirectory()) {
      Messages.showErrorDialog(myPanel.myWholePanel, JavaFXBundle.message("javafx.application.icons.icon.file.should.exist", osName));
      return false;
    }
    if (!index.isInContent(virtualFile)) {
      Messages.showErrorDialog(myPanel.myWholePanel, JavaFXBundle.message("javafx.application.icons.file.should.be.inside.project.content", osName));
      return false;
    }
    return true;
  }
private boolean isValidPath(TextFieldWithBrowseButton withBrowseButton, ProjectFileIndex index, String osName)