Skip to main content



      Home
Home » Newcomers » Newcomers » eclipse - how to change package explorer sorting order (don't want lexicographic sorting)?
eclipse - how to change package explorer sorting order (don't want lexicographic sorting)? [message #991390] Tue, 18 December 2012 16:01 Go to next message
Eclipse UserFriend
index.php/fa/12739/0/Is there a way I can have it:

Sonication1
Sonication2
Sonication3
...

These folders are generated by a different program, so I cannot rename them to Sonication01, etc. This is causing me so much headache because my program will read log files from the main directory in this order, so the values for Sonication2 are actually the values for Sonication10 and vice versa.
  • Attachment: lexico.jpg
    (Size: 34.75KB, Downloaded 1229 times)
Re: eclipse - how to change package explorer sorting order (don't want lexicographic sorting)? [message #991417 is a reply to message #991390] Tue, 18 December 2012 20:07 Go to previous messageGo to next message
Eclipse UserFriend
Leon,

No, you can't change the order. I wonder though, is there actually a
relation between your program that reads log files and the package
explore's display order? It seems clear you need to fix your program
(not the explorer) to do the sorting your want.


On 18/12/2012 2:01 PM, Leon Kingston wrote:
> Is there a way I can have it:
>
> Sonication1
> Sonication2
> Sonication3
> ..
>
> These folders are generated by a different program, so I cannot rename them to Sonication01, etc. This is causing me so much headache because my program will read log files from the main directory in this order, so the values for Sonication2 are actually the values for Sonication10 and vice versa.
Re: eclipse - how to change package explorer sorting order (don't want lexicographic sorting)? [message #991418 is a reply to message #991417] Tue, 18 December 2012 21:09 Go to previous message
Eclipse UserFriend
Ed,

You're totally right. I actually didn't write the part of this program that read the logs, so I didn't want to touch the code for that, but your post helped me find a really critical bug. While I thought Eclipse was the problem, it turns out that was not the case and Eclipse just helped me see what the issue was!

First thing I noticed was that everything was in the wrong place (i.e. Sonication2's values were actually Sonication10's). Then I noticed Eclipse had the files listed in this manner, so I immediately blamed it without thinking and wanted a way to properly sort them in the package explorer, figuring this was the order it read the files. Well it was, but it didn't read them like that just because Eclipse listed them like that! With further research, I learned this was lexicographic order. In the code that reads these logs, there was a typical Java File[] array from created by listFiles(), and a loop that would go through this array to get all the filenames. Then, I found out listFiles() ALSO sorts in lexicographic order! I just had to resort the array it created that in alphabetical order and the program reads perfectly now. Smile

Cheers!

[Updated on: Tue, 18 December 2012 21:10] by Moderator

Previous Topic:Hiding the show view toolbar
Next Topic:Using a downloaded eclipse plug-in
Goto Forum:
  


Current Time: Tue Jul 22 12:50:22 EDT 2025

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

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

Back to the top