PsiElement (Object userObject) { if (userObject instanceof TodoDirNode) { TodoDirNode descriptor = (TodoDirNode)userObject; return descriptor.getValue(); } else if (userObject instanceof TodoFileNode) { TodoFileNode descriptor = (TodoFileNode)userObject; return descriptor.getValue(); } return null; }