Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » sort a tree with swt 3.1
sort a tree with swt 3.1 [message #465916] Thu, 22 December 2005 12:42 Go to next message
Eclipse User
Originally posted by: maxime.cailloux.cea.fr

Is it possible to sort a Tree in swt 3.1?
I want to sort a tree by treeItem name...
|-A
|-B
...

Could you help me please?

Thanks in advance,

Max
Re: sort a tree with swt 3.1 [message #465925 is a reply to message #465916] Thu, 22 December 2005 15:04 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika Irvine
Messages: 1272
Registered: July 2009
Senior Member
Tree.setSortColumn() and Tree.setSortDirection() were added in 3.2 and are
not available in 3.1.

In 3.2, when the column is made sortable, it is still up to the application
to change the order of the items around.

If I get some free time, I will make a snippet showing how to do this.

"M. Cailloux" <maxime.cailloux@cea.fr> wrote in message
news:c3b649afad33bb870a07dfa1068cb0e2$1@www.eclipse.org...
> Is it possible to sort a Tree in swt 3.1?
> I want to sort a tree by treeItem name...
> |-A
> |-B
> ..
>
> Could you help me please?
>
> Thanks in advance,
>
> Max
>
Re: sort a tree with swt 3.1 [message #465926 is a reply to message #465925] Thu, 22 December 2005 15:07 Go to previous message
Veronika Irvine is currently offline Veronika Irvine
Messages: 1272
Registered: July 2009
Senior Member
Here are some snippets showing how to sort a Table - sorting a Tree is a bit
trickier of course.

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

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

"Veronika Irvine" <veronika_irvine@oti.com> wrote in message
news:doefah$i8e$1@utils.eclipse.org...
> Tree.setSortColumn() and Tree.setSortDirection() were added in 3.2 and are
> not available in 3.1.
>
> In 3.2, when the column is made sortable, it is still up to the
> application to change the order of the items around.
>
> If I get some free time, I will make a snippet showing how to do this.
>
> "M. Cailloux" <maxime.cailloux@cea.fr> wrote in message
> news:c3b649afad33bb870a07dfa1068cb0e2$1@www.eclipse.org...
>> Is it possible to sort a Tree in swt 3.1?
>> I want to sort a tree by treeItem name...
>> |-A
>> |-B
>> ..
>>
>> Could you help me please?
>>
>> Thanks in advance,
>>
>> Max
>>
>
>
Previous Topic:X Window System Error using SWT_AWT Bridge on Linux
Next Topic:Get Color RGB under Cursor from Control ?
Goto Forum:
  


Current Time: Sat Oct 25 06:17:43 GMT 2014

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

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