}
});
SimpleButton multiModelButton = new SimpleButton("Set Multi-Line Selection", new ClickHandler() {
public void onClick(ClickEvent event) {
MultiRowSelectionModel model = new MultiRowSelectionModel();
model.addListener(new MultiRowSelectionModel.Listener() {
public void selectionCleared() {
messageLabel.setText("Selection cleared.");
}
public void rowSelected(int row, MultiRowSelection model) {
messageLabel.setText("Selected rows: " + StringUtils.collectionToDelimetedString(model.getSelectedRows(), ", "));
}
public void rowUnselected(int row, MultiRowSelection model) {
messageLabel.setText("Selected rows: " + StringUtils.collectionToDelimetedString(model.getSelectedRows(), ", "));
}
});
grid.setSelectionModel(model);
}
});