FileEditor (@NotNull Project project, @NotNull VirtualFile file) { ResourceBundle resourceBundle; if (file instanceof ResourceBundleAsVirtualFile) { resourceBundle = ((ResourceBundleAsVirtualFile)file).getResourceBundle(); } else { PsiFile psiFile = PsiManager.getInstance(project).findFile(file); if (psiFile == null) { throw new IllegalArgumentException("psifile cannot be null"); } resourceBundle = PropertiesImplUtil.getPropertiesFile(psiFile).getResourceBundle(); } return new ResourceBundleEditor(project, file, resourceBundle); }