示例#1
0
  public void navigateTo(String rawHref) {

    this.prevIndex = this.getIndex();
    this.prevPos = this.getPosition();

    // URLDecode the href, so it does not contain %20 etc.
    String href =
        URLDecoder.decode(StringUtil.substringBefore(rawHref, Constants.FRAGMENT_SEPARATOR_CHAR));

    // Don't decode the anchor.
    String anchor = StringUtil.substringAfterLast(rawHref, Constants.FRAGMENT_SEPARATOR_CHAR);

    if (!"".equals(anchor)) {
      this.storedAnchor = anchor;
    }

    // Just an anchor and no href; resolve it on this page
    if (href.length() == 0) {
      restorePosition();
    } else {

      this.strategy.clearText();
      this.strategy.setPosition(0);

      if (this.spine.navigateByHref(href)) {
        loadText();
      } else {
        executeTask(new LoadTextTask(), href);
      }
    }
  }
示例#2
0
 private void loadText(List<SearchTextTask.SearchResult> hightListResults) {
   executeTask(new LoadTextTask(hightListResults));
 }
示例#3
0
 void loadText() {
   executeTask(new LoadTextTask());
 }