*
* @return table.
*/
protected JPanel createDataTable(JPanel table, int max)
{
BBFormBuilder builder = new BBFormBuilder("16px, 4dlu, 50dlu:grow, 2dlu, max(p;50dlu), 2dlu, max(p;50dlu)", table);
builder.setDefaultDialogBorder();
// Output header
builder.append(UifUtilities.boldFont(new JLabel(headerEntityTitle)), 3);
builder.append(UifUtilities.boldFont(new JLabel(Strings.message("report.since.reset"))), 1,
CellConstraints.CENTER, CellConstraints.DEFAULT);
builder.append(UifUtilities.boldFont(new JLabel(Strings.message("report.all.time"))), 1,
CellConstraints.CENTER, CellConstraints.DEFAULT);
// Output data
int i = 0;
for (VisitStats stat : visitStats)
{
if (i++ == max) break;
builder.append(new JLabel(itemIcon));
builder.append(createLabel(stat.getObjectId(), stat.getObjectTitle()));
builder.append(new JLabel(Long.toString(stat.getCountReset())), 1,
CellConstraints.CENTER, CellConstraints.DEFAULT);
builder.append(new JLabel(Long.toString(stat.getCountTotal())), 1,
CellConstraints.CENTER, CellConstraints.DEFAULT);
}
return builder.getPanel();
}