*/
private FixedWidthFlexTable createHeaderTable() {
FixedWidthFlexTable headerTable = new FixedWidthFlexTable();
// Level 1 headers
FlexCellFormatter headerFormatter = headerTable.getFlexCellFormatter();
headerTable.setHTML(0, 0, "User Information");
headerFormatter.setColSpan(0, 0, 13);
// Create the select all checkbox
final CheckBox selectAll = new CheckBox();
selectAll.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
if (selectAll.getValue()) {
getDataTable().selectAllRows();
} else {
getDataTable().deselectAllRows();
}
}
});
// Level 2 headers
headerTable.setWidget(1, 0, selectAll);
headerFormatter.setRowSpan(1, 0, 2);
headerFormatter.setHorizontalAlignment(1, 0,
HasHorizontalAlignment.ALIGN_CENTER);
headerTable.setHTML(1, 1, "First and Last Name");
headerFormatter.setColSpan(1, 1, 2);
headerFormatter.setRowSpan(1, 1, 2);
headerTable.setHTML(1, 2, "General Info");
headerFormatter.setColSpan(1, 2, 3);
headerTable.setHTML(1, 3, "Favorite Color");
headerFormatter.setColSpan(1, 3, 1);
headerFormatter.setRowSpan(1, 3, 2);
headerTable.setHTML(1, 4, "Preferred Sport");
headerFormatter.setColSpan(1, 4, 1);
headerFormatter.setRowSpan(1, 4, 2);
headerTable.setHTML(1, 5, "School Info");
headerFormatter.setColSpan(1, 5, 3);
headerTable.setHTML(1, 6, "Login Info");
headerFormatter.setColSpan(1, 6, 2);
// Level 3 headers
headerTable.setHTML(2, 0, "Age");
headerTable.setHTML(2, 1, "Gender");
headerTable.setHTML(2, 2, "Race");