Package org.eclipse.search.internal.ui.text

Examples of org.eclipse.search.internal.ui.text.FileSearchQuery


        layout.marginHeight = 0;
        layout.marginWidth = 0;

        initializeDialogUnits(result);

        FileSearchQuery query = getQuery();

        Label label = new Label(result, SWT.NONE);
        label.setText(SearchMessages.ReplaceDialog_replace_label);
        Text clabel = new Text(result, SWT.BORDER | SWT.READ_ONLY);
        clabel.setText(query.getSearchString());
        GridData gd = new GridData(GridData.FILL_HORIZONTAL);
        gd.widthHint = convertWidthInCharsToPixels(50);
        clabel.setLayoutData(gd);

        label = new Label(result, SWT.NONE);
        label.setText(SearchMessages.ReplaceDialog_with_label);
        fTextField = new Combo(result, SWT.DROP_DOWN);
        gd = new GridData(GridData.FILL_HORIZONTAL);
        gd.widthHint = convertWidthInCharsToPixels(50);
        fTextField.setLayoutData(gd);
        fTextField.setFocus();

        IDialogSettings settings = SearchPlugin.getDefault().getDialogSettings().getSection(SETTINGS_GROUP);
        if (settings != null) {
            String[] previousReplaceWith = settings.getArray(SETTINGS_REPLACE_WITH);
            if (previousReplaceWith != null) {
                fTextField.setItems(previousReplaceWith);
                fTextField.select(0);
            }
        }

        new Label(result, SWT.NONE);
        fReplaceWithRegex = new Button(result, SWT.CHECK);
        fReplaceWithRegex.setText(SearchMessages.ReplaceDialog_isRegex_label);
        if (query.isRegexSearch()) {
            fReplaceWithRegex.setSelection(true);
        } else {
            fReplaceWithRegex.setSelection(false);
            fReplaceWithRegex.setEnabled(false);
        }
View Full Code Here


    }

    private void doReplaceInFile(IProgressMonitor pm, IFile file, String replacementText, final Match[] markers)
            throws BadLocationException, CoreException {
        Pattern pattern = null;
        FileSearchQuery query = getQuery();
        if (query.isRegexSearch()) {
            pattern = createReplacePattern(query);
        }
        try {
            if (file.isReadOnly()) {
                if (fSkipReadonly) {
View Full Code Here

      catch(JavaModelException jmex) {
        ;
      }
    }
    IResource[] scopeResources= resources.toArray(new IResource[resources.size()]);
    ISearchQuery query= new FileSearchQuery("@Test\\(.*\\s*dependsOnGroups\\s*=.*",
        true /*regexp*/ ,
        true /*casesensitive*/,
        FileTextSearchScope.newSearchScope(scopeResources, new String[] {"*.java"}, false));
    query.run(new NullProgressMonitor());
    FileSearchResult result= (FileSearchResult) query.getSearchResult();
    Object[] elements = result.getElements();
   
    return elements;
  }
View Full Code Here

    return (IFile) result[0];
  }
 
  protected static IResource[] searchSuites(IResource[] scopeResources) {
    ISearchQuery query= new FileSearchQuery("<!DOCTYPE suite SYSTEM \"http://testng.org/testng-1.0.dtd\" >",
                                            false /*regexp*/ ,
                                            false /*casesensitive*/,
                                            FileTextSearchScope.newSearchScope(scopeResources, new String[] {"*.xml"}, false));
    query.run(null);
    FileSearchResult result= (FileSearchResult) query.getSearchResult();
    Object[] elements= result.getElements();
    IResource[] resources= new IResource[elements.length];
    for(int i= 0; i < elements.length; i++) {
      resources[i]= (IResource) elements[i];
    }
View Full Code Here

TOP

Related Classes of org.eclipse.search.internal.ui.text.FileSearchQuery

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.