void (Collection<? extends TreePath> paths) { final List<ProcessorConfigProfile> toRemove = new SmartList<>(); for (TreePath path : paths) { Object node = path.getLastPathComponent(); if (node instanceof ProfileNode) { final ProcessorConfigProfile nodeProfile = ((ProfileNode)node).myProfile; if (nodeProfile != myDefaultProfile) { toRemove.add(nodeProfile); } } } if (!toRemove.isEmpty()) { boolean changed = false; for (ProcessorConfigProfile nodeProfile : toRemove) { if (mySelectedProfile == nodeProfile) { mySelectedProfile = null; } changed |= myModuleProfiles.remove(nodeProfile); } if (changed) { ((DataSynchronizable)getRoot()).sync(); final DefaultMutableTreeNode object = TreeUtil.findNodeWithObject((DefaultMutableTreeNode)getRoot(), myDefaultProfile); if (object != null) { TreeUtil.selectNode(myTree, object); } } } }