use of org.rstudio.studio.client.workbench.views.output.find.events.FindInFilesEvent in project rstudio by rstudio.
the class Source method onFindInFiles.
@Handler
public void onFindInFiles() {
String searchPattern = "";
if (activeEditor_ != null && activeEditor_ instanceof TextEditingTarget) {
TextEditingTarget textEditor = (TextEditingTarget) activeEditor_;
String selection = textEditor.getSelectedText();
boolean multiLineSelection = selection.indexOf('\n') != -1;
if ((selection.length() != 0) && !multiLineSelection)
searchPattern = selection;
}
events_.fireEvent(new FindInFilesEvent(searchPattern));
}
Aggregations