# HG changeset patch # User Claus Gittinger # Date 1335640791 -7200 # Node ID 9adfb8a84696b6a43b55d0426422b55805a38946 # Parent 01e4c1a45e354efbb8582997cacf062a718dac4f added: #aspectLabelFor:inApplicationOf: #findAspectFor:inApplicationOf: changed: #menu #submenuInterface: diff -r 01e4c1a45e35 -r 9adfb8a84696 Tools__ViewTreeApplication.st --- a/Tools__ViewTreeApplication.st Fri Apr 27 15:21:01 2012 +0200 +++ b/Tools__ViewTreeApplication.st Sat Apr 28 21:19:51 2012 +0200 @@ -511,6 +511,8 @@ nil nil ) + + "Modified: / 27-04-2012 / 14:13:17 / cg" ! middleButtonMenu @@ -1367,13 +1369,15 @@ ]. list add:(MenuDesc separator). - (view respondsTo:#'model:') ifTrue:[ + (view respondsTo:#'model') ifTrue:[ inst := view model. - inst isNil ifTrue:[ label := value := nil ] - ifFalse:[ label := inst displayString. - value := [ view model inspect ]. - ]. + inst isNil + ifTrue:[ label := value := nil ] + ifFalse:[ label := inst displayString. + label := label,(self aspectLabelFor:inst inApplicationOf:view). + value := [ view model inspect ]. + ]. list add:(MenuDesc title:'model' value:label action:value). @@ -1392,13 +1396,14 @@ inst isNil ifTrue:[ label := value := nil ] ifFalse:[ label := inst displayString. + label := label,(self aspectLabelFor:inst inApplicationOf:view). value := [ view enableChannel inspect ]. ]. list add:(MenuDesc title:'enableChannel' value:label action:value). ]. - #( #action #pressaAction #releaseAction ) do:[:actionSelector | + #( #action #pressAction #releaseAction ) do:[:actionSelector | (view respondsTo:actionSelector) ifTrue:[ inst := view perform:actionSelector. @@ -1419,6 +1424,7 @@ inst isNil ifTrue:[ label := value := nil ] ifFalse:[ label := inst class printString. + label := label,(self aspectLabelFor:inst inApplicationOf:view). value := [ view listHolder inspect ]. ]. list add:(MenuDesc title:'listHolder' value:label action:value). @@ -1429,6 +1435,7 @@ inst isNil ifTrue:[ label := value := nil ] ifFalse:[ label := '%1 [%2]' bindWith:(inst class printString) with:(inst size). + label := label,(self aspectLabelFor:inst inApplicationOf:view). value := [ view list inspect ]. ]. @@ -1436,9 +1443,9 @@ ]. list last isSeparator ifTrue:[ list removeLast ]. - ^ MenuDesc buildFromList:list onGC:aMenu - - "Modified: / 11-05-2010 / 12:53:24 / cg" + ^ MenuDesc buildFromList:list onGC:aMenu + + "Modified: / 27-04-2012 / 14:22:34 / cg" ! submenuVisibility:aMenu @@ -1477,6 +1484,24 @@ !ViewTreeInspectorApplication methodsFor:'private'! +aspectLabelFor:aModel inApplicationOf:aView + |app| + + aModel isNil ifTrue:[^ '']. + aView isNil ifTrue:[^ '']. + (app := aView application) isNil ifTrue:[^ '']. + app builder bindings keysAndValuesDo:[:aspect :value | + value == aModel ifTrue:[^ ' [aspect: ',aspect,']']. + ]. + app class allInstVarNames do:[:nm | + (app instVarNamed:nm) == aModel ifTrue:[^ ' [instvar: ',nm,']'] + ]. + + ^ '' + + "Created: / 27-04-2012 / 14:22:09 / cg" +! + selectFocusView |rootView focusView|