如何在 Eclipse 中的 PyDev Package Explorer 中按名称字母顺序对项目进行排序?
此外,是否有任何通用的方法可以适用于其他类型的项目(从其他角度来看)?
In addition is there any universal way of doing this which works for other types of projects (in other perspectives) as well?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我遇到了这个(非常烦人的)问题,我在 SourceForge 上发现了一个有同样问题的人的帖子,他说他发现如果他将项目的根文件夹添加到其 PYTHONPATH 中,就可以解决问题。因此,我查看了按字母顺序排列错误的项目的 PYTHONPATH,发现除了 src 文件夹之外,它还包含根文件夹。所以一时兴起,我从 PYTHONPATH 中删除了根文件夹。 (无论如何我真的不应该把它放在那里。)虽然这与他所说的解决他的问题相反,但它解决了我的问题。去算算吧。
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.
以下对我有用:
然后问题项目神奇地以正确的顺序出现。
The following worked for me:
The problem projects then magically appeared in the right order.
正如 Matt 已经指出的,可在任何透视图中使用的 Eclipse Navigator 的默认且唯一行为是按名称对项目进行排序。我的 Eclipse 版本 (3.6.2) 提供了按类型对资源进行排序的选项,但这仅适用于树的叶子(文件)。
但你的问题是关于 PyDevs navigator,所以我查看了 PyDev Package Explorer。我没有找到更改项目排序的选项。我当前安装的版本是 2.7.1.x,我记得这同样适用于 2.6.0.x。
因此,您的问题无法直接回答,因为如果不接触插件的源代码或扩展导航器(如果存在相应的扩展点),就无法更改项目的排序。
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).
我对该问题的解决方案是转到
PyDevPackageExplorer
中的ViewMenu
图标,然后选择选择工作集
。在“选择工作集”窗口中,我将选择保留为“无工作集”,然后单击“确定”。这似乎刷新了字母顺序,因为现在所有内容都已正确排序。My solution to the problem was to go to the
ViewMenu
icon in thePyDevPackageExplorer
and chooseSelect Working Set
. In theSelect Working Set
window I left the selection asNo Working Sets
and clicked OK. This appears to have refreshed the alphabetical order as everything is sorted correctly now.