[vcs-log] apply text filter on focus lost IDEA-143431
authorJulia Beliaeva <Julia.Beliaeva@jetbrains.com>
Mon, 3 Oct 2016 15:59:02 +0000 (18:59 +0300)
committerJulia Beliaeva <Julia.Beliaeva@jetbrains.com>
Mon, 10 Oct 2016 15:26:30 +0000 (18:26 +0300)
platform/vcs-log/impl/src/com/intellij/vcs/log/ui/filter/VcsLogClassicFilterUi.java

index 3b8e4fa1852573e113ce6177e592718b0e1021a0..1d8c9054be05e63cc304f7cf6345ceb567ca66a0 100644 (file)
@@ -436,10 +436,7 @@ public class VcsLogClassicFilterUi implements VcsLogFilterUi {
       super(VCS_LOG_TEXT_FILTER_HISTORY);
       myTextFilterModel = model;
       setText(myTextFilterModel.getText());
-      getTextEditor().addActionListener(e -> {
-        myTextFilterModel.setFilter(new VcsLogTextFilterImpl(getText()));
-        addCurrentTextToHistory();
-      });
+      getTextEditor().addActionListener(e -> applyFilter());
       addDocumentListener(new DocumentAdapter() {
         @Override
         protected void textChanged(DocumentEvent e) {
@@ -457,9 +454,19 @@ public class VcsLogClassicFilterUi implements VcsLogFilterUi {
       }
     }
 
+    protected void applyFilter() {
+      myTextFilterModel.setFilter(new VcsLogTextFilterImpl(getText()));
+      addCurrentTextToHistory();
+    }
+
     @Override
     protected void onFieldCleared() {
       myTextFilterModel.setFilter(null);
     }
+
+    @Override
+    protected void onFocusLost() {
+      applyFilter();
+    }
   }
 }