}
public void test_withPropertyTable_quickSearch() throws Exception {
dontUseSharedGWTState();
setFileContent("war/Module.css", getSource(".aaa {}", ".bb1 {}", ".bb2 {}", ".ccc {}"));
PropertyTable propertyTable = new PropertyTable(TEST_COMBO_SHELL, SWT.NONE);
try {
Property property = getStyleProperty(null);
PropertyEditor propertyEditor = property.getEditor();
// activate
propertyTable.setInput(new Property[]{property});
propertyTable.setActiveProperty(property);
// send "b", activate editor
new EventSender(propertyTable).keyDown(0, 'b');
// prepare controls
CComboBox combo = (CComboBox) getFieldValue(propertyEditor, "m_combo");
Text comboText = (Text) getFieldValue(combo, "m_text");
Table comboTable = ((TableViewer) getFieldValue(combo, "m_table")).getTable();
EventSender eventSender = new EventSender(comboText);
// drop-down in async
waitEventLoop(0);
assertTrue(combo.isDroppedDown());
// state after sending "b"
assertEquals(2, comboTable.getItemCount());
assertEquals(-1, comboTable.getSelectionIndex());
// send DOWN, select "bb2"
{
eventSender.keyDown(SWT.ARROW_DOWN);
assertEquals(0, comboTable.getSelectionIndex());
eventSender.keyDown(SWT.ARROW_DOWN);
assertEquals(1, comboTable.getSelectionIndex());
}
// apply selection
eventSender.keyDown('\r');
assertEditor(getStyleSource("setStyleName('bb2')"));
} finally {
propertyTable.dispose();
}
}