void (final ContentEntryEditor contentEntryEditor) { if (myContentEntryEditor != null && myContentEntryEditor.equals(contentEntryEditor)) { return; } if (myFileSystemTree != null) { Disposer.dispose(myFileSystemTree); myFileSystemTree = null; } if (myContentEntryEditor != null) { myContentEntryEditor.removeContentEntryEditorListener(myContentEntryEditorListener); myContentEntryEditor = null; } if (contentEntryEditor == null) { myTreePanel.setVisible(false); if (myFileSystemTree != null) { Disposer.dispose(myFileSystemTree); } return; } myTreePanel.setVisible(true); myContentEntryEditor = contentEntryEditor; myContentEntryEditor.addContentEntryEditorListener(myContentEntryEditorListener); final ContentEntry entry = contentEntryEditor.getContentEntry(); assert entry != null : contentEntryEditor; final VirtualFile file = entry.getFile(); if (file != null) { myDescriptor.setRoots(file); } else { String path = VfsUtilCore.urlToPath(entry.getUrl()); myDescriptor.setTitle(FileUtil.toSystemDependentName(path)); } myExcludePatternsField.setText(StringUtil.join(entry.getExcludePatterns(), ";")); final Runnable init = () -> { myFileSystemTree.updateTree(); myFileSystemTree.select(file, null); }; myFileSystemTree = new FileSystemTreeImpl(myProject, myDescriptor, myTree, getContentEntryCellRenderer(entry), init, null); myFileSystemTree.showHiddens(true); Disposer.register(myProject, myFileSystemTree); final NewFolderAction newFolderAction = new MyNewFolderAction(); final DefaultActionGroup mousePopupGroup = new DefaultActionGroup(); mousePopupGroup.add(myEditingActionsGroup); mousePopupGroup.addSeparator(); mousePopupGroup.add(newFolderAction); myFileSystemTree.registerMouseListener(mousePopupGroup); }