/** Sets the sort direction. This does not sort the data, it only serves * as an indicator as to how the tree is sorted. (unless the tree has "autosort" attribute) * * <p>If you use {@link #sort(boolean)} to sort treechildren ({@link Treeitem}), * the sort direction is maintained automatically. * If you want to sort it in customized way, you have to set the * sort direction manually. * @since 5.0.6 * @param sortDir one of "ascending", "descending" and "natural" */ public void setSortDirection(String sortDir) throws WrongValueException { if (sortDir == null || (!"ascending".equals(sortDir) && !"descending".equals(sortDir) && !"natural".equals(sortDir))) throw new WrongValueException("Unknown sort direction: " + sortDir); if (!Objects.equals(_sortDir, sortDir)) { _sortDir = sortDir; if (!"natural".equals(sortDir) && !_ignoreSort) { Tree tree = getTree(); if (tree != null && tree.isAutosort()) { doSort("ascending".equals(sortDir)); } } smartUpdate("sortDirection", _sortDir); } }
return false; final Tree tree = getTree(); if (tree == null) return false;