NodeSortOrder (@NotNull NodeSortSettings settings) { if (getVirtualFile().isDirectory()) { if (settings.isSortByType() && isPackage(getIcon())) return NodeSortOrder.PACKAGE; if (settings.isSortByType() || settings.isFoldersAlwaysOnTop()) return NodeSortOrder.FOLDER; } return super.getSortOrder(settings); }