use of com.intellij.find.FindModel in project intellij-community by JetBrains.
the class SwitchToReplace method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
EditorSearchSession search = e.getRequiredData(EditorSearchSession.SESSION_KEY);
FindModel findModel = search.getFindModel();
FindUtil.configureFindModel(true, e.getData(CommonDataKeys.EDITOR_EVEN_IF_INACTIVE), findModel, false);
search.getComponent().getSearchTextComponent().selectAll();
}
use of com.intellij.find.FindModel in project intellij-community by JetBrains.
the class ToggleRegex method setSelected.
@Override
protected void setSelected(@NotNull SearchSession session, boolean selected) {
FindModel findModel = session.getFindModel();
findModel.setRegularExpressions(selected);
if (selected) {
findModel.setWholeWordsOnly(false);
}
FindSettings.getInstance().setLocalRegularExpressions(selected);
}
use of com.intellij.find.FindModel in project intellij-community by JetBrains.
the class SearchResults method setNotFoundState.
public void setNotFoundState(boolean isForward) {
myNotFoundState = true;
FindModel findModel = new FindModel();
findModel.copyFrom(myFindModel);
findModel.setForward(isForward);
FindUtil.processNotFound(myEditor, findModel.getStringToFind(), findModel, getProject());
}
use of com.intellij.find.FindModel in project intellij-community by JetBrains.
the class SearchResults method updatePreviousFindModel.
private void updatePreviousFindModel(FindModel model) {
FindModel prev = FindManager.getInstance(getProject()).getPreviousFindModel();
if (prev == null) {
prev = new FindModel();
}
if (!model.getStringToFind().isEmpty()) {
prev.copyFrom(model);
FindManager.getInstance(getProject()).setPreviousFindModel(prev);
}
}
use of com.intellij.find.FindModel in project intellij-community by JetBrains.
the class LivePreview method showReplacementPreview.
private void showReplacementPreview() {
hideBalloon();
if (!mySearchResults.isUpToDate())
return;
final FindResult cursor = mySearchResults.getCursor();
final Editor editor = mySearchResults.getEditor();
if (myDelegate != null && cursor != null) {
String replacementPreviewText = myDelegate.getStringToReplace(editor, cursor);
if (StringUtil.isEmpty(replacementPreviewText)) {
replacementPreviewText = EMPTY_STRING_DISPLAY_TEXT;
}
final FindModel findModel = mySearchResults.getFindModel();
if (findModel.isRegularExpressions() && findModel.isReplaceState()) {
showBalloon(editor, replacementPreviewText);
}
}
}
Aggregations