private boolean validateInput() throws IOException {
    if (!validateViewWithSameNameIsAlreadyOpen()) {
      MessageBox.showError(
          this,
          "There is already another view with the same diff name open. "
              + "Close open view first or rename diff.");
      return false;
    }

    if (!validateDiffName()) {
      MessageBox.showError(
          this,
          String.format(
              "A BinDiff file with the name '%s' already exists.\n"
                  + "Rename or select the checkbox to override.",
              getMatchesDatabaseTargetFile().getName()));

      return false;
    }

    if (!validateExportName(ESide.PRIMARY)) {
      MessageBox.showError(
          this,
          String.format(
              "A primary BinExport file named '%s' already exists with different content.\n"
                  + "Rename or select the checkbox for override.",
              getExportBinaryTargetFile(ESide.PRIMARY).getName()));

      return false;
    }

    if (!validateExportName(ESide.SECONDARY)) {
      MessageBox.showError(
          this,
          String.format(
              "A secondary BinExport file named '%s' already exists with different content.\n"
                  + "Rename or select the checkbox for override.",
              getExportBinaryTargetFile(ESide.SECONDARY).getName()));

      return false;
    }

    return true;
  }
Save dialog for function diff views.
java/ui/src/main/java/com/google/security/zynamics/bindiff/gui/dialogs/SaveFunctionDiffViewDialog.java