private static void saveBookmarks(String filename, List<Bookmark> bookmarks) throws IOException { BufferedWriter bw = new BufferedWriter(new FileWriter(filename)); for (Bookmark bm : bookmarks) { bw.write( bm.getReference() + "\t" + bm.getRange().getFrom() + "\t" + bm.getRange().getTo() + "\t" + bm.getAnnotation() + "\n"); } bw.close(); }
public void goToBookmark(int viewRow) { if (viewRow == -1 || table.getRowCount() == 0) { return; } LocationController lc = LocationController.getInstance(); BookmarksTableModel tableModel = (BookmarksTableModel) table.getModel(); Bookmark bookmark = tableModel.getData().get(table.convertRowIndexToModel(viewRow)); lc.setLocation(bookmark.getReference(), (Range) bookmark.getRange()); }