table.setCellEditor(2, new TextCellEditor<Serializable>(intOnlyTextBox));
// Gender cell editor
RadioCellEditor<Serializable> genderEditor = new RadioCellEditor<Serializable>();
genderEditor.setLabel("Select a gender:");
genderEditor.addRadioButton(new RadioButton("editorGender", "male"));
genderEditor.addRadioButton(new RadioButton("editorGender", "female"));
table.setCellEditor(3, genderEditor);
// Race cell editor
ListCellEditor<Serializable> raceEditor = new ListCellEditor<Serializable>();
ListBox raceBox = raceEditor.getListBox();
for (int i = 0; i < DataSourceData.races.length; i++) {
raceBox.addItem(DataSourceData.races[i]);
}
table.setCellEditor(4, raceEditor);
// Color cell editor
RadioCellEditor<Serializable> colorEditor = new RadioCellEditor<Serializable>() {
/**
* An element used to string the HTML portion of the color.
*/
private HTML html = new HTML();
@Override
protected void setValue(Object value) {
html.setHTML(value.toString());
super.setValue(html.getText());
}
};
colorEditor.setLabel("Select a color:");
for (int i = 0; i < DataSourceData.colors.length; i++) {
String color = DataSourceData.colors[i];
colorEditor.addRadioButton(new RadioButton("editorColor", color));
}
table.setCellEditor(5, colorEditor);
// Sport cell editor
ListCellEditor<Serializable> sportEditor = new ListCellEditor<Serializable>();