private void translateSelected() { if (getSelectedIndex() < 0) { return; } IArticle article = engine.getFinder().get(getSelectedIndex()); model.bookmark(article); model.translate(article); selectAll(); }
public void onDocumentChanged(DocumentEvent event) { if (!isNavigationEnabled) { return; } if (Strings.isEmpty(getSearchText())) { return; } int index = engine.getFinder().indexOfFirstLike(getSearchText()); setSelectedIndex(index); ensureSelectedOnTop(index); }