当我尝试 实现TraverseListener并运行程序然后键AP ARROW(或DOWN ARROW)停止按钮(弹出日历按钮,默认左侧) DateChooserCombo小部件。如何使用键向上箭头实现此侦听器 和DOWN ARROW的工作方式与关键TAB相同?例如:
DateChooserCombo dateChooserCombo = new DateChooserCombo(shell, SWT.NONE);
dateChooserCombo.addTraverseListener(new TraverseListener() {
public void keyTraversed(TraverseEvent e) {
if (e.detail == SWT.TRAVERSE_RETURN || e.keyCode == SWT.ARROW_DOWN) {
e.detail = SWT.TRAVERSE_TAB_NEXT;
} else if (e.keyCode == SWT.ARROW_UP) {
e.detail = SWT.TRAVERSE_TAB_PREVIOUS;
}
e.doit = true;
}
});