Examples of IDOMElement


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

    return newNode;
  }

  protected IDOMNode insertStartTag(IDOMNode node) {
    IDOMElement element = (IDOMElement) node;
    if (element.isCommentTag())
      return node; // do nothing

    IDOMNode newNode = null;

    String tagName = node.getNodeName();
View Full Code Here

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

    return result;
  }

  protected IDOMNode quoteAttrValue(IDOMNode node) {
    IDOMElement element = (IDOMElement) node;
    if (element.isCommentTag())
      return node; // do nothing

    boolean quoteAttrValues = getCleanupPreferences().getQuoteAttrValues();
    IDOMNode newNode = node;
View Full Code Here

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

   */
  protected void doExecute() {
    getOriginalElement().getModel().beginRecording(this);
    try {
      if (_styleProperties != null) {
        IDOMElement original = this.getOriginalElement();
        DOMStyleUtil.insertStyle(original, _styleAttrName, _styleProperties);
      } else if (_context != null) {
        ICSSStyleDeclaration styleDeclaration = CSSStyleDeclarationFactory.getInstance().getStyleDeclaration(getOriginalElement(), _styleAttrName);

        if (styleDeclaration == null) {
View Full Code Here

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

    }
  }

  private static IFigureHandler getHandler(Element ele) {
    if (ele instanceof IDOMElement) {
      IDOMElement xmlele = (IDOMElement) ele;
      return (IFigureHandler) xmlele.getAdapterFor(IFigureHandler.class);
    }
    return null;
  }
View Full Code Here

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

  }

  private void processDirective(IReporter reporter, IFile file, IStructuredModel model, IStructuredDocumentRegion documentRegion) {
    IndexedRegion ir = model.getIndexedRegion(documentRegion.getStartOffset());
    if (ir instanceof IDOMElement) {
      IDOMElement element = (IDOMElement) ir;
      ModelQuery query = ModelQueryUtil.getModelQuery(model);
      if (query != null) {
        CMElementDeclaration cmElement = query.getCMElementDeclaration(element);
        if (cmElement != null) {
          CMNamedNodeMap cmAttributes = null;
View Full Code Here

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

  }

  /**
   */
  private static void addStyleSheet(Element node, List result) {
    IDOMElement element = (IDOMElement) node;
    String tagName = element.getTagName();
    if (tagName == null) {
      return;
    }
    boolean isContainer = false;

    if (element.isCommentTag()) {
      Node parent = element.getParentNode();
      if (parent == element.getOwnerDocument()) {
        // This condition is too severe, actually do not work for JSF
        // template.
        // But above (! globalTag() && isContainer()) cover JSF template
        // + tpl template
        isContainer = true;
      } else if (parent.getNodeType() == Node.ELEMENT_NODE) {
        tagName = ((Element) parent).getTagName();
        if (tagName != null
            && tagName
                .equalsIgnoreCase(HTML40Namespace.ElementName.HEAD)) {
          isContainer = true;
        }
      }
    } else {
      INodeNotifier notifier = element;

      // (lium) Increase performance: since this method is called tooooo
      // many times,
      // and getAdapterFor() is slow, so add a check on the tagName to
      // filter
      // those stylesheet stuff first.
      if (IHTMLConstants.TAG_LINK.equalsIgnoreCase(tagName)
          || IHTMLConstants.TAG_STYLE.equalsIgnoreCase(tagName)) {
        INodeAdapter adapter = notifier
            .getAdapterFor(IStyleSheetAdapter.class);
        if (adapter instanceof IStyleSheetAdapter) {
          StyleSheet sheet = ((IStyleSheetAdapter) adapter).getSheet();
                    if (sheet != null)
                    {
                        result.add(sheet);
                    }
        }
      }

      isContainer = true;
    }
    if (isContainer) {
      for (Node child = element.getFirstChild(); child != null; child = child
          .getNextSibling()) {
        if (child.getNodeType() != Node.ELEMENT_NODE)
          continue;
        addStyleSheet((Element) child, result);
      }
View Full Code Here

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

         
        }
        else
        if (document.getModel() instanceof IDOMModel) {
      IDOMModel domModel = (IDOMModel) document.getModel();
      IDOMElement contextNode = (IDOMElement) domModel.getDocument()
          .getDocumentElement();
      DOMVisitor visitor = new DOMVisitor(document.getPath(), pattern,
          requestor);
      visitor.visit(contextNode);
    }
View Full Code Here

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

        Document document = parent.getNodeType() == Node.DOCUMENT_NODE ? (Document) parent : parent.getOwnerDocument();
        if (element != null) {
          // here we need to do a rename... which seems to be quite hard
          // to do :-(
          if (element instanceof IDOMElement) {
            IDOMElement elementImpl = (IDOMElement) element;
            IDOMModel model = elementImpl.getModel();
            String oldName = elementImpl.getNodeName();
            String newName = dialog.getElementName();
            setStructuredDocumentRegionElementName(model, elementImpl.getStartStructuredDocumentRegion(), oldName, newName);
            setStructuredDocumentRegionElementName(model, elementImpl.getEndStructuredDocumentRegion(), oldName, newName);
          }
        }
        else {
          Element newElement = document.createElement(dialog.getElementName());
          NodeList nodeList = parent.getChildNodes();
View Full Code Here

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

    fJSPTag = isJSPTag;
    fHandler = handler;
  }

  public Element create(String name, int nodeType) {
    IDOMElement element = (IDOMElement) fDocument.createElement(name);
    if (element == null)
      return null;
    element.setCommentTag(true);
    if (nodeType == IS_EMPTY) {
      element.setEmptyTag(true);
    }
    element.setJSPTag(fJSPTag);

    CommentElementAdapter adapter = new CommentElementAdapter((nodeType == IS_END), fHandler);
    element.addAdapter(adapter);

    return element;
  }
View Full Code Here

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

                    {
                        final IDOMNode domNode = (IDOMNode) xmlNodes.get( 0 ).getDomNode();
                       
                        if( domNode instanceof IDOMElement )
                        {
                            final IDOMElement domElement = (IDOMElement) domNode;
                           
                            if( domElement.hasEndTag() )
                            {
                                range.merge( domElement.getStartEndOffset(), domElement.getEndStartOffset() );
                            }
                            else
                            {
                                range.merge( domNode.getStartOffset(), domNode.getEndOffset() );
                            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.