GUI: search: stories with tags
authorNiki Roo <niki@nikiroo.be>
Wed, 17 Apr 2019 17:02:15 +0000 (19:02 +0200)
committerNiki Roo <niki@nikiroo.be>
Wed, 17 Apr 2019 17:02:15 +0000 (19:02 +0200)
src/be/nikiroo/fanfix/reader/ui/GuiReaderSearch.java

index c421ba6b006a43425aa735f6f1a0a4cc38ee95eb..f0285d789b7859e6b008344a273af517e5b75a88 100644 (file)
@@ -311,7 +311,22 @@ public class GuiReaderSearch extends JFrame {
                                        addTagBar(tag, new Runnable() {
                                                @Override
                                                public void run() {
-                                                       // TODO: stories if needed
+                                                       // TODO: slow ui
+                                                       SearchableTag tag = ((SearchableTag) combo
+                                                                       .getSelectedItem());
+                                                       if (tag != null && tag.isLeaf()) {
+                                                               BasicSearchable searchable = BasicSearchable
+                                                                               .getSearchable(supportType);
+                                                               List<MetaData> metas = new ArrayList<MetaData>();
+                                                               try {
+                                                                       metas = searchable.search(tag, 1);
+                                                                       search(metas, 1,
+                                                                                       searchable.searchPages(tag), 0);
+                                                               } catch (IOException e) {
+                                                                       error(e);
+                                                               }
+                                                       }
+                                                       
                                                        setWaitingScreen(false);
                                                }
                                        });
@@ -319,6 +334,7 @@ public class GuiReaderSearch extends JFrame {
                        }
                });
 
+               combos.add(combo);
                tagBars.add(combo);
        }
 
@@ -349,7 +365,6 @@ public class GuiReaderSearch extends JFrame {
                                                children = tag.getChildren();
                                        } else {
                                                children = null;
-                                               // TODO: stories
                                        }
                                }