bug6239: adjust selection model when *all* list of filterable panel has elements removed

This commit is contained in:
Axel Uhl committed 2026-05-04 14:53:06 +02:00
1 parent 9dca151018
commit 2daeb3f7a1
1 file changed
+3
@@ -272,6 +272,7 @@ public abstract class AbstractFilterablePanel<T> extends HorizontalPanel {
* Removes an object and applies the search filter.
*/
public void remove(T object) {
select(object, false); // clear the object that was removed from the selection
all.getList().remove(object);
filter();
}
@@ -287,11 +288,13 @@ public abstract class AbstractFilterablePanel<T> extends HorizontalPanel {
* <code>removeAll(all)</code> with <code>all</code> being a copy of what you get when calling {@link #getAll()}.
*/
public void removeAll() {
deselectAll();
all.getList().clear();
filter();
}
public void removeAll(Iterable<T> objects) {
objects.forEach(o->select(o, false)); // clear those objects removed from the selection
Util.removeAll(objects, all.getList());
filter();
}