Exemplo n.º 1
0
  private void translateSelected() {
    if (getSelectedIndex() < 0) {
      return;
    }

    IArticle article = engine.getFinder().get(getSelectedIndex());

    model.bookmark(article);
    model.translate(article);

    selectAll();
  }
Exemplo n.º 2
0
  public void onDocumentChanged(DocumentEvent event) {
    if (!isNavigationEnabled) {
      return;
    }

    if (Strings.isEmpty(getSearchText())) {
      return;
    }

    int index = engine.getFinder().indexOfFirstLike(getSearchText());

    setSelectedIndex(index);
    ensureSelectedOnTop(index);
  }