# HG changeset patch # User Claus Gittinger # Date 1417174207 -3600 # Node ID 95025cd0fbced9537da6873bf9ba8b995d7f0900 # Parent 71dab9730c8847a43471f128713e25f344b6188b class: Tools::ViewTreeInspectorApplication added: #objectToInspectOrBrowse: changed: #doBrowse: #doInspect: diff -r 71dab9730c88 -r 95025cd0fbce Tools__ViewTreeApplication.st --- a/Tools__ViewTreeApplication.st Thu Nov 27 21:12:25 2014 +0100 +++ b/Tools__ViewTreeApplication.st Fri Nov 28 12:30:07 2014 +0100 @@ -1927,24 +1927,10 @@ #application browse application class #controller browse controller class " - |view inst| - - view := self selectedView. - view isNil ifTrue:[^ self]. - - what == #view ifTrue:[ inst := view ] - ifFalse:[what == #model ifTrue:[ inst := view model ] - ifFalse:[what == #application ifTrue:[ inst := view application ] - ifFalse:[what == #controller ifTrue:[ inst := view controller ] - ifFalse:[what == #sensor ifTrue:[ inst := view sensor ] - ifFalse:[what == #group ifTrue:[ inst := view windowGroup ] - ifFalse:[ - ^ self - ]]]]]]. - - inst notNil ifTrue:[ - inst class browserClass openInClass:(inst class) selector:nil - ]. + |inst| + + (inst := self objectToInspectOrBrowse:what) isNil ifTrue:[^ self]. + inst class browserClass openInClass:(inst class) selector:nil "Modified: / 28-08-2013 / 23:57:42 / cg" ! @@ -2018,19 +2004,11 @@ #controller inspect controller #process inspect application's process " + |inst| - inst := self selectedView. - inst isNil ifTrue:[^ self]. - - what == #group ifTrue:[ inst := inst windowGroup ] - ifFalse:[what == #model ifTrue:[ inst := inst model ] - ifFalse:[what == #application ifTrue:[ inst := inst application ] - ifFalse:[what == #controller ifTrue:[ inst := inst controller ] - ifFalse:[what == #process ifTrue:[ inst := inst windowGroup process ] - ifFalse:[what == #sensor ifTrue:[ inst := inst sensor ]]]]]]. - - inst notNil ifTrue:[ inst inspect ]. + (inst := self objectToInspectOrBrowse:what) isNil ifTrue:[^ self]. + inst inspect. "Modified: / 28-08-2013 / 23:58:27 / cg" ! @@ -2143,6 +2121,35 @@ self setRootItem:nil. ! +objectToInspectOrBrowse:what + "return one of: + #view inspect class + #group inspect windowGroup + #model inspect model + #application inspect application + #controller inspect controller + #process inspect application's process + " + |view inst| + + view := self selectedView. + view isNil ifTrue:[^ nil]. + + what == #group ifTrue:[ inst := view windowGroup ] + ifFalse:[what == #model ifTrue:[ inst := view model ] + ifFalse:[what == #application ifTrue:[ inst := view application ] + ifFalse:[what == #controller ifTrue:[ inst := view controller ] + ifFalse:[what == #process ifTrue:[ inst := view windowGroup process ] + ifFalse:[what == #sensor ifTrue:[ inst := view sensor ]]]]]]. + + (inst isNil and:[what == #application]) ifTrue:[ + inst := view topView + ]. + ^ inst + + "Modified: / 28-08-2013 / 23:58:27 / cg" +! + openDocumentation HTMLDocumentView openFullOnDocumentationFile:'tools/misc/TOP.html#VIEWTREEINSPECTOR' !