AbstractTable table = getTable(component);
if (table == null)
throw new IllegalStateException("SelectionColumn must be nested inside a table");
BaseColumn col = getColumn(component);
boolean checkBoxColHeader = col instanceof CheckboxColumn;
AbstractTableSelection selection;
if (!checkBoxColHeader) {
selection = table.getSelection();
if (selection == null)
throw new IllegalStateException("<o:selectAllCheckbox> can only be inserted into a DataTable or TreeTable with multiple selection. clientId = " + component.getClientId(context));
boolean multipleRowSelection = selection.isMultipleSelectionAllowed();
if (!multipleRowSelection)
throw new IllegalStateException("<o:selectAllCheckbox> can only be inserted into a DataTable or TreeTable with multiple selection. clientId = " + component.getClientId(context));
} else
selection = null;
SelectAllCheckbox selectAllCheckbox = (SelectAllCheckbox) component;
if (!checkBoxColHeader) {
if (!selection.isEnabled()) {
selectAllCheckbox.setDisabled(true);
}
}
selectAllCheckbox.setSelected(false);