ResourceBundleEditorFileListener () { final VirtualFileManager virtualFileManager = VirtualFileManager.getInstance(); ResourceBundleEditorFileListener myVfsListener = new ResourceBundleEditorFileListener(this); virtualFileManager.addVirtualFileListener(myVfsListener, this); PsiTreeChangeAdapter psiTreeChangeAdapter = new PsiTreeChangeAdapter() { @Override public void childAdded(@NotNull PsiTreeChangeEvent event) { final PsiFile file = event.getFile(); if (file instanceof XmlFile) { final PropertiesFile propertiesFile = PropertiesImplUtil.getPropertiesFile(file); if (propertiesFile != null) { final ResourceBundle bundle = propertiesFile.getResourceBundle(); if (bundle.equals(myResourceBundle) && !myEditors.containsKey(propertiesFile.getVirtualFile())) { recreateEditorsPanel(); } } } } @Override public void childRemoved(@NotNull PsiTreeChangeEvent event) { final PsiFile file = event.getFile(); final PropertiesFile propertiesFile = PropertiesImplUtil.getPropertiesFile(file); if (propertiesFile != null) { final ResourceBundle bundle = propertiesFile.getResourceBundle(); if (bundle.equals(myResourceBundle) && myEditors.containsKey(propertiesFile.getVirtualFile())) { final IProperty property = PropertiesImplUtil.getProperty(event.getParent()); if (property != null && Objects.equals(property.getName(), getSelectedPropertyName())) { updateEditorsFromProperties(false); } } } } }; PsiManager.getInstance(myProject).addPsiTreeChangeListener(psiTreeChangeAdapter, this); return myVfsListener; }