void () { if (myCurrentParent == myShownRoot.getParent()) { return; } final AbstractTreeNode element = myCurrentParent.getParent(); if (element == null) { return; } try { AbstractTreeNode oldParent = myCurrentParent; buildList(element); for (int i = 0; i < myModel.getSize(); i++) { if (myModel.getElementAt(i) instanceof NodeDescriptor desc) { final Object elem = desc.getElement(); if (oldParent.equals(elem)) { selectItem(i); break; } } } } finally { updateParentTitle(); } }