ErrorTreeElement (Object value) { if (!(value instanceof DefaultMutableTreeNode)) { return null; } final Object userObject = ((DefaultMutableTreeNode)value).getUserObject(); if (!(userObject instanceof ErrorTreeNodeDescriptor)) { return null; } return ((ErrorTreeNodeDescriptor)userObject).getElement(); }