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?
Asked
Active
Viewed 2,451 times
1
-
Are you using `SWT.MULTI` selection tag? – Sorceror Sep 02 '11 at 14:27
-
Yes, but I need to hold CTRL to select multiple lines – Ilya Ivanov Sep 02 '11 at 14:44
-
Could you post [SSCCE](http://sscce.org/)? – Sorceror Sep 02 '11 at 15:28
2 Answers
2
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...

Tom Seidel
- 9,525
- 1
- 26
- 38
2
How about adding the SWT.CHECK attribute when constructing the table so the table entries will be selected with a checkbox?

David G
- 3,940
- 1
- 22
- 30
-
Yes, that was the second idea I came with :) But I was just curious if what I have described here is possible. – Ilya Ivanov Sep 07 '11 at 09:11