public final class FindManagerImpl extends FindManager
FindManager.MalformedReplacementStringException, FindManager.PromptResult, FindManager.PromptResultValueFIND_MODEL_TOPIC| Constructor and Description |
|---|
FindManagerImpl(Project project) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canFindUsages(PsiElement element)
Checks if the Find Usages action is available for the specified element.
|
void |
clearFindingNextUsageInFile()
Explicitly tell FindManager that "Find Next" and "Find Previous" actions should not use
find usages previous results.
|
FindModel |
createReplaceInFileModel() |
boolean |
findNextUsageInEditor(Editor editor)
Performs a "Find Next" operation after "Find Usages in File" or
"Highlight Usages in File".
|
boolean |
findNextUsageInEditor(FileEditor fileEditor) |
boolean |
findPreviousUsageInEditor(Editor editor)
Performs a "Find Previous" operation after "Find Usages in File" or
"Highlight Usages in File".
|
boolean |
findPreviousUsageInEditor(FileEditor fileEditor) |
FindResult |
findString(java.lang.CharSequence text,
int offset,
FindModel model)
Searches for the specified substring in the specified character sequence,
using the specified find settings.
|
FindResult |
findString(java.lang.CharSequence text,
int offset,
FindModel model,
VirtualFile file)
Searches for the specified substring in the specified character sequence,
using the specified find settings.
|
void |
findUsages(PsiElement element)
Performs the Find Usages operation for the specified element.
|
void |
findUsages(PsiElement element,
boolean showDialog)
Shows the Find Usages dialog (if
showDialog is true} and performs the Find Usages operation for the
specified element. |
void |
findUsagesInEditor(PsiElement element,
FileEditor fileEditor)
Performs a "Find Usages in File" operation for the specified element.
|
void |
findUsagesInScope(PsiElement element,
SearchScope searchScope) |
boolean |
findWasPerformed()
Gets the flag indicating whether the "Find Next" and "Find Previous" actions are
available to continue a previously started search operation.
|
FindModel |
getFindInFileModel()
Returns the settings of the last performed Find in File operation, or the
default Find in File settings if no such operation was performed by the user.
|
FindModel |
getFindInProjectModel()
Returns the settings of the last performed Find in Project operation, or the
default Find in Project settings if no such operation was performed by the user.
|
FindModel |
getFindNextModel()
Gets the model containing the search settings to use for "Find Next" and
"Find Previous" operations.
|
FindModel |
getFindNextModel(Editor editor)
Gets the model containing the search settings to use for "Find Next" and
"Find Previous" operations specific for the editor given.
|
FindUsagesManager |
getFindUsagesManager() |
FindModel |
getPreviousFindModel() |
java.lang.String |
getStringToReplace(java.lang.String foundString,
FindModel model,
int startOffset,
java.lang.CharSequence documentText)
Gets the string to replace with, given the specified found string and find/replace
settings.
|
boolean |
selectNextOccurrenceWasPerformed()
Gets the flag indicating that 'Add Selection for Next Occurrence' action was performed recently,
so "Find Next" and "Find Previous" actions should work in its context.
|
void |
setFindNextModel(FindModel findNextModel)
Sets the model containing the search settings to use for "Find Next" and
"Find Previous" operations.
|
void |
setFindWasPerformed()
Sets the flag indicating that the "Find Next" and "Find Previous" actions are
available to continue a previously started search operation.
|
void |
setPreviousFindModel(FindModel previousFindModel) |
void |
setSelectNextOccurrenceWasPerformed()
Sets the flag indicating that 'Add Selection for Next Occurrence' action was performed recently,
so "Find Next" and "Find Previous" actions should work in its context.
|
void |
showFindDialog(FindModel model,
java.lang.Runnable okHandler)
Shows the Find, Replace or Find Usages dialog initializing it from the specified
model and saves the settings entered by the user into the same model.
|
int |
showMalformedReplacementPrompt(FindModel model,
java.lang.String title,
FindManager.MalformedReplacementStringException exception)
Shows a replace prompt dialog for the bad replace operation.
|
int |
showPromptDialog(FindModel model,
java.lang.String title)
Shows a replace prompt dialog for the specified replace operation.
|
void |
showSettingsAndFindUsages(NavigationItem [] targets) |
getInstancepublic FindManagerImpl(Project project)
public FindModel createReplaceInFileModel()
createReplaceInFileModel in class FindManagerpublic int showPromptDialog(FindModel model, java.lang.String title)
FindManagershowPromptDialog in class FindManagermodel - the model containing the settings of the replace operation.title - the title of the dialog to show.FindManager.PromptResult
interface.public void showFindDialog(FindModel model, java.lang.Runnable okHandler)
FindManagershowFindDialog in class FindManagermodel - the model containing the settings of a find or replace operation.okHandler - Will be executed after doOkActionpublic FindModel getFindInFileModel()
FindManagergetFindInFileModel in class FindManagerpublic FindModel getFindInProjectModel()
FindManagergetFindInProjectModel in class FindManagerpublic boolean findWasPerformed()
FindManagerfindWasPerformed in class FindManagertrue if the actions are available, false if there is no previous search
operation to continue.public void setFindWasPerformed()
FindManagersetFindWasPerformed in class FindManagerpublic boolean selectNextOccurrenceWasPerformed()
FindManagerselectNextOccurrenceWasPerformed in class FindManagerpublic void setSelectNextOccurrenceWasPerformed()
FindManagersetSelectNextOccurrenceWasPerformed in class FindManagerpublic FindModel getFindNextModel()
FindManagergetFindNextModel in class FindManagerpublic FindModel getFindNextModel(Editor editor)
FindManagerFindManager.getFindNextModel()
if there is find bar currently shown for the editor.getFindNextModel in class FindManagereditor - editor, for which find model shall be retreived forpublic void setFindNextModel(FindModel findNextModel)
FindManagersetFindNextModel in class FindManagerfindNextModel - the model to use for the operations.public FindResult findString(java.lang.CharSequence text, int offset, FindModel model)
FindManagerfindString in class FindManagertext - the text in which the search is performed.offset - the start offset for the search.model - the settings for the search, including the string to find.public FindResult findString(java.lang.CharSequence text, int offset, FindModel model, VirtualFile file)
FindManagerfindString in class FindManagertext - the text in which the search is performed.offset - the start offset for the search.model - the settings for the search, including the string to find.public int showMalformedReplacementPrompt(FindModel model, java.lang.String title, FindManager.MalformedReplacementStringException exception)
FindManagershowMalformedReplacementPrompt in class FindManagermodel - the model containing the settings of the replace operation.title - the title of the dialog to show.exception - exception from FindManager.getStringToReplace(String, FindModel, int, CharSequence)FindManager.PromptResult
interface. May be only FindManager.PromptResult.CANCEL or FindManager.PromptResult.SKIP for bad replace operationpublic FindModel getPreviousFindModel()
getPreviousFindModel in class FindManagerpublic void setPreviousFindModel(FindModel previousFindModel)
setPreviousFindModel in class FindManagerpublic java.lang.String getStringToReplace(java.lang.String foundString,
FindModel model,
int startOffset,
java.lang.CharSequence documentText)
throws FindManager.MalformedReplacementStringException
FindManagergetStringToReplace in class FindManagerfoundString - the found string.model - the search and replace settings, including the replace string.startOffset - offset in the source text at which the string was found (matters for regex searches)documentText - source text in which the string was found (matters for regex searches)FindManager.MalformedReplacementStringExceptionpublic boolean canFindUsages(PsiElement element)
FindManagercanFindUsages in class FindManagerelement - the element to check the availability for.true if Find Usages is available, false otherwise.FindUsagesProvider.canFindUsagesFor(PsiElement)public void findUsages(PsiElement element)
FindManagerfindUsages in class FindManagerelement - the element to find the usages for.public void findUsagesInScope(PsiElement element, SearchScope searchScope)
findUsagesInScope in class FindManagerpublic void findUsages(PsiElement element, boolean showDialog)
FindManagershowDialog is true} and performs the Find Usages operation for the
specified element.findUsages in class FindManagerelement - the element to find the usages for.showDialog - true if find usages settings dialog needs to be shown.public void showSettingsAndFindUsages(NavigationItem [] targets)
showSettingsAndFindUsages in class FindManagerpublic void clearFindingNextUsageInFile()
FindManagerclearFindingNextUsageInFile in class FindManagerpublic void findUsagesInEditor(PsiElement element, FileEditor fileEditor)
FindManagerfindUsagesInEditor in class FindManagerelement - the element for which the find is performed.fileEditor - the editor in which the find is performed.public boolean findNextUsageInEditor(FileEditor fileEditor)
findNextUsageInEditor in class FindManagerpublic boolean findNextUsageInEditor(Editor editor)
FindManagerfindNextUsageInEditor in class FindManagereditor - the editor in which the find is performed.true if the operation was performed (not necessarily found anything),
false if an error occurred during the operation.public boolean findPreviousUsageInEditor(Editor editor)
FindManagerfindPreviousUsageInEditor in class FindManagereditor - the editor in which the find is performed.true if the operation was performed (not necessarily found anything),
false if an error occurred during the operation.public boolean findPreviousUsageInEditor(FileEditor fileEditor)
findPreviousUsageInEditor in class FindManagerpublic FindUsagesManager getFindUsagesManager()