UX: when inspecting a variable child, open it in the same inspector window
authorJan Vrany <jan.vrany@fit.cvut.cz>
Sat, 08 Sep 2018 16:03:04 +0100
changeset 104 824a6ee9ff16
parent 103 df0374b41f76
child 105 41d3bdbb8e2b
UX: when inspecting a variable child, open it in the same inspector window
VDBVariableObjectPresenter.st
--- a/VDBVariableObjectPresenter.st	Sat Sep 08 10:04:08 2018 +0100
+++ b/VDBVariableObjectPresenter.st	Sat Sep 08 16:03:04 2018 +0100
@@ -163,14 +163,28 @@
 !
 
 doInspectOBJ
-    | dup |
+    | dup app wnd |
 
     dup := varobj duplicate.
     dup visualizer: 'lambda val: instance_create(val)'.
+
+    "/ If used in Inspector2, open child in the same inspector windpow.
+    app := self application.
+    app notNil ifTrue:[ 
+        wnd := app window.
+        wnd notNil ifTrue:[ 
+            wnd := wnd topView.
+            (wnd application isKindOf: Tools::Inspector2) ifTrue:[ 
+                wnd application inspect: dup.
+                ^ self.
+            ].
+        ].
+    ].
+    "/ ...otherwise open a new inspector...            
     dup inspect.
 
     "Created: / 10-02-2018 / 23:17:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 19-02-2018 / 14:59:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 08-09-2018 / 16:00:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !VDBVariableObjectPresenter methodsFor:'private'!