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

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


      // this is extremely rare, but valid
      else if (type == DOMRegionContext.WHITE_SPACE) {
        ITextRegion lastRegion = currentNode.getLastRegion();
        // pack the embedded container with this region
        if (lastRegion instanceof ITextRegionContainer) {
          ITextRegionContainer container = (ITextRegionContainer) lastRegion;
          container.getRegions().add(region);
          // containers must have parent set ...
          // setting for EACH subregion is redundent, but not sure
          // where else to do, so will do here for now.
          container.setParent(currentNode);
          // DW 4/16/2003 regions no longer have parents
          // region.setParent(container);
          region.adjustStart(container.getLength() - region.getStart());
        }
        currentNode.getLastRegion().adjustLength(region.getLength());
        currentNode.adjustLength(region.getLength());
      }
      else if (type == DOMRegionContext.UNDEFINED && currentNode != null) {
View Full Code Here


    if (parent.getRegions().size() == 1 && region.getType() == DOMRegionContext.XML_TAG_OPEN && (previous == null || (!previous.isEnded() || previous.getType() == DOMRegionContext.XML_CONTENT))) {
      result = true;
    }
    // case 2 test
    if (region instanceof ITextRegionContainer) {
      ITextRegionContainer container = (ITextRegionContainer) region;
      ITextRegion internal = container.getRegions().get(container.getRegions().size() - 1);
      if (internal.getType() == DOMRegionContext.WHITE_SPACE && container.getRegions().size() >= 2)
        internal = container.getRegions().get(container.getRegions().size() - 2);
      if (internal.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
        result = true;
      }
    }
    // case 3 test
View Full Code Here

      // this is extremely rare, but valid
      else if (type == DOMRegionContext.WHITE_SPACE) {
        ITextRegion lastRegion = currentNode.getLastRegion();
        // pack the embedded container with this region
        if (lastRegion instanceof ITextRegionContainer) {
          ITextRegionContainer container = (ITextRegionContainer) lastRegion;
          container.getRegions().add(region);
          // DW, 4/16/2003 container regions have parent. Probably a
          // better place to set,
          // but for now, will (re)set each time through
          container.setParent(currentNode);
          // DW, 4/16/2003 token regions no longer have parents
          // region.setParent(container);
          region.adjustStart(container.getLength() - region.getStart());
        }
        currentNode.getLastRegion().adjustLength(region.getLength());
        currentNode.adjustLength(region.getLength());
      }
      else if (type == DOMRegionContext.UNDEFINED && currentNode != null) {
View Full Code Here

      // StructuredDocumentRegion
      // not sure why this check was there...
      // if (fnDelim.getType() == XMLRegionContext.BLOCK_TEXT) {
      Iterator blockRegions = fnDelim.getRegions().iterator();
      ITextRegion temp = null;
      ITextRegionContainer trc;
      while (blockRegions.hasNext()) {
        temp = (ITextRegion) blockRegions.next();
        // we hit a nested
        if (temp instanceof ITextRegionContainer) {
          trc = (ITextRegionContainer) temp;
          // it's in this region
          if (documentPosition >= trc.getStartOffset() && documentPosition < trc.getEndOffset()) {
            Iterator nestedJSPRegions = trc.getRegions().iterator();
            while (nestedJSPRegions.hasNext()) {
              temp = (ITextRegion) nestedJSPRegions.next();
              if (XMLContentAssistUtilities.isJSPOpenDelimiter(temp.getType()) && documentPosition == trc.getStartOffset(temp)) {
                // HTML content assist
                // we actually want content assist for the
                // previous type of region,
                // well get those proposals from the embedded
                // adapter
                if (documentPosition > 0) {
                  partitionType = getPartitionType(viewer, documentPosition - 1);
                  break;
                }
              }
              else if (XMLContentAssistUtilities.isJSPCloseDelimiter(temp.getType()) && documentPosition == trc.getStartOffset(temp)) {
                // JSP content assist
                return getJSPJavaCompletionProposals(viewer, documentPosition);
              }
            }
          }
View Full Code Here

      // StructuredDocumentRegion
      // not sure why this check was there...
      // if (fnDelim.getType() == XMLRegionContext.BLOCK_TEXT) {
      Iterator blockRegions = fnDelim.getRegions().iterator();
      ITextRegion temp = null;
      ITextRegionContainer trc;
      while (blockRegions.hasNext()) {
        temp = (ITextRegion) blockRegions.next();
        // we hit a nested
        if (temp instanceof ITextRegionContainer) {
          trc = (ITextRegionContainer) temp;
          // it's in this region
          if (documentPosition >= trc.getStartOffset() && documentPosition < trc.getEndOffset()) {
            Iterator nestedJSPRegions = trc.getRegions().iterator();
            while (nestedJSPRegions.hasNext()) {
              temp = (ITextRegion) nestedJSPRegions.next();
              if (XMLContentAssistUtilities.isJSPOpenDelimiter(temp.getType()) && documentPosition == trc.getStartOffset(temp)) {
                // HTML content assist
                // we actually want content assist for the
                // previous type of region,
                // well get those proposals from the embedded
                // adapter
                if (documentPosition > 0) {
                  partitionType = getPartitionType(viewer, documentPosition - 1);
                  break;
                }
              }
              else if (XMLContentAssistUtilities.isJSPCloseDelimiter(temp.getType()) && documentPosition == trc.getStartOffset(temp)) {
                // JSP content assist
                return true;
              }
            }
          }
View Full Code Here

      // StructuredDocumentRegion
      // not sure why this check was there...
      // if (fnDelim.getType() == XMLRegionContext.BLOCK_TEXT) {
      Iterator blockRegions = fnDelim.getRegions().iterator();
      ITextRegion temp = null;
      ITextRegionContainer trc;
      while (blockRegions.hasNext()) {
        temp = (ITextRegion) blockRegions.next();
        // we hit a nested
        if (temp instanceof ITextRegionContainer) {
          trc = (ITextRegionContainer) temp;
          // it's in this region
          if (documentPosition >= trc.getStartOffset() && documentPosition < trc.getEndOffset()) {
            Iterator nestedJSPRegions = trc.getRegions().iterator();
            while (nestedJSPRegions.hasNext()) {
              temp = (ITextRegion) nestedJSPRegions.next();
              if (XMLContentAssistUtilities.isJSPOpenDelimiter(temp.getType()) && documentPosition == trc.getStartOffset(temp)) {
                // HTML content assist
                // we actually want content assist for the
                // previous type of region,
                // well get those proposals from the embedded
                // adapter
                if (documentPosition > 0) {
                  partitionType = getPartitionType(viewer, documentPosition - 1);
                  break;
                }
              }
              else if (XMLContentAssistUtilities.isJSPCloseDelimiter(temp.getType()) && documentPosition == trc.getStartOffset(temp)) {
                // JSP content assist
                return true;
              }
            }
          }
View Full Code Here

      String elText;
      int startOffset = -1;
      // if container then need to get inner region
      // else can use flat region
      if (cursorRegion instanceof ITextRegionContainer) {
        ITextRegionContainer container = (ITextRegionContainer) cursorRegion;
        cursorRegion = container
            .getRegionAtCharacterOffset(documentPosition);
        elText = container.getText(cursorRegion);
        startOffset = container.getStartOffset(cursorRegion);
      } else {
        elText = flat.getText(cursorRegion);
        startOffset = flat.getStartOffset(cursorRegion);
      }
View Full Code Here

    IStructuredDocumentRegion flat = ContentAssistUtils.getStructuredDocumentRegion(viewer, documentPosition);
   
    if (flat != null) {
      ITextRegion cursorRegion = flat.getRegionAtCharacterOffset(documentPosition);
      if (DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE == cursorRegion.getType()) {
        ITextRegionContainer container = (ITextRegionContainer) cursorRegion;
        cursorRegion = container.getRegionAtCharacterOffset(documentPosition);
        if (cursorRegion.getType() == DOMJSPRegionContexts.JSP_EL_CONTENT) {
          String elText = container.getText(cursorRegion).trim();
          String prefix = getPrefix(documentPosition - container.getStartOffset(cursorRegion) - 1, elText);
          if (null != prefix) {
            List proposals = getFunctionProposals(prefix, (StructuredTextViewer) viewer, documentPosition);
            results = new ICompletionProposal[proposals.size()];
            proposals.toArray(results);
          }
View Full Code Here

    if (parent.getRegions().size() == 1 && region.getType() == DOMRegionContext.XML_TAG_OPEN && (previous == null || (!previous.isEnded() || previous.getType() == DOMRegionContext.XML_CONTENT))) {
      result = true;
    }
    // case 2 test
    if (region instanceof ITextRegionContainer) {
      ITextRegionContainer container = (ITextRegionContainer) region;
      ITextRegion internal = container.getRegions().get(container.getRegions().size() - 1);
      if (internal.getType() == DOMRegionContext.WHITE_SPACE && container.getRegions().size() >= 2)
        internal = container.getRegions().get(container.getRegions().size() - 2);
      if (internal.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
        result = true;
      }
    }
    // case 3 test
View Full Code Here

      ITextRegion tRegion = sdRegion.getRegionAtCharacterOffset(offset);
      int regionStart = sdRegion.getStartOffset(tRegion);

      // in case of container we have the extract the PhpScriptRegion
      if (tRegion instanceof ITextRegionContainer) {
        ITextRegionContainer container = (ITextRegionContainer) tRegion;
        tRegion = container.getRegionAtCharacterOffset(offset);
        regionStart += tRegion.getStart();
      }

      // find the specified php token in the PhpScriptRegion
      if (tRegion instanceof IPhpScriptRegion) {
View Full Code Here

TOP

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

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.