use of com.intellij.find.EditorSearchSession 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.EditorSearchSession in project intellij-community by JetBrains.
the class ToggleSelectionOnlyAction method update.
@Override
public void update(AnActionEvent e) {
super.update(e);
EditorSearchSession session = e.getData(EditorSearchSession.SESSION_KEY);
e.getPresentation().setEnabledAndVisible(session != null && session.getFindModel().isReplaceState());
}
use of com.intellij.find.EditorSearchSession in project intellij-community by JetBrains.
the class FindAllAction method update.
@Override
public void update(final AnActionEvent e) {
Project project = e.getProject();
Editor editor = e.getData(CommonDataKeys.EDITOR_EVEN_IF_INACTIVE);
EditorSearchSession search = e.getData(EditorSearchSession.SESSION_KEY);
updateTemplateIcon(search);
e.getPresentation().setIcon(getTemplatePresentation().getIcon());
e.getPresentation().setEnabled(editor != null && project != null && search != null && !project.isDisposed() && search.hasMatches() && PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument()) != null);
}
use of com.intellij.find.EditorSearchSession in project intellij-community by JetBrains.
the class OccurrenceAction method update.
@Override
public void update(AnActionEvent e) {
EditorSearchSession search = e.getData(EditorSearchSession.SESSION_KEY);
if (search == null) {
e.getPresentation().setEnabledAndVisible(false);
return;
}
boolean isFind = !search.getFindModel().isReplaceState();
boolean hasMatches = search.hasMatches();
e.getPresentation().setVisible(isFind);
e.getPresentation().setEnabled(isFind && hasMatches);
}
use of com.intellij.find.EditorSearchSession in project intellij-community by JetBrains.
the class SwitchToFind method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
if (KeymapUtil.isEmacsKeymap()) {
// Emacs users are accustomed to the editor that executes 'find next' on subsequent pressing of shortcut that
// activates 'incremental search'. Hence, we do the similar hack here for them.
ActionManager.getInstance().getAction(IdeActions.ACTION_FIND_NEXT).actionPerformed(e);
return;
}
EditorSearchSession search = e.getRequiredData(EditorSearchSession.SESSION_KEY);
final FindModel findModel = search.getFindModel();
FindUtil.configureFindModel(false, e.getData(CommonDataKeys.EDITOR_EVEN_IF_INACTIVE), findModel, false);
search.getComponent().getSearchTextComponent().selectAll();
}
Aggregations