BrowserView.st
changeset 324 f73423ce7271
parent 321 6bbe39d6e44d
child 333 245f0a972fc9
equal deleted inserted replaced
323:f443d7e5bab0 324:f73423ce7271
   403 
   403 
   404 classCategoryMenu
   404 classCategoryMenu
   405     |specialMenu m labels selectors|
   405     |specialMenu m labels selectors|
   406 
   406 
   407     currentClassCategory notNil ifTrue:[
   407     currentClassCategory notNil ifTrue:[
   408         labels :=  #(
   408 	labels :=  #(
   409                         'overall history ...'
   409 			'overall history ...'
   410                         '-'
   410 			'-'
   411                         'checkin each'
   411 			'checkin each'
   412                     ).
   412 		    ).
   413         selectors := #(
   413 	selectors := #(
   414                         classCategoryRepositoryHistory
   414 			classCategoryRepositoryHistory
   415                         nil
   415 			nil
   416                         classCategoryCheckinEach
   416 			classCategoryCheckinEach
   417                      ).
   417 		     ).
   418     ] ifFalse:[
   418     ] ifFalse:[
   419         labels :=  #(
   419 	labels :=  #(
   420                         'overall history'
   420 			'overall history'
   421                     ).
   421 		    ).
   422         selectors := #(
   422 	selectors := #(
   423                         classCategoryRepositoryHistory
   423 			classCategoryRepositoryHistory
   424                      ).
   424 		     ).
   425     ].
   425     ].
   426 
   426 
   427     specialMenu := PopUpMenu 
   427     specialMenu := PopUpMenu 
   428                         labels:(resources array:labels)
   428 			labels:(resources array:labels)
   429                         selectors:selectors
   429 			selectors:selectors
   430                         receiver:self.
   430 			receiver:self.
   431                         
   431                         
   432     device ctrlDown ifTrue:[
   432     device ctrlDown ifTrue:[
   433         ^ specialMenu
   433 	^ specialMenu
   434     ].
   434     ].
   435 
   435 
   436     currentClassCategory isNil ifTrue:[
   436     currentClassCategory isNil ifTrue:[
   437         labels := #(
   437 	labels := #(
   438                     'clone'
   438 		    'clone'
   439                     'spawn full class'
   439 		    'spawn full class'
   440                     '-'
   440 		    '-'
   441                     'update'
   441 		    'update'
   442                     'find class ...'
   442 		    'find class ...'
   443                     'find method ...'
   443 		    'find method ...'
   444                     '-'
   444 		    '-'
   445                     'new class category ...'
   445 		    'new class category ...'
   446                     '-'
   446 		    '-'
   447                     'others'
   447 		    'others ...'
   448                    ).
   448 		   ).
   449         selectors := #(
   449 	selectors := #(
   450                     classCategoryClone
   450 		    classCategoryClone
   451                     classCategorySpawnFullClass
   451 		    classCategorySpawnFullClass
   452                     nil
   452 		    nil
   453                     classCategoryUpdate
   453 		    classCategoryUpdate
   454                     classCategoryFindClass
   454 		    classCategoryFindClass
   455                     classCategoryFindMethod
   455 		    classCategoryFindMethod
   456                     nil
   456 		    nil
   457                     classCategoryNewCategory
   457 		    classCategoryNewCategory
   458                     nil
   458 		    nil
   459                     otherMenu
   459 		    otherMenu
   460                    ).
   460 		   ).
   461     ] ifFalse:[
   461     ] ifFalse:[
   462         labels := #(
   462 	labels := #(
   463                     'fileOut'
   463 		    'fileOut'
   464                     'fileOut each'
   464 		    'fileOut each'
   465 "/
   465 "/
   466 "/                      'fileOut binary'
   466 "/                      'fileOut binary'
   467 "/
   467 "/
   468                     'printOut' 
   468 		    'printOut' 
   469                     'printOut protocol'
   469 		    'printOut protocol'
   470                     '-'
   470 		    '-'
   471                     'clone'
   471 		    'clone'
   472                     'SPAWN_CATEGORY'
   472 		    'SPAWN_CATEGORY'
   473                     'spawn full class'
   473 		    'spawn full class'
   474                     '-'
   474 		    '-'
   475                     'update'
   475 		    'update'
   476                     'find class ...'
   476 		    'find class ...'
   477                     'find method ...'
   477 		    'find method ...'
   478                     '-'
   478 		    '-'
   479                     'new class category ...'
   479 		    'new class category ...'
   480                     'rename ...'
   480 		    'rename ...'
   481                     'remove'
   481 		    'remove'
   482                     '-'
   482 		    '-'
   483                     'others'
   483 		    'others ...'
   484                    ).
   484 		   ).
   485         selectors := #(
   485 	selectors := #(
   486                    classCategoryFileOut
   486 		   classCategoryFileOut
   487                    classCategoryFileOutEach
   487 		   classCategoryFileOutEach
   488                    classCategoryPrintOut
   488 		   classCategoryPrintOut
   489                    classCategoryPrintOutProtocol
   489 		   classCategoryPrintOutProtocol
   490                    nil
   490 		   nil
   491                    classCategoryClone
   491 		   classCategoryClone
   492                    classCategorySpawn
   492 		   classCategorySpawn
   493                    classCategorySpawnFullClass
   493 		   classCategorySpawnFullClass
   494                    nil
   494 		   nil
   495                    classCategoryUpdate
   495 		   classCategoryUpdate
   496                    classCategoryFindClass
   496 		   classCategoryFindClass
   497                    classCategoryFindMethod
   497 		   classCategoryFindMethod
   498                    nil
   498 		   nil
   499                    classCategoryNewCategory
   499 		   classCategoryNewCategory
   500                    classCategoryRename
   500 		   classCategoryRename
   501                    classCategoryRemove
   501 		   classCategoryRemove
   502                    nil
   502 		   nil
   503                    otherMenu
   503 		   otherMenu
   504                    ).
   504 		   ).
   505     ].
   505     ].
   506 
   506 
   507     m := PopUpMenu 
   507     m := PopUpMenu 
   508                 labels:(resources array:labels)
   508 		labels:(resources array:labels)
   509                 selectors:selectors.
   509 		selectors:selectors.
   510     m subMenuAt:#otherMenu put:specialMenu.
   510     m subMenuAt:#otherMenu put:specialMenu.
   511     ^ m
   511     ^ m
   512 
   512 
   513     "Created: 14.9.1995 / 10:50:17 / claus"
   513     "Created: 14.9.1995 / 10:50:17 / claus"
   514     "Modified: 23.12.1995 / 16:47:55 / cg"
   514     "Modified: 23.12.1995 / 16:47:55 / cg"
  1182     "sent by  classListView to ask for the menu"
  1182     "sent by  classListView to ask for the menu"
  1183 
  1183 
  1184     |specialMenu labels selectors m|
  1184     |specialMenu labels selectors m|
  1185 
  1185 
  1186     labels :=  #(
  1186     labels :=  #(
  1187                    'inspect class'
  1187 		   'inspect class'
  1188                    '-'
  1188 		   '-'
  1189                    'primitive definitions'
  1189 		   'primitive definitions'
  1190                    'primitive variables'
  1190 		   'primitive variables'
  1191                    'primitive functions'
  1191 		   'primitive functions'
  1192                    '-'
  1192 		   '-'
  1193                    'container ...'
  1193 		   'container ...'
  1194                    '-'
  1194 		   '-'
  1195                    'revision info' 
  1195 		   'revision info' 
  1196                    'compare with repository ...' 
  1196 		   'compare with repository ...' 
  1197                    '-'
  1197 		   '-'
  1198                    'check into source repository'
  1198 		   'check into source repository'
  1199                    'fileIn from repository ...' 
  1199 		   'fileIn from repository ...' 
  1200                 ).
  1200 		).
  1201     selectors := #(
  1201     selectors := #(
  1202                    classInspect
  1202 		   classInspect
  1203                    nil
  1203 		   nil
  1204                    classPrimitiveDefinitions
  1204 		   classPrimitiveDefinitions
  1205                    classPrimitiveVariables
  1205 		   classPrimitiveVariables
  1206                    classPrimitiveFunctions
  1206 		   classPrimitiveFunctions
  1207                    nil
  1207 		   nil
  1208                    classModifyContainer
  1208 		   classModifyContainer
  1209                    nil
  1209 		   nil
  1210                    classRevisionInfo
  1210 		   classRevisionInfo
  1211                    classCompareWithNewestInRepository
  1211 		   classCompareWithNewestInRepository
  1212                    nil
  1212 		   nil
  1213                    classCheckin
  1213 		   classCheckin
  1214                    classLoadRevision
  1214 		   classLoadRevision
  1215                   ).
  1215 		  ).
  1216 
  1216 
  1217     specialMenu := PopUpMenu
  1217     specialMenu := PopUpMenu
  1218                         labels:(resources array:labels)
  1218 			labels:(resources array:labels)
  1219                         selectors:selectors
  1219 			selectors:selectors
  1220                         receiver:self.
  1220 			receiver:self.
  1221 
  1221 
  1222     currentClass isNil ifTrue:[
  1222     currentClass isNil ifTrue:[
  1223         specialMenu disableAll.
  1223 	specialMenu disableAll.
  1224     ] ifFalse:[
  1224     ] ifFalse:[
  1225         currentClass sourceCodeManager isNil ifTrue:[
  1225 	currentClass sourceCodeManager isNil ifTrue:[
  1226             specialMenu disableAll:#(classModifyContainer classRevisionInfo 
  1226 	    specialMenu disableAll:#(classModifyContainer classRevisionInfo 
  1227                            classLoadRevision classCheckin classCompareWithNewestInRepository).
  1227 			   classLoadRevision classCheckin classCompareWithNewestInRepository).
  1228         ]
  1228 	]
  1229     ].
  1229     ].
  1230 
  1230 
  1231     device ctrlDown ifTrue:[
  1231     device ctrlDown ifTrue:[
  1232         ^ specialMenu
  1232 	^ specialMenu
  1233     ].
  1233     ].
  1234 
  1234 
  1235     currentClass isNil ifTrue:[
  1235     currentClass isNil ifTrue:[
  1236         labels :=    #(
  1236 	labels :=    #(
  1237                        'new class'
  1237 		       'new class'
  1238                      ).
  1238 		     ).
  1239         selectors := #(
  1239 	selectors := #(
  1240                        classNewClass
  1240 		       classNewClass
  1241                      ).
  1241 		     ).
  1242     ] ifFalse:[
  1242     ] ifFalse:[
  1243         currentClass isLoaded ifFalse:[
  1243 	currentClass isLoaded ifFalse:[
  1244             labels :=    #(
  1244 	    labels :=    #(
  1245                            'definition'
  1245 			   'definition'
  1246                            '-'
  1246 			   '-'
  1247                            'new class'
  1247 			   'new class'
  1248                            '-'
  1248 			   '-'
  1249                            'load '
  1249 			   'load '
  1250                          ).
  1250 			 ).
  1251             selectors := #(
  1251 	    selectors := #(
  1252                            classDefinition
  1252 			   classDefinition
  1253                            nil
  1253 			   nil
  1254                            classNewClass
  1254 			   classNewClass
  1255                            nil
  1255 			   nil
  1256                            classLoad
  1256 			   classLoad
  1257                          ).
  1257 			 ).
  1258         ] ifTrue:[
  1258 	] ifTrue:[
  1259             fullProtocol ifTrue:[
  1259 	    fullProtocol ifTrue:[
  1260                 labels :=    #(
  1260 		labels :=    #(
  1261                                'hierarchy' 
  1261 			       'hierarchy' 
  1262                                'definition' 
  1262 			       'definition' 
  1263                                'comment' 
  1263 			       'comment' 
  1264                                'class instvars' 
  1264 			       'class instvars' 
  1265                              ).
  1265 			     ).
  1266                 selectors := #(
  1266 		selectors := #(
  1267                                classHierarchy
  1267 			       classHierarchy
  1268                                classDefinition
  1268 			       classDefinition
  1269                                classComment
  1269 			       classComment
  1270                                classClassInstVars
  1270 			       classClassInstVars
  1271                               ).
  1271 			      ).
  1272             ] ifFalse:[
  1272 	    ] ifFalse:[
  1273                 labels :=    #(
  1273 		labels :=    #(
  1274                                'fileOut'
  1274 			       'fileOut'
  1275                                'printOut'
  1275 			       'printOut'
  1276                                'printOut protocol'
  1276 			       'printOut protocol'
  1277                              " 'printOut full protocol' "
  1277 			     " 'printOut full protocol' "
  1278                                '-'
  1278 			       '-'
  1279                                'SPAWN_CLASS' 
  1279 			       'SPAWN_CLASS' 
  1280                                'spawn full protocol' 
  1280 			       'spawn full protocol' 
  1281                                'spawn hierarchy' 
  1281 			       'spawn hierarchy' 
  1282                                'spawn subclasses' 
  1282 			       'spawn subclasses' 
  1283                                '-'
  1283 			       '-'
  1284                               ).
  1284 			      ).
  1285                 selectors := #(
  1285 		selectors := #(
  1286                                classFileOut
  1286 			       classFileOut
  1287                                classPrintOut
  1287 			       classPrintOut
  1288                                classPrintOutProtocol
  1288 			       classPrintOutProtocol
  1289                             "  classPrintOutFullProtocol "
  1289 			    "  classPrintOutFullProtocol "
  1290                                nil
  1290 			       nil
  1291                                classSpawn
  1291 			       classSpawn
  1292                                classSpawnFullProtocol
  1292 			       classSpawnFullProtocol
  1293                                classSpawnHierarchy
  1293 			       classSpawnHierarchy
  1294                                classSpawnSubclasses
  1294 			       classSpawnSubclasses
  1295                                nil
  1295 			       nil
  1296                               ).
  1296 			      ).
  1297 
  1297 
  1298                 fullClass ifFalse:[
  1298 		fullClass ifFalse:[
  1299                     labels := labels , #(
  1299 		    labels := labels , #(
  1300                                'hierarchy' 
  1300 			       'hierarchy' 
  1301                                'definition' 
  1301 			       'definition' 
  1302                                'comment' 
  1302 			       'comment' 
  1303                                'class instvars' 
  1303 			       'class instvars' 
  1304                "/              'protocols' 
  1304 	       "/              'protocols' 
  1305                                '-'
  1305 			       '-'
  1306                               ).
  1306 			      ).
  1307                     selectors := selectors , #(
  1307 		    selectors := selectors , #(
  1308                                classHierarchy
  1308 			       classHierarchy
  1309                                classDefinition
  1309 			       classDefinition
  1310                                classComment
  1310 			       classComment
  1311                                classClassInstVars
  1311 			       classClassInstVars
  1312                "/              classProtocols 
  1312 	       "/              classProtocols 
  1313                                nil
  1313 			       nil
  1314                               ).
  1314 			      ).
  1315                 ].
  1315 		].
  1316 
  1316 
  1317                 labels := labels , #(
  1317 		labels := labels , #(
  1318                "/              'variable search'
  1318 	       "/              'variable search'
  1319                                'class refs'
  1319 			       'class refs'
  1320                                '-'
  1320 			       '-'
  1321                                'new class'
  1321 			       'new class'
  1322                                'new subclass'
  1322 			       'new subclass'
  1323                                'rename ...'
  1323 			       'rename ...'
  1324                                'remove'
  1324 			       'remove'
  1325                               ).
  1325 			      ).
  1326                 selectors := selectors , #(
  1326 		selectors := selectors , #(
  1327                "/              variables
  1327 	       "/              variables
  1328                                classRefs
  1328 			       classRefs
  1329                                nil
  1329 			       nil
  1330                                classNewClass
  1330 			       classNewClass
  1331                                classNewSubclass
  1331 			       classNewSubclass
  1332                                classRename
  1332 			       classRename
  1333                                classRemove
  1333 			       classRemove
  1334                               ).
  1334 			      ).
  1335                 currentClass wasAutoloaded ifTrue:[
  1335 		currentClass wasAutoloaded ifTrue:[
  1336                     labels := labels , #(
  1336 		    labels := labels , #(
  1337                                'unload'
  1337 			       'unload'
  1338                               ).
  1338 			      ).
  1339                     selectors := selectors , #(
  1339 		    selectors := selectors , #(
  1340                                classUnload
  1340 			       classUnload
  1341                               ).
  1341 			      ).
  1342                 ]
  1342 		]
  1343             ]
  1343 	    ]
  1344         ].
  1344 	].
  1345     ].
  1345     ].
  1346 
  1346 
  1347     labels := labels , #(
  1347     labels := labels , #(
  1348                           '-'
  1348 			  '-'
  1349                           'others'
  1349 			  'others ...'
  1350                         ).
  1350 			).
  1351     selectors := selectors , #(
  1351     selectors := selectors , #(
  1352                           nil
  1352 			  nil
  1353                           otherMenu
  1353 			  otherMenu
  1354                         ).
  1354 			).
  1355 
  1355 
  1356     m := PopUpMenu 
  1356     m := PopUpMenu 
  1357             labels:(resources array:labels)
  1357 	    labels:(resources array:labels)
  1358             selectors:selectors.
  1358 	    selectors:selectors.
  1359 
  1359 
  1360     m subMenuAt:#otherMenu put:specialMenu.
  1360     m subMenuAt:#otherMenu put:specialMenu.
  1361 
  1361 
  1362     ^ m
  1362     ^ m
  1363 
  1363 
  4194 
  4194 
  4195     currentMethod := MessageTracer perform:aSelector with:currentMethod.
  4195     currentMethod := MessageTracer perform:aSelector with:currentMethod.
  4196     self updateMethodListWithScroll:false keepSelection:true.
  4196     self updateMethodListWithScroll:false keepSelection:true.
  4197 
  4197 
  4198     (currentMethod notNil and:[currentMethod isWrapped not]) ifTrue:[
  4198     (currentMethod notNil and:[currentMethod isWrapped not]) ifTrue:[
  4199         Class withoutUpdatingChangesDo:[
  4199 	Class withoutUpdatingChangesDo:[
  4200             currentClass changed:#methodDictionary with:currentSelector.
  4200 	    currentClass changed:#methodDictionary with:currentSelector.
  4201         ]
  4201 	]
  4202     ]
  4202     ]
  4203 
  4203 
  4204     "Modified: 15.12.1995 / 10:54:40 / cg"
  4204     "Modified: 15.12.1995 / 10:54:40 / cg"
  4205 !
  4205 !
  4206 
  4206 
  4410      searchLabels searchSelectors
  4410      searchLabels searchSelectors
  4411      sepLocalLabels sepLocalSelectors
  4411      sepLocalLabels sepLocalSelectors
  4412      localSearchLabels localSearchSelectors|
  4412      localSearchLabels localSearchSelectors|
  4413 
  4413 
  4414     currentMethod notNil ifTrue:[
  4414     currentMethod notNil ifTrue:[
  4415         currentMethod isWrapped ifTrue:[
  4415 	currentMethod isWrapped ifTrue:[
  4416             (MessageTracer isCountingMemoryUsage:currentMethod) ifTrue:[
  4416 	    (MessageTracer isCountingMemoryUsage:currentMethod) ifTrue:[
  4417                 brkLabels := #(
  4417 		brkLabels := #(
  4418                                     '-'
  4418 				    '-'
  4419                                     'stop mem usage' 
  4419 				    'stop mem usage' 
  4420                               ).
  4420 			      ).
  4421 
  4421 
  4422                 brkSelectors := #(
  4422 		brkSelectors := #(
  4423                                     nil
  4423 				    nil
  4424                                     methodStopMemoryUsage
  4424 				    methodStopMemoryUsage
  4425                                  )
  4425 				 )
  4426             ] ifFalse:[
  4426 	    ] ifFalse:[
  4427                 (MessageTracer isCounting:currentMethod) ifTrue:[
  4427 		(MessageTracer isCounting:currentMethod) ifTrue:[
  4428                     brkLabels := #(
  4428 		    brkLabels := #(
  4429                                         '-'
  4429 					'-'
  4430                                         'stop counting' 
  4430 					'stop counting' 
  4431                                   ).
  4431 				  ).
  4432 
  4432 
  4433                     brkSelectors := #(
  4433 		    brkSelectors := #(
  4434                                         nil
  4434 					nil
  4435                                         methodStopCounting
  4435 					methodStopCounting
  4436                                      )
  4436 				     )
  4437                 ] ifFalse:[
  4437 		] ifFalse:[
  4438                     brkLabels := #(
  4438 		    brkLabels := #(
  4439                                         '-'
  4439 					'-'
  4440                                         'remove break/trace' 
  4440 					'remove break/trace' 
  4441                                   ).
  4441 				  ).
  4442 
  4442 
  4443                     brkSelectors := #(
  4443 		    brkSelectors := #(
  4444                                         nil
  4444 					nil
  4445                                         methodRemoveBreakOrTrace
  4445 					methodRemoveBreakOrTrace
  4446                                      )
  4446 				     )
  4447                 ]
  4447 		]
  4448             ]
  4448 	    ]
  4449         ] ifFalse:[
  4449 	] ifFalse:[
  4450             brkLabels := #(
  4450 	    brkLabels := #(
  4451                                 '-'
  4451 				'-'
  4452                                 'breakpoint' 
  4452 				'breakpoint' 
  4453                                 'trace' 
  4453 				'trace' 
  4454                                 'trace sender' 
  4454 				'trace sender' 
  4455                                 'trace full walkback' 
  4455 				'trace full walkback' 
  4456                                 'start counting'
  4456 				'start counting'
  4457                                 'start mem usage'
  4457 				'start mem usage'
  4458                           ).
  4458 			  ).
  4459 
  4459 
  4460             brkSelectors := #(
  4460 	    brkSelectors := #(
  4461                                 nil
  4461 				nil
  4462                                 methodBreakPoint
  4462 				methodBreakPoint
  4463                                 methodTrace
  4463 				methodTrace
  4464                                 methodTraceSender
  4464 				methodTraceSender
  4465                                 methodTraceFull
  4465 				methodTraceFull
  4466                                 methodStartCounting
  4466 				methodStartCounting
  4467                                 methodStartMemoryUsage
  4467 				methodStartMemoryUsage
  4468                              )
  4468 			     )
  4469         ].
  4469 	].
  4470 
  4470 
  4471         Method methodPrivacySupported ifTrue:[
  4471 	Method methodPrivacySupported ifTrue:[
  4472             labels := #(
  4472 	    labels := #(
  4473                             'inspect method'
  4473 			    'inspect method'
  4474                             'compile to machine code'
  4474 			    'compile to machine code'
  4475                             'decompile'
  4475 			    'decompile'
  4476                             '-'
  4476 			    '-'
  4477                             'make private'
  4477 			    'make private'
  4478                             'make protected'
  4478 			    'make protected'
  4479                             'make public'
  4479 			    'make public'
  4480                             'make ignored'
  4480 			    'make ignored'
  4481                        ).
  4481 		       ).
  4482             selectors := #(
  4482 	    selectors := #(
  4483                             methodInspect
  4483 			    methodInspect
  4484                             methodSTCCompile
  4484 			    methodSTCCompile
  4485                             methodDecompile
  4485 			    methodDecompile
  4486                             nil
  4486 			    nil
  4487                             methodMakePrivate
  4487 			    methodMakePrivate
  4488                             methodMakeProtected
  4488 			    methodMakeProtected
  4489                             methodMakePublic
  4489 			    methodMakePublic
  4490                             methodMakeIgnored
  4490 			    methodMakeIgnored
  4491                           )
  4491 			  )
  4492         ] ifFalse:[
  4492 	] ifFalse:[
  4493             labels := #(
  4493 	    labels := #(
  4494                             'inspect method'
  4494 			    'inspect method'
  4495                             'compile to machine code'
  4495 			    'compile to machine code'
  4496                             'decompile'
  4496 			    'decompile'
  4497                        ).
  4497 		       ).
  4498             selectors := #(
  4498 	    selectors := #(
  4499                             methodInspect
  4499 			    methodInspect
  4500                             methodSTCCompile
  4500 			    methodSTCCompile
  4501                             methodDecompile
  4501 			    methodDecompile
  4502                           )
  4502 			  )
  4503         ].
  4503 	].
  4504 
  4504 
  4505         labels := labels , brkLabels.
  4505 	labels := labels , brkLabels.
  4506         selectors := selectors , brkSelectors.
  4506 	selectors := selectors , brkSelectors.
  4507 
  4507 
  4508         specialMenu := PopUpMenu
  4508 	specialMenu := PopUpMenu
  4509                             labels:(resources array:labels)
  4509 			    labels:(resources array:labels)
  4510                             selectors:selectors.
  4510 			    selectors:selectors.
  4511     ].
  4511     ].
  4512 
  4512 
  4513     device ctrlDown ifTrue:[
  4513     device ctrlDown ifTrue:[
  4514         currentMethod isNil ifTrue:[
  4514 	currentMethod isNil ifTrue:[
  4515             methodListView flash.
  4515 	    methodListView flash.
  4516             ^ nil
  4516 	    ^ nil
  4517         ].
  4517 	].
  4518 
  4518 
  4519         ^ specialMenu
  4519 	^ specialMenu
  4520     ].
  4520     ].
  4521 
  4521 
  4522 
  4522 
  4523     sepLocalLabels := sepLocalSelectors := #().
  4523     sepLocalLabels := sepLocalSelectors := #().
  4524 
  4524 
  4525     searchLabels := #(
  4525     searchLabels := #(
  4526                                 'senders ...'
  4526 				'senders ...'
  4527                                 'implementors ...'
  4527 				'implementors ...'
  4528                                 'globals ...'
  4528 				'globals ...'
  4529                                 'string search ...'
  4529 				'string search ...'
  4530                                 'apropos ...'
  4530 				'apropos ...'
  4531                     ).
  4531 		    ).
  4532     searchSelectors := #(
  4532     searchSelectors := #(
  4533                                 methodSenders
  4533 				methodSenders
  4534                                 methodImplementors
  4534 				methodImplementors
  4535                                 methodGlobalReferends
  4535 				methodGlobalReferends
  4536                                 methodStringSearch
  4536 				methodStringSearch
  4537                                 methodAproposSearch
  4537 				methodAproposSearch
  4538                         ).
  4538 			).
  4539 
  4539 
  4540     currentClass notNil ifTrue:[
  4540     currentClass notNil ifTrue:[
  4541         localSearchLabels := #(
  4541 	localSearchLabels := #(
  4542                                 '-'
  4542 				'-'
  4543                                 'local senders ...'
  4543 				'local senders ...'
  4544                                 'local implementors ...'
  4544 				'local implementors ...'
  4545                                 'local super sends ...'
  4545 				'local super sends ...'
  4546                                 'local string search ...'
  4546 				'local string search ...'
  4547                                 'local apropos ...'
  4547 				'local apropos ...'
  4548                             ).
  4548 			    ).
  4549         localSearchSelectors := #(
  4549 	localSearchSelectors := #(
  4550                                 nil
  4550 				nil
  4551                                 methodLocalSenders
  4551 				methodLocalSenders
  4552                                 methodLocalImplementors
  4552 				methodLocalImplementors
  4553                                 methodLocalSuperSends
  4553 				methodLocalSuperSends
  4554                                 methodLocalStringSearch
  4554 				methodLocalStringSearch
  4555                                 methodLocalAproposSearch
  4555 				methodLocalAproposSearch
  4556                               ).
  4556 			      ).
  4557     ] ifFalse:[
  4557     ] ifFalse:[
  4558         localSearchLabels := localSearchSelectors := #()
  4558 	localSearchLabels := localSearchSelectors := #()
  4559     ].
  4559     ].
  4560 
  4560 
  4561     currentMethodCategory notNil ifTrue:[
  4561     currentMethodCategory notNil ifTrue:[
  4562         sepLocalLabels := #('-'). sepLocalSelectors := #(nil).
  4562 	sepLocalLabels := #('-'). sepLocalSelectors := #(nil).
  4563 
  4563 
  4564         newLabels :=           #(
  4564 	newLabels :=           #(
  4565                                 'new method' 
  4565 				'new method' 
  4566                                 ).
  4566 				).
  4567 
  4567 
  4568         newSelectors :=    #(
  4568 	newSelectors :=    #(
  4569                                 methodNewMethod
  4569 				methodNewMethod
  4570                              ).
  4570 			     ).
  4571     ] ifFalse:[
  4571     ] ifFalse:[
  4572         newLabels := newSelectors := #()
  4572 	newLabels := newSelectors := #()
  4573     ].
  4573     ].
  4574 
  4574 
  4575     currentMethod notNil ifTrue:[
  4575     currentMethod notNil ifTrue:[
  4576         fileLabels :=           #(
  4576 	fileLabels :=           #(
  4577                                 'fileOut'
  4577 				'fileOut'
  4578                                 'printOut'
  4578 				'printOut'
  4579                                 '-'
  4579 				'-'
  4580                                 'SPAWN_METHOD'
  4580 				'SPAWN_METHOD'
  4581                                 '-'
  4581 				'-'
  4582                                 ).
  4582 				).
  4583 
  4583 
  4584         fileSelectors :=    #(
  4584 	fileSelectors :=    #(
  4585                                 methodFileOut
  4585 				methodFileOut
  4586                                 methodPrintOut
  4586 				methodPrintOut
  4587                                 nil
  4587 				nil
  4588                                 methodSpawn
  4588 				methodSpawn
  4589                                 nil
  4589 				nil
  4590                              ).
  4590 			     ).
  4591 
  4591 
  4592         sepLocalLabels := #('-'). sepLocalSelectors := #(nil).
  4592 	sepLocalLabels := #('-'). sepLocalSelectors := #(nil).
  4593 
  4593 
  4594         mthdLabels :=           #(
  4594 	mthdLabels :=           #(
  4595                                 'change category ...' 
  4595 				'change category ...' 
  4596                                 'move ...'
  4596 				'move ...'
  4597                                 'remove'
  4597 				'remove'
  4598                                 ).
  4598 				).
  4599 
  4599 
  4600         mthdSelectors :=    #(
  4600 	mthdSelectors :=    #(
  4601                                 methodChangeCategory
  4601 				methodChangeCategory
  4602                                 methodMove
  4602 				methodMove
  4603                                 methodRemove
  4603 				methodRemove
  4604                              ).
  4604 			     ).
  4605 
  4605 
  4606     ] ifFalse:[
  4606     ] ifFalse:[
  4607         fileLabels := fileSelectors := #().
  4607 	fileLabels := fileSelectors := #().
  4608         mthdLabels := mthdSelectors := #().
  4608 	mthdLabels := mthdSelectors := #().
  4609     ].
  4609     ].
  4610 
  4610 
  4611 
  4611 
  4612 
  4612 
  4613     labels :=
  4613     labels :=
  4614                 fileLabels ,
  4614 		fileLabels ,
  4615                 searchLabels ,
  4615 		searchLabels ,
  4616                 localSearchLabels ,
  4616 		localSearchLabels ,
  4617                 sepLocalLabels ,
  4617 		sepLocalLabels ,
  4618                 newLabels ,
  4618 		newLabels ,
  4619                 mthdLabels.
  4619 		mthdLabels.
  4620 
  4620 
  4621     selectors :=
  4621     selectors :=
  4622                 fileSelectors ,
  4622 		fileSelectors ,
  4623                 searchSelectors ,
  4623 		searchSelectors ,
  4624                 localSearchSelectors ,
  4624 		localSearchSelectors ,
  4625                 sepLocalSelectors ,
  4625 		sepLocalSelectors ,
  4626                 newSelectors ,
  4626 		newSelectors ,
  4627                 mthdSelectors .
  4627 		mthdSelectors .
  4628 
  4628 
  4629     specialMenu notNil ifTrue:[
  4629     specialMenu notNil ifTrue:[
  4630         labels := labels , #(
  4630 	labels := labels , #(
  4631                         '-'
  4631 			'-'
  4632                         'others'
  4632 			'others ...'
  4633                   ).
  4633 		  ).
  4634         selectors := selectors , #(
  4634 	selectors := selectors , #(
  4635                         nil
  4635 			nil
  4636                         #otherMenu
  4636 			#otherMenu
  4637                   )
  4637 		  )
  4638     ].
  4638     ].
  4639 
  4639 
  4640     m := PopUpMenu
  4640     m := PopUpMenu
  4641          labels:(resources array:labels)
  4641 	 labels:(resources array:labels)
  4642          selectors:selectors.
  4642 	 selectors:selectors.
  4643 
  4643 
  4644     specialMenu notNil ifTrue:[
  4644     specialMenu notNil ifTrue:[
  4645         m subMenuAt:#otherMenu put:specialMenu.
  4645 	m subMenuAt:#otherMenu put:specialMenu.
  4646     ].
  4646     ].
  4647 
  4647 
  4648     currentMethod notNil ifTrue:[
  4648     currentMethod notNil ifTrue:[
  4649         currentMethod isPrivate ifTrue:[
  4649 	currentMethod isPrivate ifTrue:[
  4650             m disable:#methodMakePrivate
  4650 	    m disable:#methodMakePrivate
  4651         ].
  4651 	].
  4652         currentMethod isProtected ifTrue:[
  4652 	currentMethod isProtected ifTrue:[
  4653             m disable:#methodMakeProtected
  4653 	    m disable:#methodMakeProtected
  4654         ].
  4654 	].
  4655         currentMethod isPublic ifTrue:[
  4655 	currentMethod isPublic ifTrue:[
  4656             m disable:#methodMakePublic
  4656 	    m disable:#methodMakePublic
  4657         ].
  4657 	].
  4658         currentMethod isIgnored ifTrue:[
  4658 	currentMethod isIgnored ifTrue:[
  4659             m disable:#methodMakeIgnored
  4659 	    m disable:#methodMakeIgnored
  4660         ].
  4660 	].
  4661     ].
  4661     ].
  4662     currentMethod notNil ifTrue:[
  4662     currentMethod notNil ifTrue:[
  4663         (currentMethod code notNil
  4663 	(currentMethod code notNil
  4664         or:[Compiler canCreateMachineCode not]) ifTrue:[
  4664 	or:[Compiler canCreateMachineCode not]) ifTrue:[
  4665             m disable:#methodSTCCompile
  4665 	    m disable:#methodSTCCompile
  4666         ].
  4666 	].
  4667         currentMethod byteCode isNil ifTrue:[
  4667 	currentMethod byteCode isNil ifTrue:[
  4668             m disable:#methodDecompile
  4668 	    m disable:#methodDecompile
  4669         ].
  4669 	].
  4670     ].
  4670     ].
  4671     ^ m
  4671     ^ m
  4672 
  4672 
  4673     "Created: 23.11.1995 / 12:02:29 / cg"
  4673     "Created: 23.11.1995 / 12:02:29 / cg"
  4674     "Modified: 18.12.1995 / 16:20:07 / stefan"
  4674     "Modified: 18.12.1995 / 16:20:07 / stefan"
  4978 
  4978 
  4979     |newList searchCategory all p|
  4979     |newList searchCategory all p|
  4980 
  4980 
  4981     all := (aCategory = '* all *').
  4981     all := (aCategory = '* all *').
  4982     (aCategory = '* no category *') ifTrue:[
  4982     (aCategory = '* no category *') ifTrue:[
  4983         searchCategory := nil
  4983 	searchCategory := nil
  4984     ] ifFalse:[
  4984     ] ifFalse:[
  4985         searchCategory := aCategory
  4985 	searchCategory := aCategory
  4986     ].
  4986     ].
  4987     newList := OrderedCollection new.
  4987     newList := OrderedCollection new.
  4988     aClass methodArray with:aClass selectorArray do:[:aMethod :selector |
  4988     aClass methodArray with:aClass selectorArray do:[:aMethod :selector |
  4989         |sel moreInfo|
  4989 	|sel moreInfo|
  4990 
  4990 
  4991         (all or:[aMethod category = searchCategory]) ifTrue:[
  4991 	(all or:[aMethod category = searchCategory]) ifTrue:[
  4992             sel := selector.
  4992 	    sel := selector.
  4993         
  4993         
  4994             moreInfo := ''.
  4994 	    moreInfo := ''.
  4995             (p := aMethod privacy) ~~ #public ifTrue:[
  4995 	    (p := aMethod privacy) ~~ #public ifTrue:[
  4996                 moreInfo := '    (* ' , p , ' *)'.
  4996 		moreInfo := '    (* ' , p , ' *)'.
  4997             ].
  4997 	    ].
  4998             aMethod isWrapped ifTrue:[
  4998 	    aMethod isWrapped ifTrue:[
  4999                 (MessageTracer isCounting:aMethod) ifTrue:[
  4999 		(MessageTracer isCounting:aMethod) ifTrue:[
  5000 "/                    moreInfo size == 0 ifTrue:[
  5000 "/                    moreInfo size == 0 ifTrue:[
  5001 "/                        sel size < 24 ifTrue:[
  5001 "/                        sel size < 24 ifTrue:[
  5002 "/                            moreInfo := (String new:(24 - sel size) withAll:$ )
  5002 "/                            moreInfo := (String new:(24 - sel size) withAll:$ )
  5003 "/                        ]
  5003 "/                        ]
  5004 "/                    ].
  5004 "/                    ].
  5005                     (MessageTracer isCountingMemoryUsage:aMethod) ifTrue:[
  5005 		    (MessageTracer isCountingMemoryUsage:aMethod) ifTrue:[
  5006                         moreInfo := moreInfo , 
  5006 			moreInfo := moreInfo , 
  5007                              '    (mem usage ' , (MessageTracer memoryUsageOfMethod:aMethod) printString , ' Bytes)'.
  5007 			     '    (mem usage ' , (MessageTracer memoryUsageOfMethod:aMethod) printString , ' Bytes)'.
  5008                     ] ifFalse:[
  5008 		    ] ifFalse:[
  5009                         moreInfo := moreInfo , 
  5009 			moreInfo := moreInfo , 
  5010                              '    (called ' , (MessageTracer executionCountOfMethod:aMethod) printString , ' times)'.
  5010 			     '    (called ' , (MessageTracer executionCountOfMethod:aMethod) printString , ' times)'.
  5011                     ]
  5011 		    ]
  5012                 ] ifFalse:[
  5012 		] ifFalse:[
  5013                     moreInfo := ' !!'
  5013 		    moreInfo := ' !!'
  5014                 ]
  5014 		]
  5015             ].
  5015 	    ].
  5016             aMethod isInvalid ifTrue:[
  5016 	    aMethod isInvalid ifTrue:[
  5017                 moreInfo := '    (** not executable **)'
  5017 		moreInfo := '    (** not executable **)'
  5018             ].
  5018 	    ].
  5019             aMethod isLazyMethod ifTrue:[
  5019 	    aMethod isLazyMethod ifTrue:[
  5020 "/                moreInfo := '    (lazy)'
  5020 "/                moreInfo := '    (lazy)'
  5021             ] ifFalse:[
  5021 	    ] ifFalse:[
  5022                 (aMethod code isNil 
  5022 		(aMethod code isNil 
  5023                 and:[aMethod byteCode isNil]) ifTrue:[
  5023 		and:[aMethod byteCode isNil]) ifTrue:[
  5024                     moreInfo := '    (** unloaded **)'
  5024 		    moreInfo := '    (** unloaded **)'
  5025                 ]
  5025 		]
  5026             ].
  5026 	    ].
  5027         
  5027         
  5028             sel := sel , moreInfo.
  5028 	    sel := sel , moreInfo.
  5029             newList add:sel
  5029 	    newList add:sel
  5030         ]
  5030 	]
  5031     ].
  5031     ].
  5032     (newList size == 0) ifTrue:[^ nil].
  5032     (newList size == 0) ifTrue:[^ nil].
  5033     ^ newList sort
  5033     ^ newList sort
  5034 
  5034 
  5035     "Modified: 28.8.1995 / 21:53:34 / claus"
  5035     "Modified: 28.8.1995 / 21:53:34 / claus"
  5082 
  5082 
  5083 methodSelectionChanged
  5083 methodSelectionChanged
  5084     "method selection has changed - update dependent views"
  5084     "method selection has changed - update dependent views"
  5085 
  5085 
  5086     self withWaitCursorDo:[
  5086     self withWaitCursorDo:[
  5087         |index cls|
  5087 	|index cls|
  5088 
  5088 
  5089         self updateCodeView.
  5089 	self updateCodeView.
  5090         (currentMethod notNil and:[MessageTracer isCounting:currentMethod]) ifTrue:[
  5090 	(currentMethod notNil and:[MessageTracer isCounting:currentMethod]) ifTrue:[
  5091             self updateMethodListWithScroll:false.
  5091 	    self updateMethodListWithScroll:false.
  5092         ].
  5092 	].
  5093 
  5093 
  5094         aspect := nil.
  5094 	aspect := nil.
  5095         self setAcceptAndExplainActionsForMethod.
  5095 	self setAcceptAndExplainActionsForMethod.
  5096 
  5096 
  5097         "
  5097 	"
  5098          if there is any autoSearch string, do the search
  5098 	 if there is any autoSearch string, do the search
  5099         "
  5099 	"
  5100         autoSearch notNil ifTrue:[
  5100 	autoSearch notNil ifTrue:[
  5101             codeView searchFwd:autoSearch startingAtLine:1 col:0 ifAbsent:[]
  5101 	    codeView searchFwd:autoSearch startingAtLine:1 col:0 ifAbsent:[]
  5102         ].
  5102 	].
  5103 
  5103 
  5104         fullProtocol ifTrue:[
  5104 	fullProtocol ifTrue:[
  5105             "
  5105 	    "
  5106              remove any bold attribute from classList
  5106 	     remove any bold attribute from classList
  5107             "
  5107 	    "
  5108             1 to:classListView list size do:[:i |
  5108 	    1 to:classListView list size do:[:i |
  5109                 classListView attributeAt:i remove:#bold.
  5109 		classListView attributeAt:i remove:#bold.
  5110             ].
  5110 	    ].
  5111             "
  5111 	    "
  5112              boldify the class where this method is implemented
  5112 	     boldify the class where this method is implemented
  5113             "
  5113 	    "
  5114             currentMethod notNil ifTrue:[
  5114 	    currentMethod notNil ifTrue:[
  5115                 cls := currentMethod who at:1.
  5115 		cls := currentMethod who at:1.
  5116                 index := classListView list indexOf:(cls name).
  5116 		index := classListView list indexOf:(cls name).
  5117                 (index == 0 
  5117 		(index == 0 
  5118                  and:[cls isMeta
  5118 		 and:[cls isMeta
  5119                  and:[cls name endsWith:'class']]) ifTrue:[
  5119 		 and:[cls name endsWith:'class']]) ifTrue:[
  5120                     index := classListView list indexOf:(cls name copyWithoutLast:5).
  5120 		    index := classListView list indexOf:(cls name copyWithoutLast:5).
  5121                 ].
  5121 		].
  5122                 index ~~ 0 ifTrue:[
  5122 		index ~~ 0 ifTrue:[
  5123                     classListView attributeAt:index add:#bold.
  5123 		    classListView attributeAt:index add:#bold.
  5124                 ].
  5124 		].
  5125                 currentClass := acceptClass := cls.
  5125 		currentClass := acceptClass := cls.
  5126             ]
  5126 	    ]
  5127         ].
  5127 	].
  5128     ]
  5128     ]
  5129 
  5129 
  5130     "Created: 23.11.1995 / 14:17:44 / cg"
  5130     "Created: 23.11.1995 / 14:17:44 / cg"
  5131     "Modified: 15.12.1995 / 17:06:36 / cg"
  5131     "Modified: 15.12.1995 / 17:06:36 / cg"
  5132 !
  5132 !
  5235 updateMethodListWithScroll:scroll keepSelection:keep
  5235 updateMethodListWithScroll:scroll keepSelection:keep
  5236     |selectors scr first last selection|
  5236     |selectors scr first last selection|
  5237 
  5237 
  5238 
  5238 
  5239     methodListView notNil ifTrue:[
  5239     methodListView notNil ifTrue:[
  5240         selection := methodListView selection.
  5240 	selection := methodListView selection.
  5241 
  5241 
  5242         currentMethodCategory notNil ifTrue:[
  5242 	currentMethodCategory notNil ifTrue:[
  5243             fullProtocol ifTrue:[
  5243 	    fullProtocol ifTrue:[
  5244                 selectors := self listOfAllSelectorsInCategory:currentMethodCategory 
  5244 		selectors := self listOfAllSelectorsInCategory:currentMethodCategory 
  5245                                             inFullProtocolHierarchyOfClass:actualClass
  5245 					    inFullProtocolHierarchyOfClass:actualClass
  5246             ] ifFalse:[
  5246 	    ] ifFalse:[
  5247                 selectors := self listOfAllSelectorsInCategory:currentMethodCategory
  5247 		selectors := self listOfAllSelectorsInCategory:currentMethodCategory
  5248                                                        ofClass:actualClass
  5248 						       ofClass:actualClass
  5249             ]
  5249 	    ]
  5250         ].
  5250 	].
  5251         scr := scroll.
  5251 	scr := scroll.
  5252         first := methodListView firstLineShown.
  5252 	first := methodListView firstLineShown.
  5253         first ~~ 1 ifTrue:[
  5253 	first ~~ 1 ifTrue:[
  5254             last := methodListView lastLineShown.
  5254 	    last := methodListView lastLineShown.
  5255             selectors size <= (last - first + 1) ifTrue:[
  5255 	    selectors size <= (last - first + 1) ifTrue:[
  5256                 scr := true
  5256 		scr := true
  5257             ]
  5257 	    ]
  5258         ].
  5258 	].
  5259         methodListView list = selectors ifFalse:[
  5259 	methodListView list = selectors ifFalse:[
  5260             scr ifTrue:[
  5260 	    scr ifTrue:[
  5261                 methodListView contents:selectors
  5261 		methodListView contents:selectors
  5262             ] ifFalse:[
  5262 	    ] ifFalse:[
  5263                 methodListView setContents:selectors
  5263 		methodListView setContents:selectors
  5264             ]
  5264 	    ]
  5265         ].
  5265 	].
  5266         keep ifTrue:[
  5266 	keep ifTrue:[
  5267             methodListView selection:selection.
  5267 	    methodListView selection:selection.
  5268         ]
  5268 	]
  5269     ]
  5269     ]
  5270 
  5270 
  5271     "Modified: 18.12.1995 / 22:54:04 / stefan"
  5271     "Modified: 18.12.1995 / 22:54:04 / stefan"
  5272 ! !
  5272 ! !
  5273 
  5273 
  6553 ! !
  6553 ! !
  6554 
  6554 
  6555 !BrowserView class methodsFor:'documentation'!
  6555 !BrowserView class methodsFor:'documentation'!
  6556 
  6556 
  6557 version
  6557 version
  6558     ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.83 1995-12-23 17:22:18 cg Exp $'
  6558     ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.84 1996-01-02 12:09:59 cg Exp $'
  6559 ! !
  6559 ! !
  6560 BrowserView initialize!
  6560 BrowserView initialize!