Package jp.aonir.fuzzyxml

Examples of jp.aonir.fuzzyxml.FuzzyXMLAttribute


                  boolean findAttribute = false;
                  FuzzyXMLNode[] nodes = element.getChildren();
                  for(int j=0;j<nodes.length;j++){
                    if(nodes[j] instanceof FuzzyXMLElement
                        && ((FuzzyXMLElement)nodes[j]).getName().equals("jsp:attribute")){
                      FuzzyXMLAttribute attr = ((FuzzyXMLElement)nodes[j]).getAttributeNode("name");
                      if(attr!=null && attr.getValue().equals(attrs[i].getAttributeName())){
                        findAttribute = true;
                        break;
                      }
                    }
                  }
View Full Code Here


                  boolean findAttribute = false;
                  FuzzyXMLNode[] nodes = element.getChildren();
                  for(int j=0;j<nodes.length;j++){
                    if(nodes[j] instanceof FuzzyXMLElement
                        && ((FuzzyXMLElement)nodes[j]).getName().equals("jsp:attribute")){
                      FuzzyXMLAttribute attr = ((FuzzyXMLElement)nodes[j]).getAttributeNode("name");
                      if(attr!=null && attr.getValue().equals(attrs[i].getAttributeName())){
                        findAttribute = true;
                        break;
                      }
                    }
                  }
View Full Code Here

      try {
        if (marker != null) {
          boolean elementError = true;
          if (wodProblem instanceof WodBindingNameProblem) {
            String name = ((WodBindingNameProblem) wodProblem).getBindingName();
            FuzzyXMLAttribute attribute = _element.getAttributeNode(name);
            if (attribute != null) {
              elementError = false;
              int offset = attribute.getOffset() + 1;
              marker.setAttribute(IMarker.LINE_NUMBER, WodHtmlUtils.getLineAtOffset(_cache.getHtmlEntry().getContents(), offset));
              marker.setAttribute(IMarker.CHAR_START, offset);
              marker.setAttribute(IMarker.CHAR_END, offset + attribute.getName().length());
            }
          }
          else if (wodProblem instanceof WodBindingValueProblem) {
            String name = ((WodBindingValueProblem) wodProblem).getBindingName();
            FuzzyXMLAttribute attribute = _element.getAttributeNode(name);
            if (attribute != null) {
              elementError = false;
              int offset = attribute.getOffset() + 1;
              marker.setAttribute(IMarker.LINE_NUMBER, WodHtmlUtils.getLineAtOffset(_cache.getHtmlEntry().getContents(), offset));
              marker.setAttribute(IMarker.CHAR_START, _element.getOffset() + attribute.getValueDataOffset() + 1);
              marker.setAttribute(IMarker.CHAR_END, _element.getOffset() + attribute.getValueDataOffset() + 1 + attribute.getValueDataLength());
            }
          }
          else if (wodProblem instanceof WodBindingDeprecationProblem) {
            String name = ((WodBindingDeprecationProblem) wodProblem).getBindingName();
            FuzzyXMLAttribute attribute = _element.getAttributeNode(name);
            if (attribute != null) {
              elementError = false;
              int offset = _element.getOffset() + attribute.getValueDataOffset() + 1;
              marker.setAttribute(IMarker.LINE_NUMBER, WodHtmlUtils.getLineAtOffset(_cache.getHtmlEntry().getContents(), offset));
              marker.setAttribute(IMarker.CHAR_START, offset);
              marker.setAttribute(IMarker.CHAR_END, offset + attribute.getValueDataLength());
            }
          }

          if (elementError) {
            int offset = _element.getOffset() + 1;
View Full Code Here

      appendOffset(this, oldChild.getOffset(), oldChild.getLength() * -1);
    }
  }

  public void setAttribute(FuzzyXMLAttribute attr) {
    FuzzyXMLAttribute attrNode = getAttributeNode(attr.getNamespaceName());
    if (attrNode == null) {
      if (_attributes.contains(attr)) {
        return;
      }
      if (getDocument() == null) {
View Full Code Here

    }
    return false;
  }

  public String getAttributeValue(String name) {
    FuzzyXMLAttribute attr = getAttributeNode(name);
    if (attr != null) {
      return attr.getValue();
    }
    return null;
  }
View Full Code Here

    }
    return null;
  }

  public void setAttribute(String namespace, String name, String value) {
    FuzzyXMLAttribute attr = new FuzzyXMLAttributeImpl(namespace, name, value, value);
    setAttribute(attr);
  }
View Full Code Here

    FuzzyXMLAttribute attr = new FuzzyXMLAttributeImpl(namespace, name, value, value);
    setAttribute(attr);
  }

  public void removeAttribute(String name) {
    FuzzyXMLAttribute attr = getAttributeNode(name);
    if (attr != null) {
      removeAttributeNode(attr);
    }
  }
View Full Code Here

          FuzzyXMLDocument htmlModel = _cache.getHtmlEntry().getModel();
          FuzzyXMLNode[] woTags = NodeSelectUtil.getNodeByFilter(htmlModel.getDocumentElement(), new NamedWebobjectTagFilter(rename.getOldName()));

          for (FuzzyXMLNode woTag : woTags) {
            FuzzyXMLElement woElement = (FuzzyXMLElement) woTag;
            FuzzyXMLAttribute woNameAttr = woElement.getAttributeNode("name");
            if (woNameAttr != null) {
              int offset = woElement.getOffset() + woNameAttr.getValueDataOffset() + 1;
              int length = woNameAttr.getValueDataLength();
              htmlEdits.add(new ReplaceEdit(offset, length, rename.getNewName()));
            }
          }
        }
        WodDocumentUtils.applyEdits(htmlDocument, htmlEdits);
View Full Code Here

      String tagName = element.getName();
      if (tagName != null && element.getOffset() + element.getNameOffset() + 1 <= offset && element.getOffset() + element.getNameOffset() + element.getNameLength() >= offset) {
        QuickRenameRefactoring.renameHtmlTag(element, htmlViewer, cache);
      }
      else if (WodHtmlUtils.isWOTag(tagName)) {
        FuzzyXMLAttribute nameAttribute = element.getAttributeNode("name");
        if (nameAttribute != null) {
          String woElementName = nameAttribute.getValue();
          if (woElementName != null && element.getOffset() + nameAttribute.getValueDataOffset() + 1 <= offset && element.getOffset() + nameAttribute.getValueDataOffset() + nameAttribute.getValueDataLength() >= offset) {
            QuickRenameRefactoring.renameElement(woElementName, htmlViewer, wodViewer, cache, true);
          }
        }
      }
    }
View Full Code Here

    FuzzyXMLDocument htmlModel = cache.getHtmlEntry().getModel();
    FuzzyXMLNode[] woTags = NodeSelectUtil.getNodeByFilter(htmlModel.getDocumentElement(), new NamedWebobjectTagFilter(woElementName));
    LinkedModeModel.closeAllModels(htmlDocument);
    for (FuzzyXMLNode woTag : woTags) {
      FuzzyXMLElement woElement = (FuzzyXMLElement) woTag;
      FuzzyXMLAttribute woNameAttr = woElement.getAttributeNode("name");
      if (woNameAttr != null) {
        int offset = woElement.getOffset() + woNameAttr.getValueDataOffset() + 1;
        int length = woNameAttr.getValueDataLength();
        linkedGroup.addPosition(new LinkedPosition(htmlDocument, offset, length, sequence++));
      }
    }
    return sequence;
  }
View Full Code Here

TOP

Related Classes of jp.aonir.fuzzyxml.FuzzyXMLAttribute

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.