* @return The indentation component
*/
protected Component newIndentation(final MarkupContainer parent, final String id,
final TreeNode node, final int level)
{
WebMarkupContainer result = new WebMarkupContainer(id)
{
private static final long serialVersionUID = 1L;
/**
* {@inheritDoc}
*/
@Override
public void onComponentTagBody(final MarkupStream markupStream,
final ComponentTag openTag)
{
Response response = RequestCycle.get().getResponse();
TreeNode parent = node.getParent();
CharSequence urls[] = new CharSequence[level];
for (int i = 0; i < level; ++i)
{
if (isNodeLast(parent))
{
urls[i] = "indent-blank";
}
else
{
urls[i] = "indent-line";
}
parent = parent.getParent();
}
for (int i = level - 1; i >= 0; --i)
{
response.write("<span class=\"" + urls[i] + "\"></span>");
}
}
};
result.setRenderBodyOnly(true);
return result;
}