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

Examples of org.eclipse.php.internal.core.util.text.TextSequence


    if (!super.isValid(sourceModule, offset, requestor)) {
      return false;
    }

    int classEnd = getCatchStart() + 5; // "catch"
    TextSequence statementText = getStatementText();
    statementText = statementText.subTextSequence(classEnd, statementText
        .length());

    int startPosition = 0;
    for (; startPosition < statementText.length(); startPosition++) {
      if (statementText.charAt(startPosition) == '(') {
        break;
      }
    }
    if (startPosition == statementText.length()) {
      // the current position is before the '('
      return false;
    }

    startPosition = PHPTextSequenceUtilities.readForwardSpaces(
        statementText, startPosition + 1); // + 1 for the '('
    int endPosition = PHPTextSequenceUtilities.readIdentifierEndIndex(
        getPhpVersion(), statementText, startPosition, false);
    // String className = statementText.subSequence(startPosition,
    // endPosition).toString();

    if (endPosition != statementText.length()) {
      return false;
    }
    return true;
  }
View Full Code Here


      CompletionRequestor requestor) {
    if (!super.isValid(sourceModule, offset, requestor)) {
      return false;
    }

    TextSequence statementText = getStatementText();
    statementText = statementText.subTextSequence(getTypeIdentifierEnd(),
        statementText.length());

    if (hasExtends()) {
      return true;
    }
    try {
View Full Code Here

    if (!super.isValid(sourceModule, offset, requestor)) {
      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

      CompletionRequestor requestor) {
    if (!super.isValid(sourceModule, offset, requestor)) {
      return false;
    }
    setPatterns(sourceModule.getScriptProject().getProject());
    TextSequence statementText = getStatementText();

    int tagEnd = statementText.length();
    boolean found = false;
    do {
      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

      CompletionRequestor requestor) {
    if (!super.isValid(sourceModule, offset, requestor)) {
      return false;
    }

    TextSequence statementText = getStatementText();
    statementText = statementText.subTextSequence(getTypeIdentifierEnd(),
        statementText.length());

    if (!hasExtends() && !hasImplements()) { // the cursor position is right
                          // after the class name
      return true;
    }
View Full Code Here

      return false;
    }

    useTrait = new ClassStatementContext().isValid(sourceModule, offset,
        requestor);
    TextSequence statementText = getStatementText();
    if (statementText.length() >= 4) {
      if ("use".equals(statementText.subSequence(0, 3).toString()) //$NON-NLS-1$
          && Character.isWhitespace(statementText.subSequence(3, 4)
              .charAt(0))) {
        return true;
      }
    }
    return false;
View Full Code Here

        }

        if (requestor == null || !requestor.getClass().toString().toLowerCase().contains("symfony"))
            return false;
       
        TextSequence statementText = getStatementText();
        if (SymfonyTextSequenceUtilities.isInServiceContainerFunction(statementText) > -1) {
         
          //TODO: check if the containing class is implementing a ContainerAware Interface
          return true;
        }
View Full Code Here

      try {

        if (requestor == null || !requestor.getClass().toString().contains("Symfony")) {
          return false;
        }
        TextSequence statement = getStatementText();
        IScriptProject project = getSourceModule().getScriptProject();

        if (SymfonyTextSequenceUtilities.isInRouteFunctionParameter(statement, project) == false) {
          return false;
        }
View Full Code Here

//                if (!hasWhitespaceBeforeCursor()) {
//                    return false;
//                }

                TextSequence statementText = getStatementText();

                if (statementText.toString().indexOf("->") > -1) {
                    return false;
                }

                SymfonyModelAccess model = SymfonyModelAccess.getDefault();
                ISourceModule module = getSourceModule();
View Full Code Here

                if (requestor == null || !requestor.getClass().toString().contains("Symfony")) {
                    return false;
                }              

                TextSequence statement = getStatementText();        


                if (SymfonyTextSequenceUtilities.isInTranslationFunctionParameter(statement) > -1) {
                    return true;
                }
View Full Code Here

TOP

Related Classes of org.eclipse.php.internal.core.util.text.TextSequence

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.