开发者

SWT TableViewer multiselection without Ctrl

开发者 https://www.devze.com 2023-04-02 05:18 出处:网络
I\'m using a TableViewer and I want to it perform like when I hold CTRL key. I mean if I click a row, it must be added to selection and not replace current selection.

I'm using a TableViewer and I want to it perform like when I hold CTRL key. I mean if I click a row, it must be added to selection and not replace current selection. I probably need to do this manually in selection listener. But may be there's a better (more convinient开发者_运维技巧) way?


Tableviewer wraps a Table, which multi-select behavior is platform-specific, that means you cannot disable that. If you want to implement your own multi-select behavior you have to implement your own table-widget which does not depend on the Table widget from SWT. The Composite Table should be a good starting point...


How about adding the SWT.CHECK attribute when constructing the table so the table entries will be selected with a checkbox?

0

精彩评论

暂无评论...
验证码 换一张
取 消