FlyByWindowInformation.st
changeset 2824 34ec9ea82209
parent 2823 cd54d69eec13
child 2836 a2e82ebd3bc3
equal deleted inserted replaced
2823:cd54d69eec13 2824:34ec9ea82209
   112 
   112 
   113         lcKey == $a ifTrue:[
   113         lcKey == $a ifTrue:[
   114             obj := lastApplication
   114             obj := lastApplication
   115         ].
   115         ].
   116         lcKey == $o ifTrue:[
   116         lcKey == $o ifTrue:[
   117             obj := lastView model
   117             lastView notNil ifTrue:[
       
   118                 obj := lastView model
       
   119             ].
   118         ].
   120         ].
   119         lcKey == $m ifTrue:[
   121         lcKey == $m ifTrue:[
   120             obj := lastApplication masterApplication
   122             lastApplication notNil ifTrue:[
       
   123                 obj := lastApplication masterApplication
       
   124             ]
       
   125         ].
       
   126         lcKey == $t ifTrue:[
       
   127             lastApplication notNil ifTrue:[
       
   128                 obj := lastApplication topApplication
       
   129             ].
   121         ].
   130         ].
   122         lcKey == $v ifTrue:[
   131         lcKey == $v ifTrue:[
   123             obj := lastView
   132             obj := lastView
   124         ].
   133         ].
   125         lcKey == $t ifTrue:[
   134         lcKey == $w ifTrue:[
   126             obj := lastView topView
   135             lastView notNil ifTrue:[
       
   136                 obj := lastView topView
       
   137             ]
   127         ].
   138         ].
   128         obj notNil ifTrue:[
   139         obj notNil ifTrue:[
   129             key isLowercase ifTrue:[
   140             key isLowercase ifTrue:[
   130                 objToInspect := obj
   141                 objToInspect := obj
   131             ] ifFalse:[
   142             ] ifFalse:[
   141         [ objToBrowse browse ] forkAt:(Processor userSchedulingPriority).
   152         [ objToBrowse browse ] forkAt:(Processor userSchedulingPriority).
   142     ].
   153     ].
   143 
   154 
   144     ^ true
   155     ^ true
   145 
   156 
   146     "Modified: / 12-11-2010 / 11:38:23 / cg"
   157     "Modified: / 12-11-2010 / 11:51:04 / cg"
   147 ! !
   158 ! !
   148 
   159 
   149 !FlyByWindowInformation methodsFor:'help texts'!
   160 !FlyByWindowInformation methodsFor:'help texts'!
   150 
   161 
   151 helpTextFor:aView at:aPointOrNil
   162 helpTextFor:aView at:aPointOrNil
   152     "generate the text to be shown as popup-flyby info"
   163     "generate the text to be shown as popup-flyby info"
   153 
   164 
       
   165     |resources|
       
   166 
   154     lastView := aView.
   167     lastView := aView.
   155     lastApplication := aView application.
   168     lastApplication := aView application.
   156 
   169 
   157     ^ String streamContents:[:s |
   170     resources := self class classResources.
   158         |topViewToInspect applicationToInspect masterApplicationToInspect modelToInspect
   171 
       
   172     ^ Text streamContents:[:s |
       
   173         |topViewToInspect applicationToInspect 
       
   174          masterApplicationToInspect topApplicationToInspect modelToInspect
   159          genComponentNameForApplication|
   175          genComponentNameForApplication|
   160 
   176 
   161         genComponentNameForApplication := [:app :s |
   177         genComponentNameForApplication := 
       
   178             [:app :s |
   162                 (app notNil 
   179                 (app notNil 
   163                 and:[ app builder notNil ]) ifTrue:[
   180                 and:[ app builder notNil ]) ifTrue:[
   164                     |components v|
   181                     |components v|
   165 
   182 
   166                     components := app builder namedComponents.
   183                     components := app builder namedComponents.
   174                     (components includes:v) ifTrue:[
   191                     (components includes:v) ifTrue:[
   175                         |k|
   192                         |k|
   176 
   193 
   177                         k := components keyAtValue:v.
   194                         k := components keyAtValue:v.
   178                         v == aView ifTrue:[
   195                         v == aView ifTrue:[
   179                             s nextPutLine:('   Component: ' , k).
   196                             s nextPutLine:('       component: ' , k).
   180                         ] ifFalse:[
   197                         ] ifFalse:[
   181                             s nextPutLine:('   Subview of Component: ' , k).
   198                             s nextPutLine:('       subview of component: ' , k).
   182                         ].
   199                         ].
   183                     ].
   200                     ].
   184                 ].
   201                 ].
   185             ].
   202             ].
   186 
   203 
   188             topViewToInspect := aView topView.
   205             topViewToInspect := aView topView.
   189         ].
   206         ].
   190         lastApplication notNil ifTrue:[
   207         lastApplication notNil ifTrue:[
   191             applicationToInspect := lastApplication.
   208             applicationToInspect := lastApplication.
   192             masterApplicationToInspect := lastApplication masterApplication.
   209             masterApplicationToInspect := lastApplication masterApplication.
   193             masterApplicationToInspect == applicationToInspect ifTrue:[
   210             masterApplicationToInspect notNil ifTrue:[
   194                 masterApplicationToInspect := nil
   211                 masterApplicationToInspect == applicationToInspect ifTrue:[
   195             ].
   212                     masterApplicationToInspect := nil
       
   213                 ] ifFalse:[
       
   214                     topApplicationToInspect := masterApplicationToInspect topApplication.
       
   215                     topApplicationToInspect == masterApplicationToInspect ifTrue:[
       
   216                         topApplicationToInspect := nil
       
   217                     ]
       
   218                 ].
       
   219             ]
   196         ].
   220         ].
   197         aView model notNil ifTrue:[
   221         aView model notNil ifTrue:[
   198             modelToInspect := aView model.
   222             modelToInspect := aView model.
   199             ((modelToInspect == applicationToInspect)
   223             ((modelToInspect == applicationToInspect)
   200             or:[ modelToInspect == masterApplicationToInspect ]) ifTrue:[
   224             or:[ modelToInspect == masterApplicationToInspect ]) ifTrue:[
   201                 modelToInspect := nil.
   225                 modelToInspect := nil.
   202             ].
   226             ].
   203         ].
   227         ].
   204 
   228 
   205         s nextPutLine:('View: ' , aView class name, ' "',aView name printString,'"').
   229         applicationToInspect notNil ifTrue:[
       
   230             s nextPutLine:(resources string:'Application: %1' with:applicationToInspect class name allBold).
       
   231             genComponentNameForApplication value:applicationToInspect value:s.
       
   232         ].
       
   233         masterApplicationToInspect notNil ifTrue:[
       
   234             s nextPutLine:(resources string:'Master-Application: %1' with:masterApplicationToInspect class name allBold).
       
   235             "/ genComponentNameForApplication value:masterApplicationToInspect value:s.
       
   236         ].
       
   237         topApplicationToInspect notNil ifTrue:[
       
   238             s nextPutLine:(resources string:'Top-Application: %1' with:topApplicationToInspect class name allBold).
       
   239             "/ genComponentNameForApplication value:topApplicationToInspect value:s.
       
   240         ].
       
   241         s nextPutLine:(resources string:'View: %1 "%2"' with:aView class name allBold with:aView name).
       
   242         topViewToInspect notNil ifTrue:[
       
   243             s nextPutLine:(resources string:'Topview: %1' with:topViewToInspect class name allBold).
       
   244         ].
   206         modelToInspect notNil ifTrue:[
   245         modelToInspect notNil ifTrue:[
   207             s nextPutLine:('Model: ' , modelToInspect class name).
   246             s nextPutLine:(resources string:'Model: %1' with:modelToInspect class name allBold).
   208         ].
   247         ].
   209         topViewToInspect notNil ifTrue:[
       
   210             s nextPutLine:('Topview: ' , topViewToInspect class name).
       
   211         ].
       
   212         masterApplicationToInspect notNil ifTrue:[
       
   213             s nextPutLine:('Masterapplication: ' , masterApplicationToInspect class name).
       
   214             genComponentNameForApplication value:masterApplicationToInspect value:s.
       
   215         ].
       
   216         applicationToInspect notNil ifTrue:[
       
   217             s nextPutLine:('Application: ' , applicationToInspect class name).
       
   218             genComponentNameForApplication value:applicationToInspect value:s.
       
   219         ].
       
   220 
       
   221         "/ identity it as component
       
   222 
   248 
   223         s cr.
   249         s cr.
   224         s nextPutLine:'Press:'.
   250         s nextPutLine:'Press:'.
   225         s nextPutLine:'    ? to show the viewtree'.
   251         s nextPutLine:'    ? to show the viewtree'.
   226         applicationToInspect notNil ifTrue:[
   252         applicationToInspect notNil ifTrue:[
   227             s nextPutLine:'    a to inspect application (A to browse)'.
   253             s nextPutLine:'    a to inspect application (A to browse)'.
   228             masterApplicationToInspect notNil ifTrue:[
   254             masterApplicationToInspect notNil ifTrue:[
   229                 s nextPutLine:'    m to inspect masterApplication (M to browse)'.
   255                 s nextPutLine:'    m to inspect masterApplication (M to browse)'.
       
   256                 topApplicationToInspect notNil ifTrue:[
       
   257                     s nextPutLine:'    t to inspect masterApplication (T to browse)'.
       
   258                 ]
   230             ].
   259             ].
   231         ].
   260         ].
   232         s nextPutLine:'    v to inspect view (V to browse)'.
   261         s nextPutLine:'    v to inspect view (V to browse)'.
   233         topViewToInspect notNil ifTrue:[
   262         topViewToInspect notNil ifTrue:[
   234             s nextPutLine:'    t to inspect topView (T to browse)'.
   263             s nextPutLine:'    w to inspect topWindow (W to browse)'.
   235         ].
   264         ].
   236         modelToInspect notNil ifTrue:[
   265         modelToInspect notNil ifTrue:[
   237             s nextPutLine:'    o to inspect model (O to browse)'.
   266             s nextPutLine:'    o to inspect model (O to browse)'.
   238         ].
   267         ].
   239         s cr.
   268         s cr.
   243 
   272 
   244     "
   273     "
   245      self shownInformationOfViewUnderMouseUntilButtonIsPressed
   274      self shownInformationOfViewUnderMouseUntilButtonIsPressed
   246     "
   275     "
   247 
   276 
   248     "Modified: / 12-11-2010 / 11:39:34 / cg"
   277     "Modified: / 12-11-2010 / 11:54:59 / cg"
   249 ! !
   278 ! !
   250 
   279 
   251 !FlyByWindowInformation methodsFor:'private'!
   280 !FlyByWindowInformation methodsFor:'private'!
   252 
   281 
   253 targetViewInitiatesHelpViaSensor
   282 targetViewInitiatesHelpViaSensor