super.start(target, program, sync);
}
}
-
+
@Override
public void search(SupportType searchOn, String keywords, int page, int item) {
// TODO: !!!
throw new java.lang.IllegalStateException("Not implemented yet.");
}
-
+
@Override
- public void searchTag(SupportType searchOn, int page, int item, String... tags) {
+ public void searchTag(SupportType searchOn, int page, int item,
+ Integer... tags) {
// TODO: !!!
throw new java.lang.IllegalStateException("Not implemented yet.");
}
*/
public GuiReaderFrame(GuiReader reader, String type) {
super(getAppTitle(reader.getLibrary().getLibraryName()));
-
+
this.reader = reader;
mainPanel = new GuiReaderMainPanel(this, type);
JMenu search = new JMenu(GuiReader.trans(StringIdGui.MENU_SEARCH));
search.setMnemonic(KeyEvent.VK_H);
- for (SupportType type : SupportType.values()) {
+ for (final SupportType type : SupportType.values()) {
BasicSearchable searchable = BasicSearchable.getSearchable(type);
if (searchable != null) {
JMenuItem searchItem = new JMenuItem(type.getSourceName());
searchItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
- // TODO: open a search window
+ reader.search(type, "", 1, 0);
}
});
search.add(searchItem);
}
}
-
+
bar.add(search);
-
+
JMenu view = new JMenu(GuiReader.trans(StringIdGui.MENU_VIEW));
view.setMnemonic(KeyEvent.VK_V);
JMenuItem vauthors = new JMenuItem(
fc.showDialog(GuiReaderFrame.this,
GuiReader.trans(StringIdGui.TITLE_SAVE));
if (fc.getSelectedFile() != null) {
- final OutputType type = otherFilters.get(fc.getFileFilter());
+ final OutputType type = otherFilters.get(fc
+ .getFileFilter());
final String path = fc.getSelectedFile()
.getAbsolutePath()
+ type.getDefaultExtension(false);
final GuiReaderBook selectedBook = mainPanel.getSelectedBook();
if (selectedBook != null) {
final MetaData meta = selectedBook.getInfo().getMeta();
- mainPanel.imprt(
- meta.getUrl(),
- new StoryRunnable() {
- @Override
- public void run(Story story) {
- MetaData newMeta = story.getMeta();
- if (!newMeta.getSource().equals(
- meta.getSource())) {
- reader.changeSource(newMeta.getLuid(),
- meta.getSource());
- }
- }
- },
- GuiReader
- .trans(StringIdGui.PROGRESS_CHANGE_SOURCE));
+ mainPanel.imprt(meta.getUrl(), new StoryRunnable() {
+ @Override
+ public void run(Story story) {
+ MetaData newMeta = story.getMeta();
+ if (!newMeta.getSource().equals(meta.getSource())) {
+ reader.changeSource(newMeta.getLuid(),
+ meta.getSource());
+ }
+ }
+ }, GuiReader.trans(StringIdGui.PROGRESS_CHANGE_SOURCE));
}
}
});