Package javax.help

Examples of javax.help.SearchTOCItem


      }
  }


  if(treeEnum.hasMoreElements()) {
      SearchTOCItem item = (SearchTOCItem) treeEnum.nextElement();
      setNodeAttributes(item);
      return EVAL_BODY_TAG;
  } else {
      return SKIP_BODY;
  }
View Full Code Here


  }

  // clear up so the next time the body content is empty
  body.clearBody();
  if(treeEnum.hasMoreElements()) {
      SearchTOCItem item = (SearchTOCItem) treeEnum.nextElement();
      setNodeAttributes(item);
      return EVAL_BODY_TAG;
  } else {
      return SKIP_BODY;
  }
View Full Code Here

  return retval;
    }
 

    public synchronized void itemsFound(SearchEvent e) {
  SearchTOCItem tocitem;
  Enumeration itemEnum = e.getSearchItems();
  // Iterate through each search item in the searchEvent
  while (itemEnum.hasMoreElements()) {
      SearchItem item = (SearchItem) itemEnum.nextElement();
      URL url;
      try {
    url = new URL(item.getBase(), item.getFilename());
      } catch (MalformedURLException me) {
    debug ("Failed to create URL from " + item.getBase() + "|" +
           item.getFilename());
    continue;
      }
      boolean foundNode = false;

      // see if this search item matches that of one we currently have
      // if so just do an update
      Enumeration nodesEnum = nodes.elements();
      while (nodesEnum.hasMoreElements()) {
    tocitem = (SearchTOCItem) nodesEnum.nextElement();
    URL testURL = tocitem.getURL();
    if (testURL != null && url != null && url.sameFile(testURL)) {
        tocitem.addSearchHit(new SearchHit(item.getConfidence(),
                   item.getBegin(),
                   item.getEnd()));
        foundNode = true;
        break;
    }
      }

      // No match.
      // OK then add a new one.
      if (!foundNode) {
    tocitem = new SearchTOCItem(item);
    nodes.addElement(tocitem);
      }
  }
    }
View Full Code Here

TOP

Related Classes of javax.help.SearchTOCItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.