示例#1
0
 void lookup(String text) {
   NodeList nl = DOMInfoExtractor.locateNodes(document, ".//text()[contains(.,'" + text + "')]");
   System.out.println("find " + nl.getLength() + " items");
   FoundItem[] fis = new FoundItem[nl.getLength()];
   for (int i = 0; i < nl.getLength(); i++) {
     fis[i] = getFoundItem(nl.item(i), text);
   }
   foundList.setListData(fis);
 }
示例#2
0
 void lookupByXPath(String xpath) {
   NodeList nl = DOMInfoExtractor.locateNodes(document, xpath);
   System.out.println("lookupByXPath: " + xpath);
   if (nl == null) {
     JOptionPane.showMessageDialog(this, "error xpath: " + xpath);
   }
   System.out.println("find " + nl.getLength() + " items");
   FoundItem[] fis = new FoundItem[nl.getLength()];
   for (int i = 0; i < nl.getLength(); i++) {
     fis[i] = getFoundItem(nl.item(i), null);
   }
   foundList.setListData(fis);
 }
示例#3
0
  /** called when our JTree's nodes are selected. */
  void nodeSelected(TreeNode treeNode) {

    lastSelected = treeNode;
    Node node = jtree.getNode(treeNode);
    if (node == null) return;

    String xpath = DOMInfoExtractor.getXPath(node);
    selectedXPathTextField.setText(xpath);

    String message = DOMTreeFull.toString(node);
    message += "\r\n";
    message += xpath;
    setMessage(message);
  }