void (AnActionButton button) { final FileChooserDescriptor dirChooser = FileChooserDescriptorFactory.createSingleFolderDescriptor(); dirChooser.setShowFileSystemRoots(true); dirChooser.setHideIgnored(true); dirChooser.setTitle(UIBundle.message("file.chooser.default.title")); FileChooser.chooseFiles(dirChooser, myProject, null, files -> { for (VirtualFile file : files) { // adding to the end final String path = file.getPresentableUrl(); if (processor.addPath(myWorkingCollection, path)) { myListModel.addElement(path); } } }); }