Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » TreeViewer with only one TreeViewerColumn (How to have it resize automatically?)
TreeViewer with only one TreeViewerColumn [message #731675] Sun, 02 October 2011 08:13 Go to previous message
sielver Missing name is currently offline sielver Missing name
Messages: 39
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 08:13]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:huge polyline performance
Next Topic:Custom Tree Selection mechanism
Goto Forum:
  


Current Time: Sun May 19 15:29:41 EDT 2013

Powered by FUDForum. Page generated in 0.01710 seconds