Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » CheckboxTableViewer with more than 2 columns?
CheckboxTableViewer with more than 2 columns? [message #1103227] Fri, 06 September 2013 14:08 Go to next message
Alan DW is currently offline Alan DWFriend
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
Re: CheckboxTableViewer with more than 2 columns? [message #1108846 is a reply to message #1103227] Sat, 14 September 2013 13:14 Go to previous messageGo to next message
Alan DW is currently offline Alan DWFriend
Messages: 119
Registered: March 2012
Senior Member
No answer means that it is impossible? The problem is still open...
Re: CheckboxTableViewer with more than 2 columns? [message #1109675 is a reply to message #1108846] Sun, 15 September 2013 20:28 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
You need to set a label provider / column!

Tom

On 14.09.13 15:14, Alan DW wrote:
> No answer means that it is impossible? The problem is still open...
Re: CheckboxTableViewer with more than 2 columns? [message #1115643 is a reply to message #1103227] Tue, 24 September 2013 11:29 Go to previous messageGo to next message
Lakshmi P ShanmugamFriend
Messages: 279
Registered: July 2009
Location: India
Senior Member
You can find some tableviewer examples here -- http://wiki.eclipse.org/JFaceSnippets

Lakshmi P Shanmugam
Re: CheckboxTableViewer with more than 2 columns? [message #1115658 is a reply to message #1115643] Tue, 24 September 2013 11:51 Go to previous message
Alan DW is currently offline Alan DWFriend
Messages: 119
Registered: March 2012
Senior Member
Hello,

thanks you two, I think I can get it done now with the hints and resources you provided.

Thanks a lot!


Alan
Previous Topic:How can I associate custom widgets with TreeItems in SWT?
Next Topic:SWT "/dev/null" driver?
Goto Forum:
  


Current Time: Thu Mar 28 18:41:04 GMT 2024

Powered by FUDForum. Page generated in 0.02216 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top