Class TextSearchRefactoringParticipant


  • public class TextSearchRefactoringParticipant
    extends Object
    Special refactoring participant. It contains logic for creating refactoring changes by results of full text search for renaming element. Usually, users should not override this class - all special logic for refactoring should be implement in ITextSearchRefactoringSupplier
    See Also:
    TextSearchRefactoringParticipantFactory
    • Constructor Detail

      • TextSearchRefactoringParticipant

        public TextSearchRefactoringParticipant()
    • Method Detail

      • initialize

        public void initialize​(String oldName,
                               org.eclipse.emf.ecore.EObject context,
                               ITextSearchRefactoringSupplier refactoringSupplier)
        Constructor
        Parameters:
        oldName - old name of the renaming element, cannot be null
        context - actual renaming object, cannot be null
        refactoringSupplier - special ITextSearchRefactoringSupplier for renaming object, cannot be null
      • createRefactoringChange

        public Collection<org.eclipse.ltk.core.refactoring.Change> createRefactoringChange​(org.eclipse.ltk.core.refactoring.Change normalRefactoringChange,
                                                                                           String newName,
                                                                                           TextSearchScopeSettings searchScopeSettings,
                                                                                           org.eclipse.core.runtime.IProgressMonitor pm)
        Creates refactoring change by results of full text search for renaming element
        Parameters:
        normalRefactoringChange - Changes from usual refactoring, cannot be null
        newName - new name of the renaming element, cannot be null
        searchScopeSettings - the search scope settings instance, cannot be null
        pm - the progress monitor, cannot be null
        Returns:
        created refactoring changes by results of full text search for renaming element, never null if there is no changes
      • createChangeBySearchResult

        protected Collection<org.eclipse.ltk.core.refactoring.Change> createChangeBySearchResult​(Collection<Match> correctResults,
                                                                                                 org.eclipse.ltk.core.refactoring.Change normalRefactoringChange,
                                                                                                 String newName)
        Create concrete Changes for correct full text search results
        Parameters:
        correctResults - correct full text search results, cannot be null
        normalRefactoringChange - refactoring change, if we found correct full text search match in file with normal refactoring changes, we should add full text search changes to exiting change, cannot be null
        newName - new name of the renaming element, cannot be null
        Returns:
        concrete Changes for correct full text search results, never null
      • getProjects

        public Set<org.eclipse.core.resources.IProject> getProjects​(org.eclipse.core.resources.IProject initialProject)
        Gets all linked projects from workspace for creating projects scope for text search find operation
        Parameters:
        initialProject - initial project for full text search, can't be null
        projectManager - actual IV8ProjectManager, can't be null
        Returns:
        set of projects for text search find operation, never null