void (ActionEvent e) { Application application = ApplicationManager.getApplication(); VirtualFile previous = application.runWriteAction((NullableComputable<VirtualFile>)() -> { final String path = FileUtil.toSystemIndependentName(externalEditorPath.getText()); return LocalFileSystem.getInstance().refreshAndFindFileByPath(path); }); FileChooserDescriptor fileDescriptor = new FileChooserDescriptor(true, SystemInfo.isMac, false, false, false, false); fileDescriptor.setShowFileSystemRoots(true); fileDescriptor.setTitle(ImagesBundle.message("select.external.executable.title")); fileDescriptor.setDescription(ImagesBundle.message("select.external.executable.message")); FileChooser.chooseFiles(fileDescriptor, null, previous, files -> { String path = files.get(0).getPath(); externalEditorPath.setText(path); }); }