Examples of ITextRegionList


Examples of org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList

  public boolean hasNestedValue() {
    if (this.fValueRegion == null)
      return false;
    if (!(this.fValueRegion instanceof ITextRegionContainer))
      return false;
    ITextRegionList regions = ((ITextRegionContainer) this.fValueRegion).getRegions();
    if (regions == null)
      return false;
    Iterator e = regions.iterator();
    while (e.hasNext()) {
      ITextRegion region = (ITextRegion) e.next();
      if (region == null)
        continue;
      String regionType = region.getType();
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList

    if(flatNode instanceof StructuredDocumentRegionProxy) {
      flatNode = ((StructuredDocumentRegionProxy)flatNode).getStructuredDocumentRegion();
    }
    if (flatNode == null)
      return null;
    ITextRegionList regions = flatNode.getRegions();
    if (regions == null || regions.size() == 0)
      return null;
    return regions.get(0);
  }
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList

    if(flatNode instanceof StructuredDocumentRegionProxy) {
      flatNode = ((StructuredDocumentRegionProxy)flatNode).getStructuredDocumentRegion();
    }
    if (flatNode == null)
      return DOMRegionContext.UNDEFINED;
    ITextRegionList regions = flatNode.getRegions();
    if (regions == null || regions.size() == 0)
      return DOMRegionContext.UNDEFINED;
    ITextRegion region = regions.get(0);
    return region.getType();
  }
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList

    if(flatNode instanceof StructuredDocumentRegionProxy) {
      flatNode = ((StructuredDocumentRegionProxy)flatNode).getStructuredDocumentRegion();
    }
    if (flatNode == null)
      return null;
    ITextRegionList regions = flatNode.getRegions();
    if (regions == null || regions.size() == 0)
      return null;
    return regions.get(regions.size() - 1);
  }
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList

    if(flatNode instanceof StructuredDocumentRegionProxy) {
      flatNode = ((StructuredDocumentRegionProxy)flatNode).getStructuredDocumentRegion();
    }
    if (flatNode == null)
      return DOMRegionContext.UNDEFINED;
    ITextRegionList regions = flatNode.getRegions();
    if (regions == null || regions.size() == 0)
      return DOMRegionContext.UNDEFINED;
    ITextRegion region = regions.get(regions.size() - 1);
    return region.getType();
  }
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList

      model = StructuredModelManager.getModelManager().getModelForRead(file);
      IStructuredDocument doc = model.getStructuredDocument();
      IStructuredDocumentRegion curNode = doc.getFirstStructuredDocumentRegion();
      while (null != (curNode = curNode.getNext()) && !monitor.isCanceled()) {
        if (curNode.getType() == DOMRegionContext.XML_TAG_NAME) {
          ITextRegionList list = curNode.getRegions();
          String text = curNode.getText();
          String tagName  = null;
          String attrName = null;
          for(int j=0;j<list.size();j++){
            ITextRegion region = list.get(j);
            if(region.getType()==DOMRegionContext.XML_TAG_NAME){
              tagName = text.substring(region.getStart(), region.getEnd()).trim();
             
            } else if(region.getType()==DOMRegionContext.XML_TAG_ATTRIBUTE_NAME){
              attrName = text.substring(region.getStart(), region.getEnd()).trim();
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList

    }
    return false;
  }

  static private String getTagName(IStructuredDocumentRegion tag) {
    ITextRegionList regions = tag.getRegions();
    Iterator iter = regions.iterator();
    while (iter.hasNext()) {
      ITextRegion rgn = (ITextRegion) iter.next();
      if (rgn.getType() == DOMRegionContext.XML_TAG_NAME)
        return tag.getText(rgn);
    }
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList

      return Node.ELEMENT_NODE;
    }
  }

  private boolean isEndTagCorrupted(ElementInfo info) {
    ITextRegionList regions = info.endTag.getRegions();
    if (regions == null || regions.isEmpty())
      return false;
    Iterator iter = regions.iterator();
    while (iter.hasNext()) {
      ITextRegion rgn = (ITextRegion) iter.next();
      if (!isValidRegion(rgn))
        return true; // found invalid region type.
    }
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList

    return false; // all regions are valid.
  }

  private String getEndTagFullText(ElementInfo info) {
    String hint = "";//$NON-NLS-1$
    ITextRegionList regions = info.endTag.getRegions();
    Iterator iter = regions.iterator();
    while (iter.hasNext()) {
      ITextRegion rgn = (ITextRegion) iter.next();
      String type = rgn.getType();
      if (type == null)
        continue;
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList

    ITextRegion attrNameRegion = null;
    while (node != null && isValidScriptingRegionType(node.getType())) {
      node = node.getPrevious();
    }

    ITextRegionList regions = node.getRegions();
    if (regions.size() > 4 && regions.get(1).getType() == DOMRegionContext.XML_TAG_NAME) {
      ITextRegion potentialLanguageRegion = regions.get(1);
      String potentialLanguageString = node.getText(potentialLanguageRegion);
      if (potentialLanguageString.equalsIgnoreCase(HTML40Namespace.ElementName.SCRIPT)) {
        for (int i = 0; i < regions.size(); i++) {
          ITextRegion region = regions.get(i);
          String regionType = region.getType();
          if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)
            attrNameRegion = region;
          else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
            String attrName = node.getText(attrNameRegion);
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.