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

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


                  .getRegionAtCharacterOffset(caretPosition);
              if (sdRegion != null) {
                ITextRegion tRegion = sdRegion
                    .getRegionAtCharacterOffset(caretPosition);

                ITextRegionCollection container = sdRegion;
                if (tRegion instanceof ITextRegionContainer) {
                  container = (ITextRegionContainer) tRegion;
                  tRegion = container
                      .getRegionAtCharacterOffset(caretPosition);
                }

                // We should always hit the PhpScriptRegion:
                if (tRegion != null
                    && tRegion.getType() == PHPRegionContext.PHP_CONTENT) {
                  IPhpScriptRegion phpScriptRegion = (IPhpScriptRegion) tRegion;
                  tRegion = phpScriptRegion
                      .getPhpToken(caretPosition
                          - container
                              .getStartOffset()
                          - phpScriptRegion
                              .getStart());

                  // Handle double-click on PHPDoc tags:
                  if (tRegion.getType() == PHPRegionTypes.PHP_VARIABLE
                      || tRegion.getType() == PHPRegionTypes.PHP_THIS
                      || PHPPartitionTypes
                          .isPHPDocTagState(tRegion
                              .getType())) {
                    structuredTextViewer.setSelectedRange(
                        container.getStartOffset()
                            + phpScriptRegion
                                .getStart()
                            + tRegion.getStart(),
                        tRegion.getTextLength());
                    return; // Stop processing
View Full Code Here


      documentOffset -= 1;
    }
    ITextRegion tRegion = sdRegion
        .getRegionAtCharacterOffset(documentOffset);

    ITextRegionCollection container = sdRegion;

    if (tRegion instanceof ITextRegionContainer) {
      container = (ITextRegionContainer) tRegion;
      tRegion = container.getRegionAtCharacterOffset(offset);
    }
    if (tRegion != null && tRegion.getType() == PHPRegionContext.PHP_CLOSE) {
      tRegion = container.getRegionAtCharacterOffset(container
          .getStartOffset() + tRegion.getStart() - 1);
    }

    // This text region must be of type PhpScriptRegion:
    if (tRegion != null
        && tRegion.getType() == PHPRegionContext.PHP_CONTENT) {
      IPhpScriptRegion phpScriptRegion = (IPhpScriptRegion) tRegion;

      try {
        // Set default starting position to the beginning of the
        // PhpScriptRegion:
        int startOffset = container.getStartOffset()
            + phpScriptRegion.getStart();

        // Now, search backwards for the statement start (in this
        // PhpScriptRegion):
        ITextRegion startTokenRegion;
View Full Code Here

        if (documentRegion != null) {
            String regionContext;
            ITextRegion interest = documentRegion
                    .getRegionAtCharacterOffset(offset);

            ITextRegionCollection container = documentRegion;
            if (interest instanceof ITextRegionContainer) {
                container = (ITextRegionContainer) interest;
                interest = container.getRegionAtCharacterOffset(offset);
            }

            if (interest.getType() == TwigRegionContext.TWIG_CONTENT) {
                ITwigScriptRegion phpScript = (ITwigScriptRegion) interest;
                try {
                    regionContext = phpScript
                            .getTwigTokenType(offset
                                    - container.getStartOffset()
                                    - phpScript.getStart());
                } catch (BadLocationException e) {
                    assert false;
                    return null;
                }
View Full Code Here

            documentOffset -= 1;
        }
        ITextRegion tRegion = sdRegion
                .getRegionAtCharacterOffset(documentOffset);

        ITextRegionCollection container = sdRegion;

        if (tRegion instanceof ITextRegionContainer) {
            container = (ITextRegionContainer) tRegion;
            tRegion = container.getRegionAtCharacterOffset(offset);
        }
        if (tRegion != null
                && tRegion.getType() == TwigRegionContext.TWIG_CLOSE) {
            tRegion = container.getRegionAtCharacterOffset(container
                    .getStartOffset() + tRegion.getStart() - 1);
        }

        // This text region must be of type PhpScriptRegion:
        if (tRegion != null
                && TwigTextSequenceUtilities.isTwigRegion(tRegion.getType())) {
            ITwigScriptRegion twigScriptRegion = (ITwigScriptRegion) tRegion;

            try {
                // Set default starting position to the beginning of the
                // PhpScriptRegion:
                int startOffset = container.getStartOffset()
                        + twigScriptRegion.getStart();

                // Now, search backwards for the statement start (in this
                // PhpScriptRegion):
                ITextRegion startTokenRegion;
View Full Code Here

     */
    protected ITextRegionCollection determineRegionCollection(
            IStructuredDocument document, IStructuredDocumentRegion sdRegion,
            int offset)
    {
        ITextRegionCollection regionCollection = sdRegion;

        ITextRegion textRegion = determineTextRegion(document, sdRegion, offset);
        if (textRegion instanceof ITextRegionContainer) {
            regionCollection = (ITextRegionContainer) textRegion;
        }
View Full Code Here

TOP

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

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.