@@ -60,8 +60,17 @@ public void updateIndexFilter(String[] filters,
60
60
61
61
private void updateContributions () {
62
62
contributions .clear ();
63
+
64
+ // Generate ContributedPlatformReleases from all platform releases
63
65
for (ContributedPackage pack : BaseNoGui .indexer .getPackages ()) {
64
66
for (ContributedPlatform platform : pack .getPlatforms ()) {
67
+ addContribution (platform );
68
+ }
69
+ }
70
+
71
+ // Filter ContributedPlatformReleases based on search terms
72
+ contributions .removeIf (releases -> {
73
+ for (ContributedPlatform platform : releases .releases ) {
65
74
String compoundTargetSearchText = platform .getName () + "\n "
66
75
+ platform .getBoards ().stream ()
67
76
.map (ContributedBoard ::getName )
@@ -71,9 +80,12 @@ private void updateContributions() {
71
80
}
72
81
if (!stringContainsAll (compoundTargetSearchText , filters ))
73
82
continue ;
74
- addContribution ( platform ) ;
83
+ return false ;
75
84
}
76
- }
85
+ return true ;
86
+ });
87
+
88
+ // Sort ContributedPlatformReleases and put deprecated platforms to the bottom
77
89
Collections .sort (contributions , (x ,y )-> {
78
90
if (x .isDeprecated () != y .isDeprecated ()) {
79
91
return x .isDeprecated () ? 1 : -1 ;
@@ -86,6 +98,7 @@ private void updateContributions() {
86
98
}
87
99
return x1 .getName ().compareToIgnoreCase (y1 .getName ());
88
100
});
101
+
89
102
fireTableDataChanged ();
90
103
}
91
104
@@ -110,12 +123,12 @@ private boolean stringContainsAll(String string, String set[]) {
110
123
111
124
private void addContribution (ContributedPlatform platform ) {
112
125
for (ContributedPlatformReleases contribution : contributions ) {
113
- if (!contribution .shouldContain (platform ))
126
+ if (!contribution .shouldContain (platform )) {
114
127
continue ;
128
+ }
115
129
contribution .add (platform );
116
130
return ;
117
131
}
118
-
119
132
contributions .add (new ContributedPlatformReleases (platform ));
120
133
}
121
134
0 commit comments