I'd like to setup a CellList so that clicking a row will toggle the selection. Such that multiple rows can be selected with out the need for holding the ctrl key.
What do I need to change to get it working?
class ToggleEventTranslator<T> implements DefaultSelectionEventManager.EventTranslator<T> {
@Override
public boolean clearCurrentSelection(final CellPreviewEvent<T> event) {
return false;
}
@Override
public SelectAction translateSelectionEvent(final CellPreviewEvent<T> event) {
return SelectAction.TOGGLE;
}
}
MultiSelectionModel<ObjProxy> multiSelectionModel = new MultiSelectionModel<ObjProxy>();
ocjCellList.setSelectionModel(multiSelectionModel, DefaultSelectionEventManager
.<ObjProxy> createCustomManager(new ToggleEventTranslator<ObjProxy>()));