Package org.eclipse.wst.sse.core.internal.provisional.text

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


      }
    }
  }

  private void decodeRemainingRegions(IStructuredDocumentRegion sdRegion, int start) {
    ITextRegionList regionList = sdRegion.getRegions();
    if(regionList != null) {
      ITextRegion region = regionList.get(start);
      String text = sdRegion.getFullText();
      if (text != null && region != null && region.getStart() <= text.length())
        fTranslator.decodeScriptBlock(text.substring(region.getStart(), text.length()), 0);
    }
  }
View Full Code Here


        fTranslator.decodeScriptBlock(text.substring(region.getStart(), text.length()), 0);
    }
  }

  private int hasIllegalContent(IStructuredDocumentRegion sdRegion) {
    ITextRegionList list = sdRegion.getRegions();
    for (int i = 0; i < list.size(); i++) {
      ITextRegion region = list.get(i);
      String type = region.getType();
      if (type == DOMRegionContext.UNDEFINED)
        return i;
      if (type == DOMRegionContext.XML_END_TAG_OPEN || type == DOMRegionContext.XML_EMPTY_TAG_CLOSE || type == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE)
        return -1;
View Full Code Here

   */
  private boolean prepareTextRegion(ITextRegionCollection blockedRegion, int partitionStartOffset, int partitionLength, Collection holdResults) {
    boolean handled = false;
    final int partitionEndOffset = partitionStartOffset + partitionLength - 1;
    ITextRegion region = null;
    ITextRegionList regions = blockedRegion.getRegions();
    int nRegions = regions.size();
    StyleRange styleRange = null;
    for (int i = 0; i < nRegions; i++) {
      region = regions.get(i);
      TextAttribute attr = null;
      TextAttribute previousAttr = null;
      if (blockedRegion.getStartOffset(region) > partitionEndOffset)
        break;
      if (blockedRegion.getEndOffset(region) <= partitionStartOffset)
View Full Code Here

  private boolean prepareTextRegions(IStructuredDocumentRegion structuredDocumentRegion, int partitionStartOffset, int partitionLength, Collection holdResults) {
    boolean handled = false;
    final int partitionEndOffset = partitionStartOffset + partitionLength - 1;
    while (structuredDocumentRegion != null && structuredDocumentRegion.getStartOffset() <= partitionEndOffset) {
      ITextRegion region = null;
      ITextRegionList regions = structuredDocumentRegion.getRegions();
      int nRegions = regions.size();
      StyleRange styleRange = null;
      for (int i = 0; i < nRegions; i++) {
        region = regions.get(i);
        TextAttribute attr = null;
        TextAttribute previousAttr = null;
        if (structuredDocumentRegion.getStartOffset(region) > partitionEndOffset)
          break;
        if (structuredDocumentRegion.getEndOffset(region) <= partitionStartOffset)
View Full Code Here

 
      //only add attribute value proposals for specific elements
      if(node.getNodeName().equals(JSP11Namespace.ElementName.DIRECTIVE_TAGLIB)) {
        // Find the attribute name for which this position should have a value
        IStructuredDocumentRegion open = node.getFirstStructuredDocumentRegion();
        ITextRegionList openRegions = open.getRegions();
        int i = openRegions.indexOf(contentAssistRequest.getRegion());
        if (i < 0)
          return;
        ITextRegion nameRegion = null;
        while (i >= 0) {
          nameRegion = openRegions.get(i--);
          if (nameRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)
            break;
        }
   
        String attributeName = null;
View Full Code Here

        }
      }
 
      // Find the attribute name for which this position should have a value
      IStructuredDocumentRegion open = node.getFirstStructuredDocumentRegion();
      ITextRegionList openRegions = open.getRegions();
      int i = openRegions.indexOf(contentAssistRequest.getRegion());
      if (i < 0) {
        return;
      }
      ITextRegion nameRegion = null;
      while (i >= 0) {
        nameRegion = openRegions.get(i--);
        if (nameRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
          break;
        }
      }
     
View Full Code Here

  }

  protected String getRegionName(IStructuredDocumentRegion sdRegion) {

    String nameStr = ""; //$NON-NLS-1$
    ITextRegionList regions = sdRegion.getRegions();
    for (int i = 0; i < regions.size(); i++) {
      ITextRegion r = regions.get(i);
      if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
        nameStr = fTextToParse.substring(sdRegion.getStartOffset(r), sdRegion.getTextEndOffset(r));
        break;
      }
    }
View Full Code Here

      if (_trace) {
        time1 = System.currentTimeMillis();
      }
      IRegion damage;
      IStructuredDocumentRegion documentRegion = structuredDocumentEvent.getStructuredDocumentRegion();
      ITextRegionList newRegions = structuredDocumentEvent.getNewRegions();
      if (newRegions.size() > 0) {
        ITextRegion firstChangedRegion = newRegions.get(0);
        ITextRegion lastChangedRegion = newRegions.get(newRegions.size() - 1);
        int startOffset = documentRegion.getStartOffset(firstChangedRegion);
        int length = documentRegion.getEndOffset(lastChangedRegion) - startOffset;
        damage = new Region(startOffset, length);
      }
      else {
View Full Code Here

    if (isStoppedForwardingChanges())
      return;
    if (Debug.debugStructuredDocument) {
      System.out.println("maybe redraw stuff"); //$NON-NLS-1$
    }
    ITextRegionList newRegions = structuredDocumentEvent.getNewRegions();
    int nRegions = newRegions.size();
    if (nRegions > 0) {
      ITextRegion firstRegion = newRegions.get(0);
      ITextRegion lastRegion = newRegions.get(nRegions - 1);
      IStructuredDocumentRegion flatNode = structuredDocumentEvent.getStructuredDocumentRegion();
      redrawRange(flatNode.getStartOffset(firstRegion), flatNode.getEndOffset(lastRegion));
    }
  }
View Full Code Here

     * anchor any taglibs found within at the
     * anchorStructuredDocumentRegion. Includes use the including file as
     * the point of reference, not necessarily the "top" file.
     */
    protected void processInclude(ITextRegionCollection includeDirectiveCollection, IStructuredDocumentRegion anchorStructuredDocumentRegion, XMLSourceParser textSource) {
      ITextRegionList regions = includeDirectiveCollection.getRegions();
      String includedFile = null;
      boolean isFilename = false;
      try {
        for (int i = 2; includedFile == null && i < regions.size(); i++) {
          ITextRegion region = regions.get(i);
          if (region.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
            if (textSource.regionMatches(includeDirectiveCollection.getStartOffset(region), region.getTextLength(), JSP12TLDNames.FILE)) {
              isFilename = true;
            }
            else {
View Full Code Here

TOP

Related Classes of org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList

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.