void (ChangeEvent e) { TreeNode node = (TreeNode)myTree.getLastSelectedPathComponent(); if (node instanceof ShelvedListNode changeListNode && e.getSource() instanceof TreeCellEditor treeCellEditor) { String editorValue = treeCellEditor.getCellEditorValue().toString(); ShelvedChangeList shelvedChangeList = changeListNode.getList(); myShelveChangesManager.renameChangeList(shelvedChangeList, editorValue); } }