TreeViewer with only one TreeViewerColumn [message #731675] |
Sun, 02 October 2011 12:13 |
sielver Mising name Messages: 42 Registered: September 2011 |
Member |
|
|
Hello,
So I have a TreeViewer and I want to add editing support to it.
I used to use the setCellEditors/setCellModifier methods directly on my TreeViewer instance but I noticed the setEditingSupport was the new, preferred way of doing this (and it seems more handy):
// In my TreeViewer constructor
TreeViewerColumn column = new TreeViewerColumn(this, SWT.NONE);
column.setEditingSupport(new EditingSupport(this));
column.setLabelProvider(new LabelProvider());
column.getColumn().setText("Column 1");
column.getColumn().setWidth(???); // Here's the question
So I have to specify a witdh for the column to be visible. Is there an easy way to have it take the full size of the tree all the time? I heard about adding some listeners and calling pack() on the TreeColumn but I'm not sure how to do that, and I wonder if there's anything handier.
Any idea?
Thanks,
-Jérémy
[Updated on: Sun, 02 October 2011 12:13] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04709 seconds