private String getTextForValue(final Object value) {
if (value instanceof MessageNode)
return ((MessageNode) value).getMessage();
else if (value instanceof RepoTreeNode) {
final RepoTreeNode node = (RepoTreeNode) value;
final RepoPathElement pathElement = node.getPathElement();
return getTextForPathElement(pathElement);
}
else
return value == null ? "" : value.toString();
}