7

In addition is there any universal way of doing this which works for other types of projects (in other perspectives) as well?

Piotr Dobrogost
  • 41,292
  • 40
  • 236
  • 366
  • I don't know about PyDev but in the standard Eclipse Package Explorer, projects are _only_ sorted by name. – Matt Ball Jun 23 '11 at 12:54
  • I was looking for something similar, to see the package content sorted alphabetically instead of the order from inside the file. It's really hard to navigate through big modules without sorting. – sorin Sep 29 '11 at 10:11

4 Answers4

2

I was experiencing this (very annoying) problem, and I found a post by somebody on SourceForge having the same problem who said he discovered that if he added the project's root folder to its PYTHONPATH, it cleared up the problem. So I looked at my mis-alphabetized project's PYTHONPATH and saw that it already included the root folder in addition to the src folder. So just on a whim, I removed the root folder from PYTHONPATH. (I really should not have had it there anyway.) And although that was the opposite of what he said fixed his problem, it fixed my problem. Go figure.

Alan
  • 43
  • 7
2

The following worked for me:

  1. Add the project root to the projects PYTHONPATH
  2. Right click on project > Close Project
  3. Right click on project > Open Project

The problem projects then magically appeared in the right order.

0

As Matt already stated, the default and only behaviour of the Eclipse Navigator, which can be used in any perspective, is to sort the projects by name. My Eclipse version (3.6.2) gives me the option to sort resources by type but this applies to leafs of the tree (files) only.

But your question was about PyDevs navigator so I looked at the PyDev Package Explorer. I didn't find an option to change the sorting of projects. My current installed version is 2.7.1.x and as I can remember the same applies to 2.6.0.x.

So your question can't be answered directly because there is no way to change the sorting of projects without putting your hands on the source code of the plug-ins or extending the navigators (if a corresponding extension point exists).

Kai K.
  • 434
  • 4
  • 16
  • Navigator is superseded by Project Explorer – Piotr Dobrogost Nov 14 '12 at 08:05
  • @Piotr you're right but the Project Explorer has no option to change the sorting too. But even now after opening that view I discovered/recognized that the projects in my current workspace are not really sorted alphabetically. `My_Project_VV` is listed before `My_Project_SW` and the same order is displayed by the PyDev Package explorer. The C/C++ Projects view shows the same order as the Navigator (after disabling the filter of none C elements). I had a short look at the sources of PyDev but didn't find an obvious reason. May be this is a bug of PyDev or the CommonNavigator framework. – Kai K. Nov 14 '12 at 09:54
0

My solution to the problem was to go to the ViewMenu icon in the PyDevPackageExplorer and choose Select Working Set. In the Select Working Set window I left the selection as No Working Sets and clicked OK. This appears to have refreshed the alphabetical order as everything is sorted correctly now.

Technext
  • 7,887
  • 9
  • 48
  • 76