// Select a different value.
NativeEvent nativeEvent = Document.get().createClickEvent(0, 0, 0, 0, 0,
false, false, false, false);
CellPreviewEvent<String> event = new CellPreviewEvent<String>(nativeEvent,
display, new Context(1, 0, null), "test 1", false, false);
manager.handleSelectionEvent(event, null, model);
assertEquals("test 1", model.getSelectedObject());
// Select the same value.
manager.handleSelectionEvent(event, null, model);
assertEquals("test 1", model.getSelectedObject());
// Ctrl+Select the same value.
nativeEvent = Document.get().createClickEvent(0, 0, 0, 0, 0, true, false,
false, true);
event = new CellPreviewEvent<String>(nativeEvent, display, new Context(1,
0, null), "test 1", false, false);
manager.handleSelectionEvent(event, null, model);
assertNull(model.getSelectedObject());
// Spacebar a different value.
nativeEvent = Document.get().createKeyUpEvent(false, false, false, false,
32);
event = new CellPreviewEvent<String>(nativeEvent, display, new Context(2,
0, null), "test 2", false, false);
manager.handleSelectionEvent(event, null, model);
assertEquals("test 2", model.getSelectedObject());
// Spacebar the same value.