File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
app/src/processing/app/ui Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 3333import java .awt .event .MouseEvent ;
3434import java .io .File ;
3535import java .io .IOException ;
36+ import java .util .ArrayList ;
37+ import java .util .Comparator ;
3638import java .util .Enumeration ;
3739
3840import javax .swing .Box ;
5759import processing .app .Platform ;
5860import processing .app .Preferences ;
5961import processing .app .SketchReference ;
62+ import processing .app .contrib .Contribution ;
6063import processing .app .contrib .ContributionManager ;
6164import processing .app .contrib .ContributionType ;
6265import processing .app .contrib .ExamplesContribution ;
@@ -313,9 +316,11 @@ protected DefaultMutableTreeNode buildTree() {
313316 }
314317
315318 // Get examples for third party libraries
316- DefaultMutableTreeNode contributedLibExamples = new
317- DefaultMutableTreeNode (Language .text ("examples.libraries" ));
318- for (Library lib : mode .contribLibraries ) {
319+ DefaultMutableTreeNode contributedLibExamples = new DefaultMutableTreeNode (Language .text ("examples.libraries" ));
320+ var sortedContribLibs = new ArrayList <>(mode .contribLibraries );
321+ // Sort the libraries by actual name (not the name of the folder)
322+ sortedContribLibs .sort (Comparator .comparing (Contribution ::getName ));
323+ for (Library lib : sortedContribLibs ) {
319324 if (lib .hasExamples ()) {
320325 DefaultMutableTreeNode libNode =
321326 new DefaultMutableTreeNode (lib .getName ());
You can’t perform that action at this time.
0 commit comments