Package org.eclipse.search.core.text

Examples of org.eclipse.search.core.text.TextSearchRequestor


    IResource[] roots= { fType.getJavaProject().getProject() }// limit to the current project
    String[] fileNamePatterns= { "*.japid" }; //$NON-NLS-1$ // all files with file suffix 'special'
    FileTextSearchScope scope= FileTextSearchScope.newSearchScope(roots , fileNamePatterns, false);
    Pattern pattern= Pattern.compile(fType.getElementName()); // only find the simple name of the type
   
    TextSearchRequestor collector= new TextSearchRequestor() {
      @Override
      public boolean acceptPatternMatch(TextSearchMatchAccess matchAccess) throws CoreException {
        IFile file= matchAccess.getFile();
        TextFileChange change= (TextFileChange) changes.get(file);
        if (change == null) {
View Full Code Here


    final String[] fileNamePatterns = { "*.html" };
    final FileTextSearchScope scope = FileTextSearchScope.newSearchScope(roots, fileNamePatterns, false);
    final Pattern pattern = Pattern.compile(QWickieActivator.WICKET_ID + "=\"" + sourceField.getElementName() + "\"");
    final String replacement = QWickieActivator.WICKET_ID + "=\"" + newName + "\"";

    final TextSearchRequestor collector = new TextSearchRequestor() {
      @Override
      public boolean acceptPatternMatch(final TextSearchMatchAccess matchAccess) throws CoreException {
        final IFile file = matchAccess.getFile();
        TextFileChange change = changes.get(file);
        if (change == null) {
View Full Code Here

    final FileTextSearchScope scope = FileTextSearchScope.newSearchScope(roots, fileNamePatterns, false);
    // TODO: find out if it's a wicket component with a PropertyModel
    final Pattern pattern = Pattern.compile("\"" + sourceField.getElementName() + "\"");
    final String replacement = "\"" + newName + "\"";

    final TextSearchRequestor collector = new TextSearchRequestor() {
      @Override
      public boolean acceptPatternMatch(final TextSearchMatchAccess matchAccess) throws CoreException {
        final IFile file = matchAccess.getFile();
        TextFileChange change = changes.get(file);
        if (change == null) {
View Full Code Here

    public TokenMatching(TextSearchRequestor collector, CharSequence searchText) {
        this(collector, new ReusableMatchAccess(), searchText);
    }

    public TokenMatching(CharSequence searchText) {
        this(new TextSearchRequestor() {
        }, new ReusableMatchAccess(), searchText);
    }
View Full Code Here

     * Note that the offsets will be ordered
     * @throws CoreException
     */
    public static ArrayList<Integer> getMatchOffsets(String match, String fullString) throws CoreException {
        final ArrayList<Integer> offsets = new ArrayList<Integer>();
        TextSearchRequestor textSearchRequestor = new TextSearchRequestor() {
            @Override
            public boolean acceptPatternMatch(TextSearchMatchAccess matchAccess) throws CoreException {
                offsets.add(matchAccess.getMatchOffset());
                return true;
            }
View Full Code Here

        assertTrue(!s.hasMatch("fo"));
    }

    public void testMatches() throws Exception {
        final ArrayList<Integer> offsets = new ArrayList<Integer>();
        TextSearchRequestor textSearchRequestor = new TextSearchRequestor() {
            @Override
            public boolean acceptPatternMatch(TextSearchMatchAccess matchAccess) throws CoreException {
                offsets.add(matchAccess.getMatchOffset());
                return true;
            }
View Full Code Here

      final String oldType = RefactoringUtil.buildFullyQualifiedName( renamedElement );

      Pattern pattern = Pattern.compile( oldType );

      TextSearchRequestor collector = new TextSearchRequestor() {
        @Override
        public boolean acceptPatternMatch( final TextSearchMatchAccess matchAccess ) throws CoreException {
          IFile file = matchAccess.getFile();
          TextFileChange change = (TextFileChange) changes.get( file );
          if ( change == null ) {
View Full Code Here

      String oldType = RefactoringUtil.buildFullyQualifiedName( deletedElement );

      Pattern pattern = Pattern.compile( oldType );

      TextSearchRequestor collector = new TextSearchRequestor() {
        @Override
        public boolean acceptPatternMatch( final TextSearchMatchAccess matchAccess ) throws CoreException {
          IFile file = matchAccess.getFile();
          TextFileChange change = (TextFileChange) changes.get( file );
          if ( change == null ) {
View Full Code Here

      String oldType = RefactoringUtil.buildFullyQualifiedName( renamedElement );

      Pattern pattern = Pattern.compile( oldType );

      TextSearchRequestor collector = new TextSearchRequestor() {
        @Override
        public boolean acceptPatternMatch( final TextSearchMatchAccess matchAccess ) throws CoreException {
          IFile file = matchAccess.getFile();
          TextFileChange change = (TextFileChange) changes.get( file );
          if ( change == null ) {
View Full Code Here

    FileTextSearchScope scope = FileTextSearchScope.newSearchScope(roots,
        fileNamePatterns, false);

    Pattern pattern = Pattern.compile(oldFullyQualifiedName);

    TextSearchRequestor collector = new TextSearchRequestor() {
      @Override
      public boolean acceptPatternMatch(
          final TextSearchMatchAccess matchAccess)
          throws CoreException {
        IFile file = matchAccess.getFile();
View Full Code Here

TOP

Related Classes of org.eclipse.search.core.text.TextSearchRequestor

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.