@Override
  public void setVisible(final boolean visible) {
    loadWorkspace();

    if (!workspace.isLoaded()) {
      dispose();

      return;
    }

    if (!createSingleViewsDirectory()) {
      final String msg =
          "Save function diff view failed. Couldn't create 'Function Diffs' directory'.";
      logger.atSevere().log(msg);
      MessageBox.showError(window, msg);

      dispose();

      return;
    }

    if (!createDestinationDirectory()) {
      final String msg = "Save function diff view failed. Couldn't create destination directory.";
      logger.atSevere().log(msg);
      MessageBox.showError(window, msg);

      dispose();

      return;
    }

    try {
      setDefaultNames();
    } catch (final IOException e) {
      final String msg = "Save function diff view failed. Couldn't calculate source BinExport MD5.";
      logger.atSevere().withCause(e).log(msg);
      MessageBox.showError(window, msg);

      return;
    }

    if (visible) {
      okPressed = false;
    }

    super.setVisible(visible);
  }
Save dialog for function diff views.
java/ui/src/main/java/com/google/security/zynamics/bindiff/gui/dialogs/SaveFunctionDiffViewDialog.java