mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-16 11:21:18 +03:00
Library Manager: added Type filter dropdown
This commit is contained in:
@ -62,6 +62,8 @@ public abstract class ContributedLibrary extends DownloadableContribution {
|
||||
|
||||
public abstract List<String> getArchitectures();
|
||||
|
||||
public abstract List<String> getTypes();
|
||||
|
||||
public abstract List<ContributedLibraryReference> getRequires();
|
||||
|
||||
private boolean readOnly;
|
||||
|
@ -62,4 +62,18 @@ public abstract class LibrariesIndex {
|
||||
|
||||
return categories;
|
||||
}
|
||||
|
||||
public List<String> getTypes() {
|
||||
Collection<String> typesAccumulator = new HashSet<String>();
|
||||
for (ContributedLibrary lib : getLibraries()) {
|
||||
if (lib.getTypes() != null) {
|
||||
typesAccumulator.addAll(lib.getTypes());
|
||||
}
|
||||
}
|
||||
|
||||
List<String> types = new LinkedList<String>(typesAccumulator);
|
||||
Collections.sort(types);
|
||||
|
||||
return types;
|
||||
}
|
||||
}
|
||||
|
@ -190,6 +190,11 @@ public class UserLibrary extends ContributedLibrary {
|
||||
return category;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTypes() {
|
||||
return Arrays.asList("Contributed");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLicense() {
|
||||
return license;
|
||||
|
Reference in New Issue
Block a user