if (userObject instanceof AbstractTreeNode) {
simpleTextAttributes = getSimpleTextAttributes(((AbstractTreeNode)userObject).getPresentation());
}
}
if (color != null) {
final TextAttributes textAttributes = simpleTextAttributes.toTextAttributes();
textAttributes.setForegroundColor(color);
simpleTextAttributes = SimpleTextAttributes.fromTextAttributes(textAttributes);
}
return simpleTextAttributes;
}