Esempio n. 1
0
 private static FindModel createDefaultFindModel(Project project, Editor editor) {
   FindModel findModel = new FindModel();
   findModel.copyFrom(FindManager.getInstance(project).getFindInFileModel());
   if (editor.getSelectionModel().hasSelection()) {
     String selectedText = editor.getSelectionModel().getSelectedText();
     if (selectedText != null) {
       findModel.setStringToFind(selectedText);
     }
   }
   findModel.setPromptOnReplace(false);
   return findModel;
 }
Esempio n. 2
0
 private void searchFieldDocumentChanged() {
   setMatchesLimit(LivePreviewController.MATCHES_LIMIT);
   String text = mySearchTextComponent.getText();
   myFindModel.setStringToFind(text);
   if (!StringUtil.isEmpty(text)) {
     updateResults(true);
   } else {
     nothingToSearchFor();
   }
   if (mySearchTextComponent instanceof JTextArea) {
     adjustRows((JTextArea) mySearchTextComponent);
   }
   updateMultiLineStateIfNeed();
 }
Esempio n. 3
0
 public void setTextInField(final String text) {
   mySearchTextComponent.setText(text);
   myFindModel.setStringToFind(text);
 }