Package org.eclipse.dltk.internal.core.search.matching

Examples of org.eclipse.dltk.internal.core.search.matching.FieldPattern


  @SuppressWarnings("restriction")
  protected SearchPattern createStringPattern(String patternStr, int searchFor, int limitTo, int matchRule) {
    IDLTKLanguageToolkit toolkit = DeeLanguageToolkit.getDefault();
    SearchPattern pattern = SearchPattern.createPattern(patternStr, searchFor, limitTo, matchRule, toolkit);
    if(pattern instanceof FieldPattern) {
      FieldPattern fieldPattern = (FieldPattern) pattern;
      // we may have to work arround a DLTK bug here
      // -- we are still going to test this codepath, even though it's not accessible because of DLTK bug
      char[] name = ((FieldPattern) pattern).name;
      int lastIx = CharOperation.lastIndexOf('.', name);
      if(lastIx != -1) {
        // assume a problem occurred in DLTK where qualifiedName has not been split
        char[] qualification = CharOperation.subarray(fieldPattern.name, 0, lastIx);
        CharOperation.replace(qualification, '.', '$');
        char[] simpleName = CharOperation.subarray(fieldPattern.name, lastIx+1, -1);
       
        return new FieldPattern(fieldPattern.findDeclarations,
            fieldPattern.findReferences, fieldPattern.findReferences,
            simpleName, qualification, null,
            null, null, matchRule, toolkit);
       
      }
View Full Code Here


      //TypeDeclarationPattern only occurs if it is a focus element... at least as of current DLTK 3.0 version
//      TypeDeclarationPattern typeDeclPatter = (TypeDeclarationPattern) pattern;
      assertFail();
    }
    case IIndexConstants.FIELD_PATTERN: {
      FieldPattern fieldPattern = (FieldPattern) pattern;
      char[] simpleName = fieldPattern.name;
      @UsesReflectionToAccessInternalAPI
      char[] qualification = readInternalField(fieldPattern, "declaringQualification", null);
      return new DeeNameNodeMatcher(deeMatchLocator, pattern,
          fieldPattern.findDeclarations, simpleName, qualification);
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.internal.core.search.matching.FieldPattern

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.