* Populate the table with Wicket elements
*/
@Override
protected void populateItem(final ListItem<Access> listItem)
{
final Access access = listItem.getModelObject();
IPageMapEntry entry = pageMap.getEntry(access.getId());
PageParameters parameters = new PageParameters();
parameters.put("pageId", "" + entry.getNumericId());
parameters.put("pageMap", pageMap.getName() == null ? "" : pageMap.getName());
Link<?> link = new BookmarkablePageLink<Void>("link", InspectorPage.class, parameters);
link.add(new Label("id", "" + entry.getNumericId()));
listItem.add(link);
listItem.add(new Label("class", "" + entry.getClass().getName()));
long size;
int versions;
if (entry instanceof Page)
{
Page page = (Page)entry;
page.detachModels();
size = page.getSizeInBytes();
versions = page.getVersions();
}
else
{
size = Objects.sizeof(entry);
versions = 0;
}
listItem.add(new Label("access", "" + (accessStack.size() - listItem.getIndex())));
listItem.add(new Label("version", "" + access.getVersion()));
listItem.add(new Label("versions", "" + versions));
listItem.add(new Label("size", size == -1 ? "[Unknown]" : "" + Bytes.bytes(size)));
}
});
}