WorkingCopyFormat () { final UpgradeFormatDialog dialog = new UpgradeFormatDialog(myProject, myPath, false); final ModalityState dialogState = any(); dialog.startLoading(); getApplication().executeOnPooledThread(() -> { final List<WorkingCopyFormat> formats = loadSupportedFormats(); getApplication().invokeLater(() -> { final String errorMessage = error.get(); if (errorMessage != null) { dialog.doCancelAction(); showErrorDialog(message("message.text.cannot.load.supported.formats", errorMessage), message("dialog.title.check.out")); } else { dialog.setSupported(formats); dialog.setData(getFirstItem(formats, UNKNOWN)); dialog.stopLoading(); } }, dialogState); }); return dialog.showAndGet() ? dialog.getUpgradeMode() : UNKNOWN; }