/**
* Provides a list of Breadcrumbs. THIS IS ONLY A TEMPLATE. DO NOT USE UNMODIFIED
* @author igor vaynberg
*/
public abstract class BreadcrumbPage extends Page
{
private List<BreadcrumbPage> history = new ArrayList<BreadcrumbPage>();
public BreadcrumbPage()
{
add(new ListView("history", new PropertyModel(this, "history"))
{
@Override
protected void populateItem(final ListItem item)
{
final Link link = new Link("link", item.getModel())
{
@Override
protected void onClick()
{
getRequestCycle().setResponsePage((BreadcrumbPage) getModelObject());
}
};
link.add(new Label("title", ((BreadcrumbPage) item.getModelObject()).getTitle()));
}
});
}
public BreadcrumbPage(final BreadcrumbPage crumb)
{
this();
this.history.add(crumb); }
protected abstract IModel getTitle();
}