mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Project View: sort directories by type as well (e.g. OS X bundles .app, .framework)
This commit is contained in:
@@ -132,11 +132,11 @@ public class ProjectTreeSortingTest extends BaseProjectViewTestCase {
|
||||
((ProjectViewImpl)myProjectView).setFoldersAlwaysOnTop(false);
|
||||
assertTree("-foldersOnTop\n" +
|
||||
" a.java\n" +
|
||||
" +b.java\n" +
|
||||
" c.java\n" +
|
||||
" a.txt\n" +
|
||||
" c.txt\n" +
|
||||
" +b.java\n" +
|
||||
" +b.txt\n");
|
||||
" +b.txt\n"+
|
||||
" c.txt\n");
|
||||
}
|
||||
|
||||
public void testSortByTypeBetweenFilesAndFolders() throws Exception {
|
||||
@@ -156,11 +156,11 @@ public class ProjectTreeSortingTest extends BaseProjectViewTestCase {
|
||||
assertTree("-sortByTypeBetweenFilesAndFolders\n" +
|
||||
" a.java\n" +
|
||||
" b.java\n" +
|
||||
" +a.java_folder\n" +
|
||||
" +b.java_folder\n" +
|
||||
" a.txt\n" +
|
||||
" b.txt\n" +
|
||||
" +a.java_folder\n" +
|
||||
" +a_folder\n" +
|
||||
" +b.java_folder\n" +
|
||||
" +b_folder\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -318,6 +318,14 @@ public class PsiDirectoryNode extends BasePsiNode<PsiDirectory> implements Navig
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Comparable getTypeSortKey() {
|
||||
VirtualFile file = getVirtualFile();
|
||||
if (file == null) return null;
|
||||
String extension = file.getExtension();
|
||||
return extension == null ? null : new PsiFileNode.ExtensionSortKey(extension);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getQualifiedNameSortKey() {
|
||||
final PsiDirectoryFactory factory = PsiDirectoryFactory.getInstance(getProject());
|
||||
|
||||
Reference in New Issue
Block a user