return table;
}
public static LocalizedPagedTable pagedTable(final Container container, String[] visibleViewColumns, String[] columnViewHeaders,
Map<String, ColumnGenerator> customViewColumns, ItemClickListener itemClickListener) {
LocalizedPagedTable table = new LocalizedPagedTable();
table.addStyleName("striped strong");
table.setSizeFull();
table.setPageLength(10);
table.setImmediate(true);
table.setSelectable(true);
table.setContainerDataSource(container);
if (itemClickListener != null) {
table.addListener(itemClickListener);
}
if (customViewColumns != null && !customViewColumns.isEmpty()) {
for (Map.Entry<String, ColumnGenerator> entry : customViewColumns.entrySet()) {
table.addGeneratedColumn(entry.getKey(), entry.getValue());
}
}
table.setVisibleColumns(visibleViewColumns);
table.setColumnHeaders(columnViewHeaders);
table.setSortAscending(true);
table.setSortContainerPropertyId(visibleViewColumns[0]);
return table;
}