Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Problem with TableTreeViewer and CheckboxTreeViewer -- HELP NEEDED!
Problem with TableTreeViewer and CheckboxTreeViewer -- HELP NEEDED! [message #463758] Mon, 14 November 2005 14:59 Go to next message
Eclipse UserFriend
Originally posted by: preetamp.aftek.com

Hi,
I have created a checked box table tree using
checkboxTableTreeViewer = new TableTreeViewer(parent, SWT.CHECK);
and have associated a table tree editor like
........
final TableTreeEditor tableTreeEditor = new TableTreeEditor(tableTree);
........

this works fine but now I want to listen for check event of the checked tree
?
How can I do this ?
I tried
CheckboxTreeViewer checkboxTreeViewer = new CheckboxTreeViewer(
checkboxTableTreeViewer.getTableTree());
checkboxTreeViewer.addCheckStateListener(new
CheckboxTreeViewerCheckStateChanged());

But the control never comes to CheckboxTreeViewerCheckStateChanged class
(function checkStateChanged )

Am I doing wrong ?
what's the correct way to create such a control ?
Thanks in advance
~Preetam
Re: Problem with TableTreeViewer and CheckboxTreeViewer -- HELP NEEDED! [message #463770 is a reply to message #463758] Mon, 14 November 2005 19:31 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
Since you created the underlying tree with the SWT.CHCK style you should use
Tree.addSelectionListener() and in the event.detail look for SWT.CHECK
to distinguish the checkbox selection from selecting the row.

"Preetam" <preetamp@aftek.com> wrote in message
news:dla9it$fn8$1@news.eclipse.org...
> Hi,
> I have created a checked box table tree using
> checkboxTableTreeViewer = new TableTreeViewer(parent, SWT.CHECK);
> and have associated a table tree editor like
> .......
> final TableTreeEditor tableTreeEditor = new TableTreeEditor(tableTree);
> .......
>
> this works fine but now I want to listen for check event of the checked
> tree
> ?
> How can I do this ?
> I tried
> CheckboxTreeViewer checkboxTreeViewer = new CheckboxTreeViewer(
> checkboxTableTreeViewer.getTableTree());
> checkboxTreeViewer.addCheckStateListener(new
> CheckboxTreeViewerCheckStateChanged());
>
> But the control never comes to CheckboxTreeViewerCheckStateChanged class
> (function checkStateChanged )
>
> Am I doing wrong ?
> what's the correct way to create such a control ?
> Thanks in advance
> ~Preetam
>
>
>
>
Re: Problem with TableTreeViewer and CheckboxTreeViewer -- HELP NEEDED! [message #464969 is a reply to message #463770] Fri, 02 December 2005 12:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: preetamp.aftek.com

Thanks !
I did that
But now i have one more problem !
The tree i created looks good on windows 2K
but does not look proper on Linux Fedora core 3
I means on fedora the nodes at verious levels of tree should get indented to
right. The tree hirarchy should get clear.
I m attaching the sample pic.
See that node1 has child node2 which has also a child node3
The relation between node1 and node2 does not get seen properly wheare as
the relation between node2 and node3 is clear deu to indentation !

Any clue ?

Thanks
~Preetam



"Veronika Irvine" <veronika_irvine@oti.com> wrote in message
news:dlaom2$7m3$1@news.eclipse.org...
> Since you created the underlying tree with the SWT.CHCK style you should
use
> Tree.addSelectionListener() and in the event.detail look for SWT.CHECK
> to distinguish the checkbox selection from selecting the row.
>
> "Preetam" <preetamp@aftek.com> wrote in message
> news:dla9it$fn8$1@news.eclipse.org...
> > Hi,
> > I have created a checked box table tree using
> > checkboxTableTreeViewer = new TableTreeViewer(parent, SWT.CHECK);
> > and have associated a table tree editor like
> > .......
> > final TableTreeEditor tableTreeEditor = new TableTreeEditor(tableTree);
> > .......
> >
> > this works fine but now I want to listen for check event of the checked
> > tree
> > ?
> > How can I do this ?
> > I tried
> > CheckboxTreeViewer checkboxTreeViewer = new CheckboxTreeViewer(
> > checkboxTableTreeViewer.getTableTree());
> > checkboxTreeViewer.addCheckStateListener(new
> > CheckboxTreeViewerCheckStateChanged());
> >
> > But the control never comes to CheckboxTreeViewerCheckStateChanged class
> > (function checkStateChanged )
> >
> > Am I doing wrong ?
> > what's the correct way to create such a control ?
> > Thanks in advance
> > ~Preetam
> >
> >
> >
> >
>
>


  • Attachment: tree.jpg
    (Size: 7.90KB, Downloaded 242 times)
Re: Problem with TableTreeViewer and CheckboxTreeViewer -- HELP NEEDED! [message #465094 is a reply to message #464969] Mon, 05 December 2005 21:54 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
This is a known problem on GTK - indentation is not supported. This is why
in 3.1 we deprecated TableTree and added support for Tree with TreeColumn.

See:
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet170.java?rev=HEAD& amp;content-type=text/vnd.viewcvs-markup

TreeViewer also supports TreeColumn.


"Preetam" <preetamp@aftek.com> wrote in message
news:dmpd62$5qv$1@news.eclipse.org...
> Thanks !
> I did that
> But now i have one more problem !
> The tree i created looks good on windows 2K
> but does not look proper on Linux Fedora core 3
> I means on fedora the nodes at verious levels of tree should get indented
> to
> right. The tree hirarchy should get clear.
> I m attaching the sample pic.
> See that node1 has child node2 which has also a child node3
> The relation between node1 and node2 does not get seen properly wheare as
> the relation between node2 and node3 is clear deu to indentation !
>
> Any clue ?
>
> Thanks
> ~Preetam
>
>
>
> "Veronika Irvine" <veronika_irvine@oti.com> wrote in message
> news:dlaom2$7m3$1@news.eclipse.org...
>> Since you created the underlying tree with the SWT.CHCK style you should
> use
>> Tree.addSelectionListener() and in the event.detail look for SWT.CHECK
>> to distinguish the checkbox selection from selecting the row.
>>
>> "Preetam" <preetamp@aftek.com> wrote in message
>> news:dla9it$fn8$1@news.eclipse.org...
>> > Hi,
>> > I have created a checked box table tree using
>> > checkboxTableTreeViewer = new TableTreeViewer(parent, SWT.CHECK);
>> > and have associated a table tree editor like
>> > .......
>> > final TableTreeEditor tableTreeEditor = new TableTreeEditor(tableTree);
>> > .......
>> >
>> > this works fine but now I want to listen for check event of the checked
>> > tree
>> > ?
>> > How can I do this ?
>> > I tried
>> > CheckboxTreeViewer checkboxTreeViewer = new CheckboxTreeViewer(
>> > checkboxTableTreeViewer.getTableTree());
>> > checkboxTreeViewer.addCheckStateListener(new
>> > CheckboxTreeViewerCheckStateChanged());
>> >
>> > But the control never comes to CheckboxTreeViewerCheckStateChanged
>> > class
>> > (function checkStateChanged )
>> >
>> > Am I doing wrong ?
>> > what's the correct way to create such a control ?
>> > Thanks in advance
>> > ~Preetam
>> >
>> >
>> >
>> >
>>
>>
>
>
>
Previous Topic:Popup windows / date entry content completition
Next Topic:Why is composites like Table not intended to be subclassed?
Goto Forum:
  


Current Time: Sun Dec 08 17:00:11 GMT 2024

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

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

Back to the top