From a12b668f37bdaf852ca2377739fd73b610f928c8 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Tue, 16 Apr 2019 19:19:45 +0200 Subject: [PATCH] GUI search --- .../fanfix/reader/ui/GuiReaderGroup.java | 27 +++++++++++++++++++ .../fanfix/reader/ui/GuiReaderSearch.java | 3 ++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/be/nikiroo/fanfix/reader/ui/GuiReaderGroup.java b/src/be/nikiroo/fanfix/reader/ui/GuiReaderGroup.java index 17bf43c..a002389 100644 --- a/src/be/nikiroo/fanfix/reader/ui/GuiReaderGroup.java +++ b/src/be/nikiroo/fanfix/reader/ui/GuiReaderGroup.java @@ -197,6 +197,33 @@ public class GuiReaderGroup extends JPanel { */ public void setActionListener(BookActionListener action) { this.action = action; + refreshBooks(); + } + + /** + * Clear all the books in this {@link GuiReaderGroup}. + */ + public void clear() { + refreshBooks(new ArrayList()); + } + + /** + * Refresh the list of {@link GuiReaderBook}s displayed in the control. + * + * @param infos + * the new list of infos + */ + public void refreshBooks() { + refreshBooks(infos, words); + } + + /** + * Refresh the list of {@link GuiReaderBook}s displayed in the control. + * + * @param infos + * the new list of infos + */ + public void refreshBooks(List infos) { refreshBooks(infos, words); } diff --git a/src/be/nikiroo/fanfix/reader/ui/GuiReaderSearch.java b/src/be/nikiroo/fanfix/reader/ui/GuiReaderSearch.java index 6bc5fc6..229b5db 100644 --- a/src/be/nikiroo/fanfix/reader/ui/GuiReaderSearch.java +++ b/src/be/nikiroo/fanfix/reader/ui/GuiReaderSearch.java @@ -147,7 +147,8 @@ public class GuiReaderSearch extends JFrame { if (supportType != this.supportType) { this.supportType = supportType; comboSupportTypes.setSelectedItem(supportType); - // TODO: reset all + books.clear(); + // TODO: reset all tags } } -- 2.27.0