- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {Connection c =
DataSource dataSource;dataSource.getConnection()
String url;DriverManager.getConnection(url)
IdentityDatabaseUtil.getDBConnection()
- Smart code suggestions by Codota
}
@Override public void onClick(View view) { myCollection.bindToService(EditBookmarkActivity.this, new Runnable() { public void run() { myCollection.deleteBookmark(myBookmark); finish(); } }); } });
@Override public void onDestroy() { myCollection.unbind(); super.onDestroy(); }
public void run() { if (myAllBooksAdapter != null) { return; } myAllBooksAdapter = new BookmarksAdapter(allBookListView, false); myCollection.addListener(BookMarksFragment.this); updateStyles(); loadBookmarks(); } });
private synchronized void deleteRootTree() { if (myRootTree != null) { myCollection.removeListener(this); myCollection.unbind(); myRootTree = null; } }
private void gotoBookmark(Bookmark bookmark) { bookmark.markAsAccessed(); myCollection.saveBookmark(bookmark); final Book book = myCollection.getBookById(bookmark.BookId); if (book != null) { KooReader.openBookActivity(this, book, bookmark); } else { UIMessageUtil.showErrorMessage(this, "cannotOpenBook"); } }
myKooReaderApp = (KooReaderApp) KooReaderApp.Instance(); if (myKooReaderApp == null) { myKooReaderApp = new KooReaderApp(Paths.systemInfo(this), new BookCollectionShadow()); getCollection().bindToService(this, null); // 绑定libraryService
public void run() { synchronized (myBookmarksLock) { for (BookmarkQuery query = new BookmarkQuery(myBook, 50); ; query = query.next()) { final List<Bookmark> thisBookBookmarks = myCollection.bookmarks(query); if (thisBookBookmarks.isEmpty()) { break; } myThisBookAdapter.addAll(thisBookBookmarks); // myAllBooksAdapter.addAll(thisBookBookmarks); } // for (BookmarkQuery query = new BookmarkQuery(50); ; query = query.next()) { // final List<Bookmark> allBookmarks = myCollection.bookmarks(query); // if (allBookmarks.isEmpty()) { // break; // } // myAllBooksAdapter.addAll(allBookmarks); // } } } }).start();
public void run() { setProgressBarIndeterminateVisibility(!myCollection.status().IsComplete); myRootTree = new RootTree(myCollection, PluginCollection.Instance(Paths.systemInfo(LibraryActivity.this))); myCollection.addListener(LibraryActivity.this); init(getIntent()); } });
private void updateStyles() { synchronized (myStyles) { myStyles.clear(); for (HighlightingStyle style : myCollection.highlightingStyles()) { myStyles.put(style.Id, style); } } }
@Override public boolean onContextItemSelected(MenuItem item) { final int position = ((AdapterView.AdapterContextMenuInfo) item.getMenuInfo()).position; final BookmarksAdapter adapter = myThisBookAdapter; final Bookmark bookmark = adapter.getItem(position); switch (item.getItemId()) { case OPEN_ITEM_ID: gotoBookmark(bookmark); return true; case EDIT_ITEM_ID: final Intent intent = new Intent(this, EditBookmarkActivity.class); intent.putExtra("bgColor", bgValue); KooReaderIntents.putBookmarkExtra(intent, bookmark); OrientationUtil.startActivity(this, intent); return true; case DELETE_ITEM_ID: myCollection.deleteBookmark(bookmark); return true; } return super.onContextItemSelected(item); }
public void run() { myStyle = myCollection.getHighlightingStyle(getIntent().getIntExtra(STYLE_ID_KEY, -1)); if (myStyle == null) { finish(); return; } screen.addPreference(new NamePreference()); screen.addPreference(new InvisiblePreference()); myBgColorPreference = new BgColorPreference(); screen.addPreference(myBgColorPreference); } });
public void onReceive(Context context, Intent intent) { if (!hasListeners()) { return; } try { final String type = intent.getStringExtra("type"); if (KooReaderIntents.Event.LIBRARY_BOOK.equals(intent.getAction())) { final Book book = SerializerUtil.deserializeBook(intent.getStringExtra("book"), BookCollectionShadow.this); fireBookEvent(BookEvent.valueOf(type), book); } else { fireBuildEvent(Status.valueOf(type)); } } catch (Exception e) { // ignore } } };
private void gotoBookmark(Bookmark bookmark) { bookmark.markAsAccessed(); myCollection.saveBookmark(bookmark); final Book book = myCollection.getBookById(bookmark.BookId); if (book != null) { KooReader.openBookActivity(this, book, bookmark); } else { UIMessageUtil.showErrorMessage(this, "cannotOpenBook"); } }
private synchronized void deleteRootTree() { if (myRootTree != null) { myCollection.removeListener(this); myCollection.unbind(); myRootTree = null; } }
myKooReaderApp = (KooReaderApp) KooReaderApp.Instance(); if (myKooReaderApp == null) { myKooReaderApp = new KooReaderApp(Paths.systemInfo(this), new BookCollectionShadow()); getCollection().bindToService(this, null); // 绑定libraryService
public void run() { synchronized (myBookmarksLock) { for (BookmarkQuery query = new BookmarkQuery(myBook, 50); ; query = query.next()) { final List<Bookmark> thisBookBookmarks = myCollection.bookmarks(query); if (thisBookBookmarks.isEmpty()) { break; } myThisBookAdapter.addAll(thisBookBookmarks); // myAllBooksAdapter.addAll(thisBookBookmarks); } // for (BookmarkQuery query = new BookmarkQuery(50); ; query = query.next()) { // final List<Bookmark> allBookmarks = myCollection.bookmarks(query); // if (allBookmarks.isEmpty()) { // break; // } // myAllBooksAdapter.addAll(allBookmarks); // } } } }).start();
public void run() { setProgressBarIndeterminateVisibility(!myCollection.status().IsComplete); myRootTree = new RootTree(myCollection, PluginCollection.Instance(Paths.systemInfo(LibraryActivity.this))); myCollection.addListener(LibraryActivity.this); init(getIntent()); } });
private void updateStyles() { synchronized (myStyles) { myStyles.clear(); for (HighlightingStyle style : myCollection.highlightingStyles()) { myStyles.put(style.Id, style); } } }
@Override public boolean onContextItemSelected(MenuItem item) { final int position = ((AdapterView.AdapterContextMenuInfo) item.getMenuInfo()).position; final String tag = myTabHost.getCurrentTabTag(); final BookmarksAdapter adapter; if ("thisBook".equals(tag)) { adapter = myThisBookAdapter; } else if ("allBooks".equals(tag)) { adapter = myAllBooksAdapter; } else if ("search".equals(tag)) { adapter = mySearchResultsAdapter; } else { throw new RuntimeException("Unknown tab tag: " + tag); } final Bookmark bookmark = adapter.getItem(position); switch (item.getItemId()) { case OPEN_ITEM_ID: gotoBookmark(bookmark); return true; case EDIT_ITEM_ID: final Intent intent = new Intent(this, EditBookmarkActivity.class); KooReaderIntents.putBookmarkExtra(intent, bookmark); OrientationUtil.startActivity(this, intent); return true; case DELETE_ITEM_ID: myCollection.deleteBookmark(bookmark); return true; } return super.onContextItemSelected(item); }
public void run() { myStyle = myCollection.getHighlightingStyle(getIntent().getIntExtra(STYLE_ID_KEY, -1)); if (myStyle == null) { finish(); return; } screen.addPreference(new NamePreference()); screen.addPreference(new InvisiblePreference()); myBgColorPreference = new BgColorPreference(); screen.addPreference(myBgColorPreference); } });