Package org.eclipse.wst.xml.core.internal.provisional.document

Examples of org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr


      }
      else {
        if (fSeverityUnexpectedRuntimeExpression != ValidationMessage.IGNORE && adec instanceof TLDAttributeDeclaration) {
          // The attribute cannot have a runtime evaluation of an expression
          if (!isTrue(((TLDAttributeDeclaration) adec).getRtexprvalue())) {
            IDOMAttr attr = (IDOMAttr) a;
            if(checkRuntimeValue(attr) && !fIsELIgnored) {
              String msg = NLS.bind(JSPCoreMessages.JSPActionValidator_1, a.getName());
              LocalizedMessage message = new LocalizedMessage(fSeverityUnexpectedRuntimeExpression, msg, file);
              ITextRegion region = attr.getValueRegion();
              int start = attr.getValueRegionStartOffset();
              int length = region != null ? region.getTextLength() : 0;
              int lineNo = document.getLineOfOffset(start);
              message.setLineNo(lineNo);
              message.setOffset(start);
              message.setLength(length);
View Full Code Here


        IDOMNode docNode = (IDOMNode) node;
        hyperRegion = new Region(docNode.getStartOffset(), docNode.getEndOffset() - docNode.getStartOffset());
      }
      else if (nodeType == Node.ATTRIBUTE_NODE) {
        // handle attribute nodes
        IDOMAttr att = (IDOMAttr) node;
        // do not include quotes in attribute value region
        int regOffset = att.getValueRegionStartOffset();
        ITextRegion valueRegion = att.getValueRegion();
        if (valueRegion != null) {
          int regLength = valueRegion.getTextLength();
          String attValue = att.getValueRegionText();
          if (StringUtils.isQuoted(attValue)) {
            ++regOffset;
            regLength = regLength - 2;
          }
          hyperRegion = new Region(regOffset, regLength);
View Full Code Here

        if (objects[0] instanceof IDOMNode) {
          IDOMNode node = (IDOMNode) objects[0];
          NamedNodeMap attributes = node.getAttributes();
          if (attributes != null) {
            for (int i = 0; i < attributes.getLength(); i++) {
              IDOMAttr attribute = (IDOMAttr) attributes.item(i);
              if (attribute.contains(start) && attribute.contains(end)) {
                objects[0] = attribute;
                break;
              }
            }
          }
View Full Code Here

    protected SearchMatch createSearchMatch(IFile file, Attr attributeNode)
    {
        int start = 0;
        int length = 0;
        if(attributeNode instanceof IDOMAttr){
            IDOMAttr domAttr = (IDOMAttr)attributeNode;
            start = domAttr.getValueRegionStartOffset();
            length = domAttr.getValueRegionText().length();
        }
        SearchMatch match = new SearchMatch(attributeNode, start, length, file);
        return match;
    }
View Full Code Here

                                range.merge( domNode.getStartOffset(), domNode.getEndOffset() );
                            }
                        }
                        else if( domNode instanceof IDOMAttr )
                        {
                            final IDOMAttr domAttr = (IDOMAttr) domNode;
                            final int start = domAttr.getValueRegionStartOffset();
                            range.merge( start + 1, start + domAttr.getValueRegionText().length() - 1 );
                        }
                        else
                        {
                            range.merge( domNode.getStartOffset(), domNode.getEndOffset() );
                        }
View Full Code Here

      switch (currentNode.getNodeType()) {
      case Node.ELEMENT_NODE:
        // at first try to handle selected attribute value
        Attr currentAttr = BeansEditorUtils.getAttrByOffset(
            currentNode, region.getOffset());
        IDOMAttr attr = (IDOMAttr) currentAttr;
        if (currentAttr != null
            && region.getOffset() >= attr
                .getValueRegionStartOffset()) {
          if (isLinkableAttr(currentAttr)) {
            IRegion hyperlinkRegion = getHyperlinkRegion(currentAttr);
            IHyperlink hyperLink = createHyperlink(currentAttr
                .getName(), currentAttr.getNodeValue(),
View Full Code Here

        }
        return new Region(element.getStartOffset(), endOffset
            - element.getStartOffset());

      case Node.ATTRIBUTE_NODE:
        IDOMAttr att = (IDOMAttr) node;
        // do not include quotes in attribute value region
        int regOffset = att.getValueRegionStartOffset();
        int regLength = att.getValueRegionText().length();
        String attValue = att.getValueRegionText();
        if (StringUtils.isQuoted(attValue)) {
          regOffset += 1;
          regLength = regLength - 2;
        }
        return new Region(regOffset, regLength);
View Full Code Here

        IDOMNode docNode = (IDOMNode) node;
        hyperRegion = new Region(docNode.getStartOffset(),
            docNode.getEndOffset() - docNode.getStartOffset());
      } else if (nodeType == Node.ATTRIBUTE_NODE) {
        // handle attribute nodes
        IDOMAttr att = (IDOMAttr) node;
        // do not include quotes in attribute value region
        int regOffset = att.getValueRegionStartOffset();
        int regLength = att.getValueRegionText().length();
        String attValue = att.getValueRegionText();
        if (StringUtils.isQuoted(attValue)) {
          regOffset = regOffset + 1;
          regLength = regLength - 2;
        }
        hyperRegion = new Region(regOffset, regLength);
View Full Code Here

    }
    return null;
  }

  private ITextRegion getCompletionRegion() {
    IDOMAttr attr = getAttribute();
    if (attr != null) {
      return attr.getValueRegion();
    }
    return null;
  }
View Full Code Here

  private void detectAnnotationBasedHyperlinks(ITextViewer textViewer, IRegion region,
      boolean canShowMultipleHyperlinks, List<IHyperlink> hyperlinks, Node currentNode) {
    if (currentNode != null && region != null) {
      Attr currentAttr = BeansEditorUtils.getAttrByOffset(currentNode, region.getOffset());
      IDOMAttr attr = (IDOMAttr) currentAttr;
      if (currentAttr != null && region.getOffset() >= attr.getValueRegionStartOffset()) {
        List<Element> appInfo = ToolAnnotationUtils.getApplicationInformationElements(currentNode, attr
            .getLocalName());
        for (Element elem : appInfo) {
          NodeList children = elem.getChildNodes();
          for (int j = 0; j < children.getLength(); j++) {
            Node child = children.item(j);
View Full Code Here

TOP

Related Classes of org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr

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.