我目前正在使用 Nebula GridTable 并希望为表的行和列实现复制和粘贴功能。行的选择是开箱即用的,但是如果我按下标题单元格,我希望选择一列。GridTableViewer 创建如下
new GridTableViewer(parent, SWT.FULL_SELECTION | SWT.V_SCROLL |
SWT.H_SCROLL | SWT.MULTI |SWT.WRAP | SWT.VIRTUAL)
为此,我为网格实现了一个 SelectionListener,如下所示:
v.getGrid().addSelectionListener(new SelectionListener(){
@Override
public void widgetSelected(SelectionEvent e)
{
v.getGrid().selectColumn(e.y);
v.getGrid().update();
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
// TODO Auto-generated method stub
}
});
调试器让我建议选择该列,但它没有在 UI 中突出显示。我该怎么做才能使多列选择和突出显示工作?
最好的问候,克里斯托夫