Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » TreeViewer and LabelProvider
TreeViewer and LabelProvider [message #453459] Wed, 06 April 2005 06:20 Go to next message
Michael Pellaton is currently offline Michael PellatonFriend
Messages: 289
Registered: July 2009
Senior Member
Background:
I need to remove all deprecated code from a project migrated from RCP
3.0 to 3.1M6.

I am somewhat confused about the migration from TableTree to Tree:
- Why isn't TableTreeViewer deprecated as TableTree is?
- How am I supposed to do multi column trees using a label provider?
(TreeViewer only supports an ordinary ILabelProvider instead of a
ITableLabelProvider)

Any hints or comments are highly appreciated.

Michael Pellaton
Re: TreeViewer and LabelProvider [message #453464 is a reply to message #453459] Wed, 06 April 2005 13:22 Go to previous messageGo to next message
Koen is currently offline KoenFriend
Messages: 26
Registered: July 2009
Junior Member
I have a the following label provider class and it works

class ViewLabelProvider extends LabelProvider implements ITableLabelProvider

Add columns to the tree of your viewer, this way the label provider will be
called with the column argument.

viewer.getTree().setLinesVisible(true);
TreeColumn tcTree = new TreeColumn(viewer.getTree(), SWT.LEFT);
tcTree.setWidth(200);
tcTree.setResizable(true);
TreeColumn tcIcon = new TreeColumn(viewer.getTree(), SWT.CENTER);
tcIcon.setResizable(false);
tcIcon.setWidth(50);


"Michael Pellaton" <newsgroups@pellaton.li> wrote in message
news:d2vvaq$euf$1@news.eclipse.org...
> Background:
> I need to remove all deprecated code from a project migrated from RCP
> 3.0 to 3.1M6.
>
> I am somewhat confused about the migration from TableTree to Tree:
> - Why isn't TableTreeViewer deprecated as TableTree is?
> - How am I supposed to do multi column trees using a label provider?
> (TreeViewer only supports an ordinary ILabelProvider instead of a
> ITableLabelProvider)
>
> Any hints or comments are highly appreciated.
>
> Michael Pellaton
Re: TreeViewer and LabelProvider [message #453618 is a reply to message #453464] Fri, 08 April 2005 08:25 Go to previous message
Michael Pellaton is currently offline Michael PellatonFriend
Messages: 289
Registered: July 2009
Senior Member
Thank you for your advice - it works now well!

One more question: Do you know how whether it is possible to make the
table cells in a Treetable editable?
Previous Topic:Canvas painting problem in the view of a simple plugin
Next Topic:pop-up blocked in SWT Browser control
Goto Forum:
  


Current Time: Sat Mar 06 06:46:51 GMT 2021

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

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

Back to the top