+ private void addSourcePanes() {
+ // Sources -> i18n
+ GuiReaderGroup bookPane = new GuiReaderGroup(reader, "Sources", color);
+
+ List<MetaData> sources = new ArrayList<MetaData>();
+ for (String source : reader.getLibrary().getSources()) {
+ MetaData mSource = new MetaData();
+ mSource.setLuid(null);
+ mSource.setTitle(source);
+ mSource.setSource(source);
+ sources.add(mSource);
+ }
+
+ bookPane.refreshBooks(sources, false);
+
+ this.invalidate();
+ pane.invalidate();
+ pane.add(bookPane);
+ pane.validate();
+ this.validate();
+
+ bookPane.setActionListener(new BookActionListener() {
+ @Override
+ public void select(GuiReaderBook book) {
+ selectedBook = book;
+ }
+
+ @Override
+ public void popupRequested(GuiReaderBook book, MouseEvent e) {
+ JPopupMenu popup = new JPopupMenu();
+ popup.add(createMenuItemOpenBook());
+ popup.show(e.getComponent(), e.getX(), e.getY());
+ }
+
+ @Override
+ public void action(final GuiReaderBook book) {
+ removeBookPanes();
+ addBookPane(book.getMeta().getSource(), true);
+ refreshBooks();
+ }
+ });
+ }
+