mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-25 09:00:26 +00:00
Add support to search for custom store attributes
This commit is contained in:
parent
ac1fcf821d
commit
37dae87a2f
2 changed files with 13 additions and 1 deletions
|
@ -212,7 +212,15 @@ public class StoreEntryWrapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean shouldShow(String filter) {
|
public boolean shouldShow(String filter) {
|
||||||
return filter == null || nameProperty().getValue().toLowerCase().contains(filter.toLowerCase());
|
if (filter == null || nameProperty().getValue().toLowerCase().contains(filter.toLowerCase())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entry.getValidity().isUsable() && entry.getProvider().getSearchableTerms(entry.getStore()).stream().anyMatch(s -> s.toLowerCase().contains(filter.toLowerCase()))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Property<String> nameProperty() {
|
public Property<String> nameProperty() {
|
||||||
|
|
|
@ -49,6 +49,10 @@ public interface DataStoreProvider {
|
||||||
return e.orElse("?");
|
return e.orElse("?");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default List<String> getSearchableTerms(DataStore store) {
|
||||||
|
return List.of();
|
||||||
|
}
|
||||||
|
|
||||||
default boolean shouldEdit() {
|
default boolean shouldEdit() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue