Package jp.aonir.fuzzyxml

Examples of jp.aonir.fuzzyxml.FuzzyXMLElement


        IDocument htmlDocument = _cache.getHtmlEntry().getDocument();
        if (htmlDocument != null) {
          List<TextEdit> htmlEdits = new LinkedList<TextEdit>();
          FuzzyXMLDocument xmlDocument = _cache.getHtmlEntry().getModel();
          if (xmlDocument != null) {
            FuzzyXMLElement xmlElement = xmlDocument.getElementByOffset(typePosition.getOffset());
            if (xmlElement != null && xmlElement.hasCloseTag()) {
              htmlEdits.add(new ReplaceEdit(xmlElement.getCloseTagOffset() + xmlElement.getCloseNameOffset() + 1, xmlElement.getCloseNameLength(), "wo:" + _newType));
            }
          }
          htmlEdits.add(new ReplaceEdit(typePosition.getOffset(), typePosition.getLength(), _newType));
          WodDocumentUtils.applyEdits(htmlDocument, htmlEdits);
        }
View Full Code Here


    List<FuzzyXMLElement> matches = new ArrayList<FuzzyXMLElement>();
    matches.add(_root);
    matchOffsetElement(_root, matches, offset);

    // ��Ԃ��ł��Z�����̂�I��
    FuzzyXMLElement find = null;
    for (int i = 0; i < matches.size(); i++) {
      FuzzyXMLElement element = matches.get(i);
      if (find == null || find.getLength() >= element.getLength()) {
        find = element;
      }
    }
    return find;
  }
View Full Code Here

  private void matchOffsetElement(FuzzyXMLElement element, List<FuzzyXMLElement> matches, int offset) {
    FuzzyXMLNode[] nodes = element.getChildren();
    for (int i = 0; i < nodes.length; i++) {
      if (nodes[i] instanceof FuzzyXMLElement) {
        FuzzyXMLElement e = (FuzzyXMLElement) nodes[i];
        if (e.getOffset() <= offset && offset <= e.getOffset() + e.getLength()) {
          matches.add(e);
          matchOffsetElement(e, matches, offset);
        }
      }
    }
View Full Code Here

TOP

Related Classes of jp.aonir.fuzzyxml.FuzzyXMLElement

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.