+ @Override
+ public void search(SupportType searchOn, String keywords, int page, int item) throws IOException {
+ reader.search(searchOn, keywords, page, item);
+ }
+
+ @Override
+ public void searchTag(SupportType searchOn, int page, int item,
+ Integer... tags) throws IOException {
+ reader.searchTag(searchOn, page, item, tags);
+ }
+
+ /**
+ * Open the given {@link Story} for reading. This may or may not start an
+ * external program to read said {@link Story}.
+ *
+ * @param story
+ * the {@link Story} to read
+ * @param sync
+ * execute the process synchronously (wait until it is terminated
+ * before returning)
+ *
+ * @throws IOException
+ * in case of I/O errors
+ */
+ public void read(Story story, boolean sync) throws IOException {
+ if (story == null) {
+ throw new IOException("No story to read");
+ }
+
+ // TODO: open in editor + external option
+ if (!story.getMeta().isImageDocument()) {
+ TWindow window = new TuiReaderStoryWindow(this, story, getChapter());
+ window.maximize();
+ } else {
+ try {
+ openExternal(getLibrary(), story.getMeta().getLuid(), sync);
+ } catch (IOException e) {
+ messageBox("Error when trying to open the story",
+ e.getMessage(), TMessageBox.Type.OK);
+ }
+ }
+ }
+