public class FindUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
FindUtil.ReplaceDelegate |
Modifier and Type | Method and Description |
---|---|
static void |
configureFindModel(boolean replace,
Editor editor,
FindModel model,
boolean firstSearch) |
static TextRange |
doReplace(Project project,
Document document,
FindModel model,
FindResult result,
java.lang.String stringToReplace,
boolean reallyReplace,
java.util.List<? super Pair<TextRange,java.lang.String>> rangesToChange) |
static void |
find(Project project,
Editor editor) |
static void |
findWordAtCaret(Project project,
Editor editor) |
static void |
initStringToFindWithSelection(FindModel findModel,
Editor editor) |
static void |
processNotFound(Editor editor,
java.lang.String stringToFind,
FindModel model,
Project project) |
static void |
replace(Project project,
Editor editor) |
static boolean |
replace(Project project,
Editor editor,
int offset,
FindModel model) |
static boolean |
replace(Project project,
Editor editor,
int offset,
FindModel model,
FindUtil.ReplaceDelegate delegate) |
static boolean |
searchAgain(Project project,
Editor editor,
DataContext context) |
static void |
searchBack(Project project,
Editor editor,
DataContext context) |
static boolean |
selectSearchResultInEditor(Editor editor,
FindResult result,
int caretShiftFromSelectionStart)
Attempts to add a new caret to editor, with selection corresponding to given search result.
|
static void |
selectSearchResultsInEditor(Editor editor,
java.util.Iterator<? extends FindResult> resultIterator,
int caretShiftFromSelectionStart)
Creates a selection in editor per each search result.
|
static UsageView |
showInUsageView(PsiElement sourceElement,
PsiElement [] targets,
java.lang.String title,
Project project) |
static <T> UsageView |
showInUsageView(PsiElement sourceElement,
T [] targets,
Function<? super T,? extends Usage> usageConverter,
java.lang.String title,
Consumer<? super UsageViewPresentation> presentationSetup,
Project project) |
static void |
triggerRegexHelpClicked(java.lang.String type) |
static void |
triggerUsedOptionsStats(java.lang.String type,
FindModel model) |
static void |
updateFindInFileModel(Project project,
FindModel with,
boolean saveFindString) |
static void |
useFindStringFromFindInFileModel(FindModel findModel,
Editor editor) |
public static void initStringToFindWithSelection(FindModel findModel, Editor editor)
public static void configureFindModel(boolean replace, Editor editor, FindModel model, boolean firstSearch)
public static void updateFindInFileModel(Project project, FindModel with, boolean saveFindString)
public static void useFindStringFromFindInFileModel(FindModel findModel, Editor editor)
public static void searchBack(Project project, Editor editor, DataContext context)
public static boolean searchAgain(Project project, Editor editor, DataContext context)
public static boolean replace(Project project, Editor editor, int offset, FindModel model, FindUtil.ReplaceDelegate delegate)
public static void processNotFound(Editor editor, java.lang.String stringToFind, FindModel model, Project project)
public static TextRange doReplace(Project project, Document document, FindModel model, FindResult result, java.lang.String stringToReplace, boolean reallyReplace, java.util.List<? super Pair<TextRange,java.lang.String>> rangesToChange)
public static <T> UsageView showInUsageView(PsiElement sourceElement, T [] targets, Function<? super T,? extends Usage> usageConverter, java.lang.String title, Consumer<? super UsageViewPresentation> presentationSetup, Project project)
public static UsageView showInUsageView(PsiElement sourceElement, PsiElement [] targets, java.lang.String title, Project project)
public static void selectSearchResultsInEditor(Editor editor, java.util.Iterator<? extends FindResult> resultIterator, int caretShiftFromSelectionStart)
caretShiftFromSelectionStart
- if non-negative, defines caret position relative to selection start, for each created selection.
if negative, carets will be positioned at selection endspublic static boolean selectSearchResultInEditor(Editor editor, FindResult result, int caretShiftFromSelectionStart)
caretShiftFromSelectionStart
- if non-negative, defines caret position relative to selection start, for each created selection.
if negative, caret will be positioned at selection endtrue
if caret was added successfully, false
if it cannot be done, e.g. because a caret already
exists at target positionpublic static void triggerUsedOptionsStats(java.lang.String type, FindModel model)
public static void triggerRegexHelpClicked(java.lang.String type)