Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6630491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:24:42+00:00 2026-05-25T22:24:42+00:00

I have a pretty weird question – how to sort glazed TreeList? I am

  • 0

I have a pretty weird question – how to sort glazed TreeList? I am using it in SWT NatTable, and when my data provider is set to GlazedListsDataProvider with TreeList inside it, sorting works in a very strange way. It works fine, if I am using GlazedListsDataProvider with SortedList.

For instance, my tree looks like that:

Root
  Node1
   Child1
   Child2
  Node2
   Child3

I need to sort only children INSIDE Node1 and Node2, separately one of another (so that only child1 and child2 will change their place). However, After sorting it looks like following:

Root
  Node1
  Node2
   Child1
   Child2
   Child3

Reversed sorting:

Root
  Node1
  Node2
   Child2
   Child1
   Child3

So basically, it kind of working (it does sort children in a correct way), but moreover it sorts elements, which it should not sort. What could be a reason of such behavior? My sorting algorithm is simple:

compare (element1, element2) {
   if (both elements are under same parent and have same type)
     compare
   otherwise
     return 0
   }

I am doing sorting as proposed in following example http://kari.dy.fi/src/sample/foldertree.zip – meaning, that after comparator is build in SortState I am setting it into the TreeFormat, used by TreeList.

I assume, that returning 0 does not work in a correct way, however, I can not see other solution. Or may be it is a problem somewhere else, not in my comparator.

Thank you for your patience, I will be glad to get any hints.
Best regards, Alex G.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T22:24:43+00:00Added an answer on May 25, 2026 at 10:24 pm

    So, here is my solution for this problem: DZone Article. Once again, it is only one of the possible solutions, and it is not perfect, but it is working:)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a pretty standard table set-up in a current application using the .NET
I have pretty weird question. In my ASP.NET MVC application I defined 1 Timer
This is pretty weird. I have my Profiler open and it obviously shows that
i have pretty simple simple question (i hope so). How do i change the
i have a quite weird question which probably has no practical use but the
This is pretty weird. I have my public key added at host machine. I
I have a pretty weird situation here, and i came up with a very
I have one very weird question. There are 2 Silverlight Client 1. Admin 2.
Some time in the last hour some pretty weird things have been happening with
I have pretty much finished my first working Symbian application, but in my hastened

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.