* Handle click events from the buttons in this panel.
*
* @param sender
*/
public void onClick(Widget sender) {
FixedWidthFlexTable headerTable = ScrollTableDemo.getHeaderTable();
try {
if (sender == setTextButton) {
// Set Text
int cell = Integer.parseInt(cellIndexBox.getText());
int row = Integer.parseInt(rowIndexBox.getText());
headerTable.setText(row, cell, textBox.getText());
} else if (sender == setHtmlButton) {
// Set HTML
int cell = Integer.parseInt(cellIndexBox.getText());
int row = Integer.parseInt(rowIndexBox.getText());
headerTable.setHTML(row, cell, textBox.getText());
} else if (sender == insertRowButton) {
// Insert Row
int row = Integer.parseInt(rowIndexBox.getText());
headerTable.insertRow(row);
} else if (sender == insertCellButton) {
// Insert Cell
int cell = Integer.parseInt(cellIndexBox.getText());
int row = Integer.parseInt(rowIndexBox.getText());
headerTable.insertCell(row, cell);
} else if (sender == removeRowButton) {
// Remove Row
int row = Integer.parseInt(rowIndexBox.getText());
headerTable.removeRow(row);
} else if (sender == removeCellButton) {
// Remove Cell
int cell = Integer.parseInt(cellIndexBox.getText());
int row = Integer.parseInt(rowIndexBox.getText());
headerTable.removeCell(row, cell);
} else if (sender == setRowSpanButton) {
// Set RowSpan
int cell = Integer.parseInt(cellIndexBox.getText());
int row = Integer.parseInt(rowIndexBox.getText());
int rowSpan = Integer.parseInt(rowSpanBox.getText());
headerTable.getFlexCellFormatter().setRowSpan(row, cell, rowSpan);
} else if (sender == setColSpanButton) {
// Set ColSpan
int cell = Integer.parseInt(cellIndexBox.getText());
int row = Integer.parseInt(rowIndexBox.getText());
int colSpan = Integer.parseInt(colSpanBox.getText());
headerTable.getFlexCellFormatter().setColSpan(row, cell, colSpan);
}
} catch (IndexOutOfBoundsException e) {
// Invalid cell index
Window.alert("The column or row indexes you entered is out of bounds.");
} catch (NumberFormatException e) {