Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » TreeViewer with checkboxes
TreeViewer with checkboxes [message #556327] Tue, 31 August 2010 19:31 Go to next message
No real name is currently offline No real nameFriend
Messages: 3
Registered: August 2010
Junior Member
Hi

My problem is TreeViewer, i have been created LabelProvider and ContentProvider. I get some correct data on my treeviewer. I have been initialized my Treeviewer like this TreeViewer(SWT.CHECK);

This way i can get checkboxes on my treeviewer rows.
But i want to show checkboxes only parent rows, like this
 _ 
I_I Parent
      Child
      Child
       _
      I_I Parent
            Child
            Child


I hope that u guys get what i wanted to do and you can help me with this.


Kokkonen
Re: TreeViewer with checkboxes [message #556605 is a reply to message #556327] Thu, 02 September 2010 05:08 Go to previous messageGo to next message
Matthew Hall is currently offline Matthew HallFriend
Messages: 368
Registered: July 2009
Senior Member
Kokkonen,

To my knowledge, the native Tree control (and by extension TreeViewer
and CheckboxTreeViewer) does not support this.

You may want to take a look at the Nebula Grid control and see if it
does what you need.

http://www.eclipse.org/nebula/widgets/grid/grid.php

FYI, the Grid control is supported on the eclipse.technology.nebula
newsgroup.

Matthew

On 08/31/2010 01:31 PM, juho.kokkonen@rivakka.net wrote:
> Hi
>
> My problem is TreeViewer, i have been created LabelProvider and
> ContentProvider. I get some correct data on my treeviewer. I have been
> initialized my Treeviewer like this TreeViewer(SWT.CHECK);
>
> This way i can get checkboxes on my treeviewer rows.
> But i want to show checkboxes only parent rows, like this
>
> _ I_I Parent
> Child
> Child
> _
> I_I Parent
> Child
> Child
>
>
> I hope that u guys get what i wanted to do and you can help me with this.
>
>
> Kokkonen
Re: TreeViewer with checkboxes [message #556618 is a reply to message #556327] Thu, 02 September 2010 06:56 Go to previous messageGo to next message
Lakshmi ShanmugamFriend
Messages: 274
Registered: July 2009
Location: India
Senior Member
Hi,

Here is an old thread on a similar question and a possible solution --> http://dev.eclipse.org/newslists/news.eclipse.platform.swt/m sg26898.html


Lakshmi P Shanmugam
Re: TreeViewer with checkboxes [message #558073 is a reply to message #556327] Fri, 10 September 2010 06:30 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 3
Registered: August 2010
Junior Member
Hi

Ok it seems that i have to play with images.

Well i try this image fake solution and it works, BUT now i have only one image and it is checked or unchecked image.

Problem is that i want to put at least two images on same row.

I try to put TreeViewerColumns but when i open nodes only first column was indented, so when i open nodes first column get's under second column and disappears.

Anykind of solutions for this problem is welcome!!

Kokkonen
Re: TreeViewer with checkboxes [message #665917 is a reply to message #556327] Mon, 18 April 2011 07:25 Go to previous messageGo to next message
jim liu is currently offline jim liuFriend
Messages: 37
Registered: February 2011
Location: shanghai
Member
Tree tree = new Tree(parent,SWT.CHECK);
TreeViewer treeViewer = new TreeViewer(tree);


java eclipse Search
http://javafind.appspot.com/
Re: TreeViewer with checkboxes [message #665921 is a reply to message #558073] Mon, 18 April 2011 07:55 Go to previous message
Carsten Habicht is currently offline Carsten HabichtFriend
Messages: 14
Registered: January 2011
Junior Member
Hey Kokkonen,

I've never done this for trees, but I would try to subscribe to paint events and then draw the images into the first row. If that is an option for you, have a look at this link: http://www.eclipse.org/articles/article.php?file=Article-Cus tomDrawingTableAndTreeItems/index.html

HTH
Carsten ;o)


Sylphen - Ihr Systemhaus in Mittelhessen - http://www.sylphen.com/
Previous Topic:Exceptions and DataBindingContext.bindXXX methods
Next Topic:TreeViewer Selection problem with ColumnViewerEditorActivationStrategy
Goto Forum:
  


Current Time: Sun Dec 21 06:54:03 GMT 2014

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

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