void (@NotNull String newName, @NotNull ResourceBundle targetResourceBundle, @NotNull ResourceBundle sourceResourceBundle, @NotNull Project project) { if (sourceResourceBundle.equals(targetResourceBundle)) { DataManager.getInstance() .getDataContextFromFocusAsync() .onSuccess(context -> { final FileEditor fileEditor = PlatformCoreDataKeys.FILE_EDITOR.getData(context); if (fileEditor instanceof ResourceBundleEditor resourceBundleEditor) { resourceBundleEditor.updateTreeRoot(); resourceBundleEditor.selectProperty(newName); } }); } else { for (FileEditor editor : FileEditorManager.getInstance(project).openFile(new ResourceBundleAsVirtualFile(targetResourceBundle), true)) { ((ResourceBundleEditor) editor).updateTreeRoot(); ((ResourceBundleEditor) editor).selectProperty(newName); } } }