void (final SelectedState<? super VirtualFile> states, final PairProcessor<? super VirtualFile, ? super TreeNodeState> parentsProcessor) { DefaultMutableTreeNode current = (DefaultMutableTreeNode) myNode.getParent(); // up cycle while (current != null) { final VirtualFile file = myConvertor.convert(current); if (file == null) return; final TreeNodeState state = states.get(file); if (! parentsProcessor.process(file, state)) return; current = (DefaultMutableTreeNode)current.getParent(); } }