Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » TreeViewer and LabelProvider
TreeViewer and LabelProvider [message #453459] Wed, 06 April 2005 02:20 Go to next message
Eclipse UserFriend
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 09:22 Go to previous messageGo to next message
Eclipse UserFriend
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 04:25 Go to previous message
Eclipse UserFriend
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: Thu Jul 03 10:30:02 EDT 2025

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

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

Back to the top