Package org.eclipse.php.internal.core.util.text

Examples of org.eclipse.php.internal.core.util.text.TextSequence.subSequence()


    if (elementStart < 1) { // there's no trigger of length less than 1
                // characters
      return false;
    }

    String triggerText = statementText.subSequence(elementStart - 1,
        elementStart).toString();
    if (!triggerText.equals("\\")) { //$NON-NLS-1$
      return false;
    }
View Full Code Here


    int endNamespace = PHPTextSequenceUtilities.readBackwardSpaces(
        statementText, elementStart - 1);
    int nsNameStart = PHPTextSequenceUtilities.readNamespaceStartIndex(
        statementText, endNamespace, false);
    String nsName = statementText.subSequence(nsNameStart, elementStart)
        .toString();
    if (nsName.equals("\\")) { //$NON-NLS-1$
      isGlobal = true;
      return true;
    }
View Full Code Here

    int statementLength = statementText.length();
    int prefixEnd = PHPTextSequenceUtilities.readBackwardSpaces(
        statementText, statementLength); // read whitespace
    int prefixStart = PHPTextSequenceUtilities.readIdentifierStartIndex(
        statementText, prefixEnd, true);
    return statementText.subSequence(prefixStart, prefixEnd).toString();
  }

  public int getPrefixEnd() throws BadLocationException {
    ITextRegion phpToken = getPHPToken();
    if (phpToken.getType() == PHPRegionTypes.PHP_NS_SEPARATOR) {
View Full Code Here

      endPosition = PHPTextSequenceUtilities.readBackwardSpaces(
          statementText, endPosition - 1);
      startPosition = PHPTextSequenceUtilities.readIdentifierStartIndex(
          getPhpVersion(), statementText, endPosition, true);
      arrayVarName = statementText
          .subSequence(startPosition, endPosition).toString();
      if (!arrayVarName.startsWith("$")) { //$NON-NLS-1$
        return false;
      }
View Full Code Here

    int elementStart = getElementStart();
    int lhsIndex = elementStart - "parent".length() //$NON-NLS-1$
        - getTriggerType().getName().length();
    if (lhsIndex >= 0) {
      TextSequence statementText = getStatementText();
      String parentText = statementText.subSequence(lhsIndex,
          elementStart - getTriggerType().getName().length())
          .toString();

      if (parentText.equals("parent") || (PHPVersion.PHP5_4.isLessThan(phpVersion) && parentText.toLowerCase().equals("parent"))) { //$NON-NLS-1$ //$NON-NLS-2$
        isParent = isDirectParent = true;
View Full Code Here

    lhsIndex = elementStart - "self".length() //$NON-NLS-1$
        - getTriggerType().getName().length();
    if (lhsIndex >= 0) {
      TextSequence statementText = getStatementText();
      String parentText = statementText.subSequence(lhsIndex,
          elementStart - getTriggerType().getName().length())
          .toString();
      if (parentText.equals("self") || (PHPVersion.PHP5_4.isLessThan(phpVersion) && parentText.toLowerCase().equals("self"))) { //$NON-NLS-1$ //$NON-NLS-2$
        isSelf = isDirectSelf = true;
      }
View Full Code Here

      return false;
    }
    int typeEnd = getTypeEnd();
    if (typeEnd >= 10) {
      TextSequence statementText = getStatementText();
      String typeString = statementText.subSequence(typeEnd - 10,
          typeEnd - 1).toString();
      if ("interface".equals(typeString)) { //$NON-NLS-1$
        return true;
      }
    }
View Full Code Here

    int statementLength = statementText.length();
    int prefixEnd = PHPTextSequenceUtilities.readBackwardSpaces(
        statementText, statementLength); // read whitespace
    int prefixStart = PHPTextSequenceUtilities.readIdentifierStartIndex(
        statementText, prefixEnd, true);
    return statementText.subSequence(prefixStart, prefixEnd).toString();
  }

  public int getPrefixEnd() throws BadLocationException {
    ITextRegion phpToken = getPHPToken();
    if (phpToken.getType() == PHPRegionTypes.PHP_NS_SEPARATOR) {
View Full Code Here

      return false;
    }
    int typeEnd = getTypeEnd();
    if (typeEnd >= 6) {
      TextSequence statementText = getStatementText();
      String typeString = statementText.subSequence(typeEnd - 6,
          typeEnd - 1).toString();
      if ("class".equals(typeString)) { //$NON-NLS-1$
        return true;
      }
    }
View Full Code Here

      tagEnd = PHPTextSequenceUtilities.readBackwardSpaces(statementText,
          tagEnd);
      tagStart = PHPTextSequenceUtilities.readIdentifierStartIndex(
          getPhpVersion(), getStatementText(), tagEnd, true);

      tagName = statementText.subSequence(tagStart, tagEnd).toString();

      if (tagStart > 0 && statementText.charAt(tagStart - 1) == '@') {
        found = true;
      } else if (isPHPTag(tagName)) {
        found = true;
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.