File tree 1 file changed +5
-15
lines changed
app/src/cc/arduino/contributions/libraries/ui 1 file changed +5
-15
lines changed Original file line number Diff line number Diff line change 29
29
30
30
package cc .arduino .contributions .libraries .ui ;
31
31
32
- import cc .arduino .contributions .libraries .ContributedLibraryRelease ;
33
- import cc .arduino .contributions .libraries .ContributedLibrary ;
34
- import cc .arduino .contributions .ui .DropdownItem ;
32
+ import static processing .app .I18n .tr ;
35
33
36
- import java .util .Optional ;
37
34
import java .util .function .Predicate ;
38
35
39
- import static processing .app .I18n .tr ;
36
+ import cc .arduino .contributions .libraries .ContributedLibrary ;
37
+ import cc .arduino .contributions .libraries .filters .UpdatableLibraryPredicate ;
38
+ import cc .arduino .contributions .ui .DropdownItem ;
40
39
41
40
public class DropdownUpdatableLibrariesItem implements DropdownItem <ContributedLibrary > {
42
41
43
42
@ Override
44
43
public Predicate <ContributedLibrary > getFilterPredicate () {
45
- return new Predicate <ContributedLibrary >() {
46
- @ Override
47
- public boolean test (ContributedLibrary lib ) {
48
- Optional <ContributedLibraryRelease > mayInstalled = lib .getInstalled ();
49
- if (!mayInstalled .isPresent ()) {
50
- return false ;
51
- }
52
- return !lib .getLatest ().equals (mayInstalled .get ());
53
- }
54
- };
44
+ return new UpdatableLibraryPredicate ();
55
45
}
56
46
57
47
@ Override
You can’t perform that action at this time.
0 commit comments