void (@NotNull DataContext dataContext) { final ResourceBundle[] resourceBundles = ResourceBundle.ARRAY_DATA_KEY.getData(dataContext); if (resourceBundles != null && resourceBundles.length != 0) { final Project project = CommonDataKeys.PROJECT.getData(dataContext); LOG.assertTrue(project != null); final PsiElement[] toDelete = Arrays .stream(resourceBundles) .flatMap(rb -> rb.getPropertiesFiles().stream()) .map(PropertiesFile::getContainingFile) .toArray(PsiElement[]::new); SafeDeleteHandler.invoke(project, toDelete, true, () -> { final FileEditorManager fileEditorManager = FileEditorManager.getInstance(project); for (ResourceBundle bundle : resourceBundles) { fileEditorManager.closeFile(new ResourceBundleAsVirtualFile(bundle)); } }); } }