FlyByWindowInformation.st
changeset 2700 bad11f9b735f
parent 2699 22dd96b4e37f
child 2702 96f1dbce3d00
equal deleted inserted replaced
2699:22dd96b4e37f 2700:bad11f9b735f
   141 
   141 
   142     lastView := aView.
   142     lastView := aView.
   143     lastApplication := aView application.
   143     lastApplication := aView application.
   144 
   144 
   145     ^ String streamContents:[:s |
   145     ^ String streamContents:[:s |
   146         |topViewToInspect applicationToInspect masterApplicationToInspect modelToInspect|
   146         |topViewToInspect applicationToInspect masterApplicationToInspect modelToInspect
       
   147          genComponentNameForApplication|
       
   148 
       
   149         genComponentNameForApplication := [:app :s |
       
   150                 (app notNil 
       
   151                 and:[ app builder notNil ]) ifTrue:[
       
   152                     |components v|
       
   153 
       
   154                     components := app builder namedComponents.
       
   155 
       
   156                     v := aView.
       
   157                     [   (components includes:v) not
       
   158                         and:[v container notNil]
       
   159                     ] whileTrue:[
       
   160                         v := v container.
       
   161                     ].
       
   162                     (components includes:v) ifTrue:[
       
   163                         |k|
       
   164 
       
   165                         k := components keyAtValue:v.
       
   166                         v == aView ifTrue:[
       
   167                             s nextPutLine:('   Component: ' , k).
       
   168                         ] ifFalse:[
       
   169                             s nextPutLine:('   Subview of Component: ' , k).
       
   170                         ].
       
   171                     ].
       
   172                 ].
       
   173             ].
   147 
   174 
   148         aView topView ~~ aView ifTrue:[
   175         aView topView ~~ aView ifTrue:[
   149             topViewToInspect := aView topView.
   176             topViewToInspect := aView topView.
   150         ].
   177         ].
   151         lastApplication notNil ifTrue:[
   178         lastApplication notNil ifTrue:[
   152             applicationToInspect := lastApplication.
   179             applicationToInspect := lastApplication.
   153             masterApplicationToInspect := lastApplication masterApplication.
   180             masterApplicationToInspect := lastApplication masterApplication.
       
   181             masterApplicationToInspect == applicationToInspect ifTrue:[
       
   182                 masterApplicationToInspect := nil
       
   183             ].
   154         ].
   184         ].
   155         aView model notNil ifTrue:[
   185         aView model notNil ifTrue:[
   156             modelToInspect := aView model.
   186             modelToInspect := aView model.
   157             ((modelToInspect == applicationToInspect)
   187             ((modelToInspect == applicationToInspect)
   158             or:[ modelToInspect == masterApplicationToInspect ]) ifTrue:[
   188             or:[ modelToInspect == masterApplicationToInspect ]) ifTrue:[
   165             s nextPutLine:('Model: ' , modelToInspect class name).
   195             s nextPutLine:('Model: ' , modelToInspect class name).
   166         ].
   196         ].
   167         topViewToInspect notNil ifTrue:[
   197         topViewToInspect notNil ifTrue:[
   168             s nextPutLine:('Topview: ' , topViewToInspect class name).
   198             s nextPutLine:('Topview: ' , topViewToInspect class name).
   169         ].
   199         ].
       
   200         masterApplicationToInspect notNil ifTrue:[
       
   201             s nextPutLine:('Masterapplication: ' , masterApplicationToInspect class name).
       
   202             genComponentNameForApplication value:masterApplicationToInspect value:s.
       
   203         ].
   170         applicationToInspect notNil ifTrue:[
   204         applicationToInspect notNil ifTrue:[
   171             s nextPutLine:('Application: ' , applicationToInspect class name).
   205             s nextPutLine:('Application: ' , applicationToInspect class name).
   172         ].
   206             genComponentNameForApplication value:applicationToInspect value:s.
   173         masterApplicationToInspect notNil ifTrue:[
       
   174             s nextPutLine:('Masterapplication: ' , masterApplicationToInspect class name).
       
   175         ].
   207         ].
   176 
   208 
   177         "/ identity it as component
   209         "/ identity it as component
   178         masterApplicationToInspect "applicationToInspect" notNil ifTrue:[
       
   179             masterApplicationToInspect "applicationToInspect" builder notNil ifTrue:[
       
   180                 |components v|
       
   181 
       
   182                 components := masterApplicationToInspect "applicationToInspect" builder namedComponents.
       
   183 
       
   184                 v := aView.
       
   185                 [   (components includes:v) not
       
   186                     and:[v container notNil]
       
   187                 ] whileTrue:[
       
   188                     v := v container.
       
   189                 ].
       
   190                 (components includes:v) ifTrue:[
       
   191                     |k|
       
   192 
       
   193                     k := components keyAtValue:v.
       
   194                     v == aView ifTrue:[
       
   195                         s nextPutLine:('Component: ' , k).
       
   196                     ] ifFalse:[
       
   197                         s nextPutLine:('Subview of Component: ' , k).
       
   198                     ].
       
   199                 ].
       
   200             ]
       
   201         ].
       
   202 
   210 
   203         s cr.
   211         s cr.
   204         s nextPutLine:'Press:'.
   212         s nextPutLine:'Press:'.
   205         s nextPutLine:'    ? to show the viewtree'.
   213         s nextPutLine:'    ? to show the viewtree'.
   206         s nextPutLine:'    v to inspect view (V to browse)'.
   214         s nextPutLine:'    v to inspect view (V to browse)'.
   232 
   240 
   233 !FlyByWindowInformation methodsFor:'start & stop'!
   241 !FlyByWindowInformation methodsFor:'start & stop'!
   234 
   242 
   235 initiateHelpFor:aView at:aPointOrNil
   243 initiateHelpFor:aView at:aPointOrNil
   236 finished == true ifTrue:[self halt].
   244 finished == true ifTrue:[self halt].
   237     self initiateHelpFor:aView at:aPointOrNil now:true
   245     super initiateHelpFor:aView at:aPointOrNil 
   238 !
   246 !
   239 
   247 
   240 initiateHelpFor:aView at:aPointOrNil now:showItNow
   248 initiateHelpFor:aView at:aPointOrNil now:showItNow
   241 finished == true ifTrue:[self halt].
   249 finished == true ifTrue:[self halt].
   242     super initiateHelpFor:aView at:aPointOrNil now:showItNow
   250     super initiateHelpFor:aView at:aPointOrNil now:showItNow