void (@NotNull ProgressIndicator indicator) { indicator.setIndeterminate(false); int i = 0; for (VirtualFile file : files) { indicator.checkCanceled(); indicator.setText2(file.getPresentableUrl()); indicator.setFraction((double)i / files.length); i++; try { WriteAction.runAndWait(()-> file.delete(this)); } catch (IOException e) { LOG.info("Error when deleting " + file, e); problems.add(file.getName()); } } }