CheckboxTableViewer with more than 2 columns? [message #1103227] |
Fri, 06 September 2013 14:08 |
Alan DW Messages: 119 Registered: March 2012 |
Senior Member |
|
|
Hello everyone,
as we all know, the default CheckboxTableViewer is a handy widget and uses two columns: one for the checkboxes and one for displaying the elements. What I would like to have is an additional text column, such that the column layout is like this:
[check][text][text]
The last text column should just display some additional information about the item in question. I tried to solve it like this:
Table table = new Table(composite_6, SWT.CHECK);
table.setLinesVisible(false);
table.setHeaderVisible(false);
TableColumn tc0 = new TableColumn(table, SWT.NONE);
TableColumn tc1 = new TableColumn(table, SWT.NONE);
this.checkboxTableViewer = new CheckboxTableViewer(table);
this.checkboxTableViewer.setContentProvider(new MyTableContentProvider());
this.checkboxTableViewer.setLabelProvider(new MyTableLabelProvider());
... but if I do that, I don't see any content anymore in the table, regardless of the input. Is it possible to do it this way? If so, how would the "getElements()" return array of the TableContentProvider have to be structured? After all, it has to provide content for more than 1 column now...
I'm still new to SWT, so sorry if this is a dumb question or has been asked before, I'd be glad for any help!
Thanks,
Alan
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02216 seconds