IDEA-185851 Populate classes on typing of filter expression
authorVitaliy.Bibaev <vitaliy.bibaev@jetbrains.com>
Mon, 5 Feb 2018 12:38:27 +0000 (15:38 +0300)
committerVitaliy.Bibaev <vitaliy.bibaev@jetbrains.com>
Mon, 5 Feb 2018 12:38:27 +0000 (15:38 +0300)
java/debugger/impl/src/com/intellij/debugger/memory/ui/ClassesFilteredView.java
java/debugger/impl/src/com/intellij/debugger/memory/ui/ClassesTable.java

index a2844d19647ab795cfad13ffd7449aafe7f78f64..35b8212f5782bb9ed12d6f077a74b7891a17a5dc 100644 (file)
@@ -226,7 +226,12 @@ public class ClassesFilteredView extends BorderLayoutPanel implements Disposable
       }
 
       private void dispatch(KeyEvent e) {
-        if (KeyboardUtils.isUpDownKey(e.getKeyCode()) || KeyboardUtils.isEnterKey(e.getKeyCode())) {
+        final int keyCode = e.getKeyCode();
+        if (myTable.isInClickableMode() && (KeyboardUtils.isCharacter(keyCode) || KeyboardUtils.isEnterKey(keyCode))) {
+          myTable.exitClickableMode();
+          updateClassesAndCounts(true);
+        }
+        else if (KeyboardUtils.isUpDownKey(keyCode) || KeyboardUtils.isEnterKey(keyCode)) {
           myTable.dispatchEvent(e);
         }
       }
@@ -427,11 +432,12 @@ public class ClassesFilteredView extends BorderLayoutPanel implements Disposable
     public void contextAction(@NotNull SuspendContextImpl suspendContext) {
       handleTrackers();
 
-      final List<ReferenceType> classes = suspendContext.getDebugProcess().getVirtualMachineProxy().allClasses();
+      final VirtualMachineProxyImpl proxy = suspendContext.getDebugProcess().getVirtualMachineProxy();
+      final List<ReferenceType> classes = proxy.allClasses();
 
       if (!classes.isEmpty()) {
         final VirtualMachine vm = classes.get(0).virtualMachine();
-        if (vm.canGetInstanceInfo()) {
+        if (proxy.canGetInstanceInfo()) {
           final Map<ReferenceType, Long> counts = getInstancesCounts(classes, vm);
           ApplicationManager.getApplication().invokeLater(() -> myTable.updateContent(counts));
         }
index 3cbb3228eb717bb8f594f5b1684fa3023d23c37d..a723fa10c3cc85b370b06b98914a5d1246a7c4bc 100644 (file)
@@ -212,6 +212,11 @@ public class ClassesTable extends JBTable implements DataProvider, Disposable {
     setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
   }
 
+  void exitClickableMode() {
+    releaseMouseListener();
+    getEmptyText().setText(DEFAULT_EMPTY_TEXT);
+  }
+
   private void releaseMouseListener() {
     ApplicationManager.getApplication().assertIsDispatchThread();
     if (isInClickableMode()) {