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

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


    if (currentNode != null) {
      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 = HyperlinkUtils.getHyperlinkRegion(currentAttr);

            if (canShowMultipleHyperlinks) {
              IHyperlink[] hyperlinks = createHyperlinks(currentAttr.getName(),
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

          endOffset = element.getEndOffset();
        }
        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

    if (currentNode != null) {
      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, annotation)) {
            IRegion hyperlinkRegion = getHyperlinkRegion(currentAttr);
            IHyperlink hyperLink = createHyperlink(currentAttr.getName(), currentAttr.getNodeValue(),
                currentNode, currentNode.getParentNode(), document, textViewer, hyperlinkRegion,
                region, annotation);
View Full Code Here

          endOffset = element.getEndOffset();
        }
        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

   * @see org.eclipse.gef.commands.Command#execute()
   */
  @Override
  public void execute() {
    if (transInput instanceof IDOMAttr) {
      IDOMAttr attr = (IDOMAttr) transInput;
      Element elem = attr.getOwnerElement();
      if (elem != null) {
        elem.removeAttributeNode(attr);
      }
    }
    else if (transInput instanceof IDOMElement) {
View Full Code Here

  public String getAttributeName() {
    return name;
  }

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

      }
      if (model != null) {
        IDOMDocument document = ((DOMModelImpl) model).getDocument();
        NamedNodeMap attributes = document.getDocumentElement().getAttributes();
        IDOMAttr schemaLocationNode = (IDOMAttr) attributes.getNamedItemNS(
            "http://www.w3.org/2001/XMLSchema-instance", "schemaLocation");
        String content = schemaLocationNode.getValue();
        isVersion1 = content.contains("spring-webflow-1");
      }
    }
    catch (Exception e) {
    }
View Full Code Here

        }
        if (model != null) {
          IDOMDocument document = ((DOMModelImpl) model).getDocument();
          NamedNodeMap attributes = document.getDocumentElement().getAttributes();
          if (attributes.getNamedItem("parent") != null) {
            IDOMAttr schemaLocationNode = (IDOMAttr) attributes.getNamedItem("parent");
            parent = schemaLocationNode.getValue();
          }
        }
      }
      catch (Exception e) {
      }
View Full Code Here

      }
      if (model != null) {
        IDOMDocument document = ((DOMModelImpl) model).getDocument();
        NamedNodeMap attributes = document.getDocumentElement().getAttributes();
        IDOMAttr schemaLocationNode = (IDOMAttr) attributes.getNamedItemNS(
            "http://www.w3.org/2001/XMLSchema-instance", "schemaLocation");
        String content = schemaLocationNode.getValue();
        return !content.contains("spring-webflow-2.0.xsd");
      }
    }
    catch (Exception e) {
      if (model != null) {
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.