private void refreshTreeSort() {
		if (tree.getRoot() instanceof WorkspaceTreeNode root) {
			Comparator<WorkspaceTreeNode> comparator = (a, b) -> {
				Object valueA = a.getValue().getValue();
				Object valueB = b.getValue().getValue();

				// Sort by visibility first.
				int result = 0;
				if (sortByVisibility.get()) {
					if (valueA instanceof Accessed accessedA && valueB instanceof Accessed accessedB) {
						result = Visibility.of(accessedA).compareTo(Visibility.of(accessedB));
					}
				}

				// Then by alphabetic order.
				if (result == 0 && sortAlphabetically.get()) {
					if (valueA instanceof Named namedA && valueB instanceof Named namedB) {
						result = CaseInsensitiveSimpleNaturalComparator.getInstance().compare(namedA.getName(), namedB.getName());
					}
				}

				// Then by default order.
				if (result == 0)
					return a.compareTo(b);

				return result;
			};
			root.sortChildren(comparator);
		}
	}
Called when a sort input is updated, which should trigger re-computation of cell order in the tree.
recaf-ui/src/main/java/software/coley/recaf/ui/pane/editing/tabs/FieldsAndMethodsPane.java