use of org.jmesa.view.html.toolbar.MaxRowsItem in project OpenClinica by OpenClinica.
the class DefaultToolbar method render.
@SuppressWarnings("unchecked")
@Override
public String render() {
addToolbarItem(ToolbarItemType.FIRST_PAGE_ITEM);
addToolbarItem(ToolbarItemType.PREV_PAGE_ITEM);
addToolbarItem(ToolbarItemType.NEXT_PAGE_ITEM);
addToolbarItem(ToolbarItemType.LAST_PAGE_ITEM);
addToolbarItem(ToolbarItemType.SEPARATOR);
MaxRowsItem maxRowsItem = (MaxRowsItem) addToolbarItem(ToolbarItemType.MAX_ROWS_ITEM);
if (getMaxRowsIncrements() != null) {
maxRowsItem.setIncrements(getMaxRowsIncrements());
}
boolean exportable = ViewUtils.isExportable(getExportTypes());
if (exportable) {
addToolbarItem(ToolbarItemType.SEPARATOR);
addExportToolbarItems(getExportTypes());
}
Row row = getTable().getRow();
List columns = row.getColumns();
boolean filterable = ViewUtils.isFilterable(columns);
if (filterable) {
//addToolbarItem(ToolbarItemType.SEPARATOR);
//addToolbarItem(ToolbarItemType.FILTER_ITEM);
//addToolbarItem(ToolbarItemType.CLEAR_ITEM);
}
boolean editable = ViewUtils.isEditable(getCoreContext().getWorksheet());
if (editable) {
addToolbarItem(ToolbarItemType.SEPARATOR);
addToolbarItem(ToolbarItemType.SAVE_WORKSHEET_ITEM);
addToolbarItem(ToolbarItemType.FILTER_WORKSHEET_ITEM);
}
addToolbarItems();
return super.render();
}
Aggregations