Package org.eclipse.search.ui.text

Examples of org.eclipse.search.ui.text.FileTextSearchScope


    // use the text search engine to find matches in my special files
    // in a real world implementation, clients would use their own, more precise search engine
   
    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 {
View Full Code Here


  }

  protected void processHtmlFiles(final IProgressMonitor paramIProgressMonitor, final Map<IFile, TextFileChange> changes, final String newName,
      final IResource[] roots) {
    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
View Full Code Here

  }

  private void processJavaFiles(final IProgressMonitor paramIProgressMonitor, final Map<IFile, TextFileChange> changes, final String newName,
      final IResource[] roots) {
    final String[] fileNamePatterns = { "*.java" };
    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() {
View Full Code Here

     * @param monitor the progress monitor to use
     * @param file the file to search in
     * @return returns the status of the operation
     */
    public IStatus searchInFile(final AbstractTextSearchResult result, final IProgressMonitor monitor, IFile file) {
        FileTextSearchScope scope = FileTextSearchScope.newSearchScope(new IResource[] { file },
                new String[] { "*" }, true); //$NON-NLS-1$

        Pattern searchPattern = getSearchPattern();
        TextSearchResultCollector collector = new TextSearchResultCollector(result, isFileNameSearch(), true);

View Full Code Here

    final HashMap<Object, Change> changes = new HashMap<Object, Change>();

    if ( renamedElement != null ) {
      IResource[] roots = renamedElement.getWorkspace().getRoot().getProjects();
      String[] fileNamePatterns = { "*.fxbuild" }; //$NON-NLS-1$
      FileTextSearchScope scope = FileTextSearchScope.newSearchScope( roots, fileNamePatterns, false );

      final String oldType = RefactoringUtil.buildFullyQualifiedName( renamedElement );

      Pattern pattern = Pattern.compile( oldType );

View Full Code Here

    (deletedElement.getProject()).findMember( deletedElement.getProjectRelativePath() );
   
    if ( deletedElement != null ) {
      IResource[] roots = deletedElement.getWorkspace().getRoot().getProjects();
      String[] fileNamePatterns = { "*.fxbuild" }; //$NON-NLS-1$
      FileTextSearchScope scope = FileTextSearchScope.newSearchScope( roots, fileNamePatterns, false );

      String oldType = RefactoringUtil.buildFullyQualifiedName( deletedElement );

      Pattern pattern = Pattern.compile( oldType );

View Full Code Here

    final String newName = getArguments().getDestination().toString();

    if ( renamedElement != null ) {
      IResource[] roots = renamedElement.getWorkspace().getRoot().getProjects();
      String[] fileNamePatterns = { "*.fxbuild" }; //$NON-NLS-1$
      FileTextSearchScope scope = FileTextSearchScope.newSearchScope( roots, fileNamePatterns, false );

      String oldType = RefactoringUtil.buildFullyQualifiedName( renamedElement );

      Pattern pattern = Pattern.compile( oldType );

View Full Code Here

  private void createChangesForFullyQualifiedOccurrences(IProgressMonitor pm,
      final HashMap<Object, Change> changes, IResource[] roots,
      final String oldFullyQualifiedName,
      final String newFullyQualifiedName) {
    String[] fileNamePatterns = { "*.fxml", "*.fxgraph" }; //$NON-NLS-1$
    FileTextSearchScope scope = FileTextSearchScope.newSearchScope(roots,
        fileNamePatterns, false);

    Pattern pattern = Pattern.compile(oldFullyQualifiedName);

    TextSearchRequestor collector = new TextSearchRequestor() {
View Full Code Here

  private void createChangesForNotFullyQualifiedOccurrences(
      IProgressMonitor pm, final HashMap<Object, Change> changes,
      IResource[] roots, final String pack, final String oldName,
      final String newName) {
    String[] fileNamePatterns = { "*.fxml" }; //$NON-NLS-1$
    FileTextSearchScope scope = FileTextSearchScope.newSearchScope(roots,
        fileNamePatterns, false);

    Pattern pattern = Pattern.compile("\"" + oldName + "\"");

    TextSearchRequestor collector = new TextSearchRequestor() {
View Full Code Here

TOP

Related Classes of org.eclipse.search.ui.text.FileTextSearchScope

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.