private int maxPage;
private JPanel tagBars;
+ private List<JComboBox> combos;
private JComboBox comboSupportTypes;
private JTabbedPane searchTabs;
}
private JPanel createByTagSearchPanel() {
+ combos = new ArrayList<JComboBox>();
+
JPanel byTag = new JPanel();
tagBars = new JPanel();
tagBars.setLayout(new BoxLayout(tagBars, BoxLayout.Y_AXIS));
final SearchableTag selected) {
tags.add(0, null);
+ final int comboIndex = combos.size();
+
final JComboBox combo = new JComboBox(
tags.toArray(new SearchableTag[] {}));
combo.setSelectedItem(selected);
final SearchableTag tag = (SearchableTag) combo
.getSelectedItem();
if (tag != null) {
+ while (comboIndex + 1 < combos.size()) {
+ JComboBox combo = combos.remove(comboIndex + 1);
+ tagBars.remove(combo);
+ }
+
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);
}
});
}
});
+ combos.add(combo);
tagBars.add(combo);
}
children = tag.getChildren();
} else {
children = null;
- // TODO: stories
}
}