GUI search
authorNiki Roo <niki@nikiroo.be>
Tue, 16 Apr 2019 17:19:45 +0000 (19:19 +0200)
committerNiki Roo <niki@nikiroo.be>
Tue, 16 Apr 2019 17:19:45 +0000 (19:19 +0200)
src/be/nikiroo/fanfix/reader/ui/GuiReaderGroup.java
src/be/nikiroo/fanfix/reader/ui/GuiReaderSearch.java

index 17bf43cbb455a66bb357e68ddb53f0d97d426ebb..a0023898bb5cadd31dc91be00e9e6c47727e2aea 100644 (file)
@@ -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<GuiReaderBookInfo>());
+       }
+
+       /**
+        * 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<GuiReaderBookInfo> infos) {
                refreshBooks(infos, words);
        }
 
index 6bc5fc612393a0c98f74a154eb3b5cc4d4dc114d..229b5dbde6a28111315d65e9d7724084b4db5bba 100644 (file)
@@ -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
                }
        }