File tree 1 file changed +13
-0
lines changed
app/src/cc/arduino/contributions/packages/ui
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 36
36
import processing .app .BaseNoGui ;
37
37
38
38
import java .util .ArrayList ;
39
+ import java .util .Collections ;
39
40
import java .util .List ;
40
41
import java .util .function .Predicate ;
41
42
import java .util .stream .Collectors ;
@@ -73,6 +74,18 @@ private void updateContributions() {
73
74
addContribution (platform );
74
75
}
75
76
}
77
+ Collections .sort (contributions , (x ,y )-> {
78
+ if (x .isDeprecated () != y .isDeprecated ()) {
79
+ return x .isDeprecated () ? 1 : -1 ;
80
+ }
81
+ ContributedPlatform x1 = x .getLatest ();
82
+ ContributedPlatform y1 = y .getLatest ();
83
+ int category = (x1 .getCategory ().equals ("Arduino" ) ? -1 : 0 ) + (y1 .getCategory ().equals ("Arduino" ) ? 1 : 0 );
84
+ if (category != 0 ) {
85
+ return category ;
86
+ }
87
+ return x1 .getName ().compareToIgnoreCase (y1 .getName ());
88
+ });
76
89
fireTableDataChanged ();
77
90
}
78
91
You can’t perform that action at this time.
0 commit comments