/** * Sets the striping type used to highlight alternate rows or columns. * * @param stripingType The striping type to set. */ public void setStripingType(final StripingType stripingType) { getOrCreateComponentModel().stripingType = stripingType; }
/** * @param selectGroup The selectGroup to set. */ public void setSelectGroup(final String selectGroup) { getOrCreateComponentModel().selectGroup = selectGroup; }
/** * Sets the separator used to visually separate rows or columns. * * @param separatorType The separator type to set. */ public void setSeparatorType(final SeparatorType separatorType) { getOrCreateComponentModel().separatorType = separatorType; }
/** * Sets whether filtering is enabled. * * @param filterable true to enable filtering, false otherwise. */ public void setFilterable(final boolean filterable) { getOrCreateComponentModel().filterable = filterable; }
/** * For rendering purposes only - has no effect on model. * * @param index the sort column index, or -1 for no sort. * @param ascending true for ascending order, false for descending */ protected void setSort(final int index, final boolean ascending) { TableModel model = getOrCreateComponentModel(); model.sortColIndex = index; model.sortAscending = ascending; }
/** * Sets whether table column headers should be displayed. * * @param showColumnHeaders true to display table column headers, false otherwise. */ public void setShowColumnHeaders(final boolean showColumnHeaders) { getOrCreateComponentModel().showColumnHeaders = showColumnHeaders; }
/** * Sets the row selection mode. * * @param selectMode The select mode to set. */ public void setSelectMode(final SelectMode selectMode) { getOrCreateComponentModel().selectMode = selectMode; }
/** * @param expandedRows The expandedRows to set. */ public void setExpandedRows(final List<Integer> expandedRows) { getOrCreateComponentModel().expandedRows = expandedRows; }
/** * Sets whether row indices should be displayed. * * @param showRowIndices true if row indices should be displayed, false otherwise. */ public void setShowRowIndices(final boolean showRowIndices) { getOrCreateComponentModel().showRowIndices = showRowIndices; }
/** * Sets the active filters. * * @param activeFilters The active filters to set. */ public void setActiveFilters(final List<String> activeFilters) { getOrCreateComponentModel().activeFilters = activeFilters; }
/** * Sets the message to display when the table contains no rows. * * @param noDataMessage the no data message. */ public void setNoDataMessage(final String noDataMessage) { getOrCreateComponentModel().noDataMessage = noDataMessage; }
/** * Sets the table type. * * @param type the table type to set. */ public void setType(final Type type) { getOrCreateComponentModel().type = type; }
/** * Sets the table summary text. * * @param summary The summary to set. */ public void setSummary(final String summary) { getOrCreateComponentModel().summary = summary; }
/** * Sets the table caption text. * * @param caption The caption to set. */ public void setCaption(final String caption) { getOrCreateComponentModel().caption = caption; }
/** * Sets how the table row "select all" function should be displayed. * * @param selectAllMode The select all mode to set. */ public void setSelectAllMode(final SelectAllType selectAllMode) { getOrCreateComponentModel().selectAllMode = selectAllMode; }
/** * Sets whether the "expand all" control should be available. * * @param expandAll true if the expand-all control should be available, false if not. */ public void setExpandAll(final boolean expandAll) { getOrCreateComponentModel().expandAll = expandAll; }
/** * Sets the number of rows to display per page when pagination is enabled. * * @param rowsPerPage The rowsPerPage to set, greater than zero. */ public void setRowsPerPage(final int rowsPerPage) { if (rowsPerPage < 1) { throw new IllegalArgumentException( "Rows per page must be greater than 0, but got: " + rowsPerPage); } getOrCreateComponentModel().rowsPerPage = rowsPerPage; }
/** * @param selectedRows The selectedRows to set. */ public void setSelectedRows(final List<Integer> selectedRows) { TableModel model = getOrCreateComponentModel(); if (selectedRows == null) { model.selectedRows = null; } else { model.selectedRows = new ArrayList<>(selectedRows); Collections.sort(model.selectedRows); } }
/** * Sets the row expansion mode. ExpandMode.SERVER mapped to ExpandMode.DYNAMIC to overcome accessibility problems. * * @param expandMode The expand mode to set. */ public void setExpandMode(final ExpandMode expandMode) { getOrCreateComponentModel().expandMode = ExpandMode.SERVER.equals(expandMode) ? ExpandMode.DYNAMIC : expandMode; }
/** * Sets the pagination mode. Mode.SERVER mapped to Mode.DYNAMIC to overcome accessibility problem. * * @param paginationMode The paginationMode to set. */ public void setPaginationMode(final PaginationMode paginationMode) { getOrCreateComponentModel().paginationMode = PaginationMode.SERVER.equals(paginationMode) ? PaginationMode.DYNAMIC : paginationMode; }