void (@Nullable Object deletedItem) { if (deletedItem instanceof Library library) { final MyNode node = findNodeByObject(myRoot, library); if (node != null) { final TreeNode parent = node.getParent(); node.removeFromParent(); getTreeModel().reload(parent); } myContext.getDaemonAnalyzer().removeElement(new LibraryProjectStructureElement(myContext, library)); } }