Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » TreeViewer with special rendering for items
TreeViewer with special rendering for items [message #502219] Mon, 07 December 2009 04:41 Go to next message
cdsosi is currently offline cdsosi
Messages: 10
Registered: November 2009
Junior Member
Hi,
Question about TreeViewers :

The basic rendering often presented as examples is a class implementing the interface ILabelProvider which defines two methods public Image getImage(Object element) and public String getText(Object element). This instance of ILabelProvider is parameter of the setLabelProvider method on the Treeviewer.

The question is :
Is it possible to build a TreeViewer with special rendering for items visible in the tree (setting a more sophisticated rendering with StyledText for instance)?
I want for example to have a particular background color for special items in the tree or special fonts, ...

Any help would be appreciated.

Regards
Re: TreeViewer with special rendering for items [message #502235 is a reply to message #502219] Mon, 07 December 2009 05:48 Go to previous message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5281
Registered: July 2009
Senior Member
http://wiki.eclipse.org/JFaceSnippets#Snippet049StyledCellLa belProvider
cdsosi schrieb:
> Hi,
> Question about TreeViewers :
>
> The basic rendering often presented as examples is a class implementing
> the interface ILabelProvider which defines two methods public Image
> getImage(Object element) and public String getText(Object element). This
> instance of ILabelProvider is parameter of the setLabelProvider method
> on the Treeviewer.
>
> The question is :
> Is it possible to build a TreeViewer with special rendering for items
> visible in the tree (setting a more sophisticated rendering with
> StyledText for instance)?
> I want for example to have a particular background color for special
> items in the tree or special fonts, ...
>
> Any help would be appreciated.
>
> Regards
>
Previous Topic:Add a MultiButtonCellEditor to a tableViewer
Next Topic:Why doesn't my Composite receive Keyboard events even after I call setFocus?
Goto Forum:
  


Current Time: Thu Aug 21 20:16:08 EDT 2014

Powered by FUDForum. Page generated in 0.01467 seconds