BrowserView.st
changeset 2645 d01d467c5199
parent 2644 8dc04189f7b1
child 2646 bb22d1b835e6
equal deleted inserted replaced
2644:8dc04189f7b1 2645:d01d467c5199
  2472     "for all classes, ask the sourceCodeManager for the most recent version
  2472     "for all classes, ask the sourceCodeManager for the most recent version
  2473      and compare this to the actual version. Send mismatch info to the Transcript.
  2473      and compare this to the actual version. Send mismatch info to the Transcript.
  2474      Use this, to find classes, which need to be reloaded from the repository."
  2474      Use this, to find classes, which need to be reloaded from the repository."
  2475 
  2475 
  2476     self withBusyCursorDo:[
  2476     self withBusyCursorDo:[
  2477 	|logMessage classes repVersion clsVersion binVersion
  2477         |logMessage classes repVersion clsVersion binVersion
  2478 	 count unloadedCount badCount cat needCheckIn|
  2478          count unloadedCount badCount cat needCheckIn|
  2479 
  2479 
  2480 	cat := currentClassCategory.
  2480         cat := currentClassCategory.
  2481 	(cat = '* hierarchy *') ifTrue:[
  2481         (cat = '* hierarchy *') ifTrue:[
  2482 	    cat := '* all *'
  2482             cat := '* all *'
  2483 	].
  2483         ].
  2484 
  2484 
  2485 	classes := self listOfAllClassesInCategory:cat names:false.
  2485         classes := self listOfAllClassesInCategory:cat names:false.
  2486 	classes isNil ifTrue:[
  2486         classes isNil ifTrue:[
  2487 	    Transcript showCR:'no classes to validate'.
  2487             Transcript showCR:'no classes to validate'.
  2488 	    ^ self
  2488             ^ self
  2489 	].
  2489         ].
  2490 
  2490 
  2491 	count := unloadedCount := badCount := needCheckIn := 0.
  2491         count := unloadedCount := badCount := needCheckIn := 0.
  2492 
  2492 
  2493 	Transcript cr.
  2493         Transcript cr.
  2494 	Transcript showCR:'-------------------------------------------------'.
  2494         Transcript showCR:'-------------------------------------------------'.
  2495 	Transcript showCR:'checking class revisions vs. repository ...'.
  2495         Transcript showCR:'checking class revisions vs. repository ...'.
  2496 	Transcript cr.
  2496         Transcript cr.
  2497 
  2497 
  2498 	classes do:[:aClass |
  2498         classes do:[:aClass |
  2499 	    |clsName msg sourceCodeManager repSource currentSource aStream|
  2499             |clsName msg sourceCodeManager repSource currentSource aStream|
  2500 
  2500 
  2501 	    count := count + 1.
  2501             count := count + 1.
  2502 
  2502 
  2503 	    "/ ignore autoloaded and private classes here
  2503             "/ ignore autoloaded and private classes here
  2504                 
  2504                 
  2505 	    clsName := aClass name.
  2505             clsName := aClass name.
  2506 
  2506 
  2507 	    aClass isLoaded ifFalse:[
  2507             aClass isLoaded ifFalse:[
  2508 		unloadedCount := unloadedCount + 1.
  2508                 unloadedCount := unloadedCount + 1.
  2509 		(currentClassCategory ~= '* all *'
  2509                 (currentClassCategory ~= '* all *'
  2510 		and:[currentClassCategory ~= '* hierarchy *']) ifTrue:[
  2510                 and:[currentClassCategory ~= '* hierarchy *']) ifTrue:[
  2511 		    msg := '?? ''' , clsName , ''' is not loaded - skipped check'.
  2511                     msg := '?? ''' , clsName , ''' is not loaded - skipped check'.
  2512 		]
  2512                 ]
  2513 	    ] ifTrue:[
  2513             ] ifTrue:[
  2514 		((aClass isNamespace not or:[aClass == Smalltalk])
  2514                 ((aClass isNameSpace not or:[aClass == Smalltalk])
  2515 		and:[aClass topOwningClass isNil]) ifTrue:[
  2515                 and:[aClass topOwningClass isNil]) ifTrue:[
  2516                 
  2516                 
  2517 "/                    self busyLabel:'validating %1 ...' with:aClass name.
  2517 "/                    self busyLabel:'validating %1 ...' with:aClass name.
  2518                 
  2518                 
  2519 		    sourceCodeManager := aClass sourceCodeManager.
  2519                     sourceCodeManager := aClass sourceCodeManager.
  2520 		    sourceCodeManager isNil ifTrue:[
  2520                     sourceCodeManager isNil ifTrue:[
  2521 			msg := '?? ''' , clsName , ''' has no sourceCodeManager - skipped check'.
  2521                         msg := '?? ''' , clsName , ''' has no sourceCodeManager - skipped check'.
  2522 		    ] ifFalse:[
  2522                     ] ifFalse:[
  2523 			repVersion := sourceCodeManager newestRevisionOf:aClass.
  2523                         repVersion := sourceCodeManager newestRevisionOf:aClass.
  2524 			repVersion isNil ifTrue:[
  2524                         repVersion isNil ifTrue:[
  2525 			    msg := '-- ' , clsName 
  2525                             msg := '-- ' , clsName 
  2526 				    , ' not in repository'
  2526                                     , ' not in repository'
  2527 			] ifFalse:[
  2527                         ] ifFalse:[
  2528 			    clsVersion := aClass revision.
  2528                             clsVersion := aClass revision.
  2529 			    binVersion := aClass binaryRevision.
  2529                             binVersion := aClass binaryRevision.
  2530 
  2530 
  2531 			    clsName := aClass name.
  2531                             clsName := aClass name.
  2532 			    msg := nil.
  2532                             msg := nil.
  2533 
  2533 
  2534 			    clsVersion ~= repVersion ifTrue:[
  2534                             clsVersion ~= repVersion ifTrue:[
  2535 				badCount := badCount + 1.
  2535                                 badCount := badCount + 1.
  2536 				msg := '** ' , clsName 
  2536                                 msg := '** ' , clsName 
  2537 					, ' is not up-to-date (this: '
  2537                                         , ' is not up-to-date (this: '
  2538 					, clsVersion printString
  2538                                         , clsVersion printString
  2539 					, ' repository: '
  2539                                         , ' repository: '
  2540 					, repVersion printString
  2540                                         , repVersion printString
  2541 					, ').'.
  2541                                         , ').'.
  2542 				msg := msg asText allBold.
  2542                                 msg := msg asText allBold.
  2543 			    ] ifFalse:[
  2543                             ] ifFalse:[
  2544 				clsVersion ~= binVersion ifTrue:[
  2544                                 clsVersion ~= binVersion ifTrue:[
  2545 				    binVersion notNil ifTrue:[
  2545                                     binVersion notNil ifTrue:[
  2546 					msg := clsName
  2546                                         msg := clsName
  2547 					       , ' up-to-date (but should be stc-recompiled)'
  2547                                                , ' up-to-date (but should be stc-recompiled)'
  2548 				    ]
  2548                                     ]
  2549 				] ifFalse:[
  2549                                 ] ifFalse:[
  2550     "/                              msg := clsName , ' is up-to-date.'
  2550     "/                              msg := clsName , ' is up-to-date.'
  2551 				].
  2551                                 ].
  2552 
  2552 
  2553 				"/ compare the sources;
  2553                                 "/ compare the sources;
  2554 				"/ to find classes which need a checkin.
  2554                                 "/ to find classes which need a checkin.
  2555 
  2555 
  2556 				aStream := sourceCodeManager getMostRecentSourceStreamForClassNamed:aClass name.
  2556                                 aStream := sourceCodeManager getMostRecentSourceStreamForClassNamed:aClass name.
  2557 				repSource := aStream contents asString.
  2557                                 repSource := aStream contents asString.
  2558 				aStream close.
  2558                                 aStream close.
  2559 
  2559 
  2560 				aStream := '' writeStream.
  2560                                 aStream := '' writeStream.
  2561 				Method flushSourceStreamCache.
  2561                                 Method flushSourceStreamCache.
  2562 				aClass fileOutOn:aStream withTimeStamp:false.
  2562                                 aClass fileOutOn:aStream withTimeStamp:false.
  2563 				currentSource := aStream contents asString.
  2563                                 currentSource := aStream contents asString.
  2564 
  2564 
  2565 				repSource ~= currentSource ifTrue:[
  2565                                 repSource ~= currentSource ifTrue:[
  2566 				    msg := '-- ' , clsName , ' should be checked into the repository'.
  2566                                     msg := '-- ' , clsName , ' should be checked into the repository'.
  2567 				    needCheckIn := needCheckIn + 1.
  2567                                     needCheckIn := needCheckIn + 1.
  2568 				].
  2568                                 ].
  2569 			    ].
  2569                             ].
  2570 			].
  2570                         ].
  2571 		    ].
  2571                     ].
  2572 		].
  2572                 ].
  2573 	    ].
  2573             ].
  2574 	    msg notNil ifTrue:[
  2574             msg notNil ifTrue:[
  2575 		Transcript showCR:msg
  2575                 Transcript showCR:msg
  2576 	    ].
  2576             ].
  2577 	].
  2577         ].
  2578 	Transcript cr.
  2578         Transcript cr.
  2579 	Transcript showCR:'----------------------------------------------------------'.
  2579         Transcript showCR:'----------------------------------------------------------'.
  2580 	Transcript showCR:('%1 classes / %2 unloaded / %3 need checkout / %4 need checkin.'
  2580         Transcript showCR:('%1 classes / %2 unloaded / %3 need checkout / %4 need checkin.'
  2581 			   bindWith:count with:unloadedCount with:badCount with:needCheckIn).
  2581                            bindWith:count with:unloadedCount with:badCount with:needCheckIn).
  2582 	Transcript showCR:'----------------------------------------------------------'.
  2582         Transcript showCR:'----------------------------------------------------------'.
  2583 
  2583 
  2584 	self normalLabel.
  2584         self normalLabel.
  2585     ]
  2585     ]
  2586 
  2586 
  2587     "Modified: 15.6.1996 / 00:25:58 / stefan"
  2587     "Modified: 15.6.1996 / 00:25:58 / stefan"
  2588     "Created: 29.10.1996 / 13:21:08 / cg"
  2588     "Created: 29.10.1996 / 13:21:08 / cg"
  2589     "Modified: 18.8.1997 / 15:43:04 / cg"
  2589     "Modified: 18.8.1997 / 15:43:04 / cg"
  2681     |nameSpaceList newList cat allNameSpaces|
  2681     |nameSpaceList newList cat allNameSpaces|
  2682 
  2682 
  2683     newList := Set new.
  2683     newList := Set new.
  2684 
  2684 
  2685     currentNamespace = '* all *' ifTrue:[
  2685     currentNamespace = '* all *' ifTrue:[
  2686 	nameSpaceList := Array with:Smalltalk.
  2686         nameSpaceList := Array with:Smalltalk.
  2687 	allNameSpaces := true.
  2687         allNameSpaces := true.
  2688     ] ifFalse:[
  2688     ] ifFalse:[
  2689 	nameSpaceList := self listOfNamespaces.
  2689         nameSpaceList := self listOfNamespaces.
  2690 	allNameSpaces := false.
  2690         allNameSpaces := false.
  2691     ].
  2691     ].
  2692 
  2692 
  2693     nameSpaceList do:[:aNamespace |
  2693     nameSpaceList do:[:aNamespace |
  2694 	aNamespace allBehaviorsDo:[:aClass |
  2694         aNamespace allBehaviorsDo:[:aClass |
  2695 	    aClass isMeta ifFalse:[
  2695             aClass isMeta ifFalse:[
  2696 		(aClass isNamespace not 
  2696                 (aClass isNameSpace not 
  2697 		or:[aClass == Namespace 
  2697                 or:[aClass == Namespace 
  2698 		or:[aClass == Smalltalk]]) ifTrue:[
  2698                 or:[aClass == Smalltalk]]) ifTrue:[
  2699 		    (allNameSpaces or:[aClass nameSpace == aNamespace]) ifTrue:[
  2699                     (allNameSpaces or:[aClass nameSpace == aNamespace]) ifTrue:[
  2700 			cat := aClass category.
  2700                         cat := aClass category.
  2701 			cat isNil ifTrue:[
  2701                         cat isNil ifTrue:[
  2702 			    cat := '* no category *'
  2702                             cat := '* no category *'
  2703 			].
  2703                         ].
  2704 			cat ~= 'obsolete' ifTrue:[
  2704                         cat ~= 'obsolete' ifTrue:[
  2705 			    newList add:cat
  2705                             newList add:cat
  2706 			]
  2706                         ]
  2707 		    ]
  2707                     ]
  2708 		]
  2708                 ]
  2709 	    ]
  2709             ]
  2710 	]
  2710         ]
  2711     ].
  2711     ].
  2712 
  2712 
  2713     newList notEmpty ifTrue:[
  2713     newList notEmpty ifTrue:[
  2714 	newList add:'* all *'; add:'* hierarchy *'.
  2714         newList add:'* all *'; add:'* hierarchy *'.
  2715     ].
  2715     ].
  2716 
  2716 
  2717     ^ newList asOrderedCollection sort.
  2717     ^ newList asOrderedCollection sort.
  2718 
  2718 
  2719     "Modified: 5.1.1997 / 17:12:01 / cg"
  2719     "Modified: 5.1.1997 / 17:12:01 / cg"
  3066         cls := acceptClass ? currentClass.
  3066         cls := acceptClass ? currentClass.
  3067         cls isMeta ifTrue:[
  3067         cls isMeta ifTrue:[
  3068             cls := cls soleInstance
  3068             cls := cls soleInstance
  3069         ].
  3069         ].
  3070 
  3070 
  3071         (cls isNamespace and:[cls ~~ Smalltalk]) ifTrue:[
  3071         (cls isNameSpace and:[cls ~~ Smalltalk]) ifTrue:[
  3072             cls fileOutDefinitionOn:aStream
  3072             cls fileOutDefinitionOn:aStream
  3073         ] ifFalse:[
  3073         ] ifFalse:[
  3074 
  3074 
  3075             "/
  3075             "/
  3076             "/ here, show it with a nameSpace pragma
  3076             "/ here, show it with a nameSpace pragma
  5010 
  5010 
  5011 allClassesInCategory:aCategory
  5011 allClassesInCategory:aCategory
  5012     |classes|
  5012     |classes|
  5013 
  5013 
  5014     currentNamespace = '* all *' ifTrue:[
  5014     currentNamespace = '* all *' ifTrue:[
  5015 	^ Smalltalk allClassesInCategory:currentClassCategory
  5015         ^ Smalltalk allClassesInCategory:currentClassCategory
  5016     ].
  5016     ].
  5017 
  5017 
  5018     classes := Set new.
  5018     classes := Set new.
  5019 
  5019 
  5020     (self listOfNamespaces) do:[:aNamespace |
  5020     (self listOfNamespaces) do:[:aNamespace |
  5021 	aNamespace allBehaviorsDo:[:aClass |
  5021         aNamespace allBehaviorsDo:[:aClass |
  5022 	    |actualNamespace nm|
  5022             |actualNamespace nm|
  5023 
  5023 
  5024 	    aClass isMeta ifFalse:[
  5024             aClass isMeta ifFalse:[
  5025 		(aCategory = '* all *'
  5025                 (aCategory = '* all *'
  5026 		or:[aClass category = aCategory]) ifTrue:[
  5026                 or:[aClass category = aCategory]) ifTrue:[
  5027 		    (aClass isNamespace not
  5027                     (aClass isNameSpace not
  5028 		    or:[aClass == Smalltalk]) ifTrue:[
  5028                     or:[aClass == Smalltalk]) ifTrue:[
  5029 			actualNamespace := aClass nameSpace.
  5029                         actualNamespace := aClass nameSpace.
  5030 			(actualNamespace isNamespace not "/ a private class
  5030                         (actualNamespace isNameSpace not "/ a private class
  5031 			or:[actualNamespace == aNamespace]) ifTrue:[
  5031                         or:[actualNamespace == aNamespace]) ifTrue:[
  5032 			    classes add:aClass
  5032                             classes add:aClass
  5033 			]
  5033                         ]
  5034 		    ]
  5034                     ]
  5035 		]
  5035                 ]
  5036 	    ]
  5036             ]
  5037 	]
  5037         ]
  5038     ].
  5038     ].
  5039     ^ classes
  5039     ^ classes
  5040 
  5040 
  5041     "Created: 23.12.1996 / 10:26:28 / cg"
  5041     "Created: 23.12.1996 / 10:26:28 / cg"
  5042     "Modified: 23.12.1996 / 11:33:13 / cg"
  5042     "Modified: 23.12.1996 / 11:33:13 / cg"
  5595     "/ keep track of added names (care for obsolete classes)
  5595     "/ keep track of added names (care for obsolete classes)
  5596 
  5596 
  5597     namesPresent := Set new.
  5597     namesPresent := Set new.
  5598 
  5598 
  5599     (aCategory = '* hierarchy *') ifTrue:[
  5599     (aCategory = '* hierarchy *') ifTrue:[
  5600 	listOfClassNames := OrderedCollection new.
  5600         listOfClassNames := OrderedCollection new.
  5601 	listOfClasses := OrderedCollection new.
  5601         listOfClasses := OrderedCollection new.
  5602 
  5602 
  5603 	self classHierarchyOf:Object withAutoloaded:true do:[:aClass :lvl|
  5603         self classHierarchyOf:Object withAutoloaded:true do:[:aClass :lvl|
  5604 	    |indent|
  5604             |indent|
  5605 
  5605 
  5606 	    (aClass isNamespace not
  5606             (aClass isNameSpace not
  5607 	    or:[aClass == Smalltalk]) ifTrue:[
  5607             or:[aClass == Smalltalk]) ifTrue:[
  5608 		aClass isObsolete ifFalse:[
  5608                 aClass isObsolete ifFalse:[
  5609 		    nm := self displayedClassNameOf:aClass.
  5609                     nm := self displayedClassNameOf:aClass.
  5610 
  5610 
  5611 		    (namesPresent includes:nm) ifFalse:[
  5611                     (namesPresent includes:nm) ifFalse:[
  5612 			indent := String new:lvl*2.
  5612                         indent := String new:lvl*2.
  5613 
  5613 
  5614 			"/ show classes from other nameSpaces in italic
  5614                         "/ show classes from other nameSpaces in italic
  5615 
  5615 
  5616 			(allNameSpaces not
  5616                         (allNameSpaces not
  5617 			 and:[(self findClassNamedInNameSpace:nm) isNil]) ifTrue:[
  5617                          and:[(self findClassNamedInNameSpace:nm) isNil]) ifTrue:[
  5618 			    nm := nm asText emphasizeAllWith:#italic.
  5618                             nm := nm asText emphasizeAllWith:#italic.
  5619 			].
  5619                         ].
  5620 			nm := indent , nm.
  5620                         nm := indent , nm.
  5621 			namesPresent add:nm.
  5621                         namesPresent add:nm.
  5622 			listOfClassNames add:nm.
  5622                         listOfClassNames add:nm.
  5623 			listOfClasses add:nm.
  5623                         listOfClasses add:nm.
  5624 		    ]
  5624                     ]
  5625 		]
  5625                 ]
  5626 	    ]
  5626             ]
  5627 	].
  5627         ].
  5628 	namesFlag ifFalse:[
  5628         namesFlag ifFalse:[
  5629 	    ^ listOfClasses
  5629             ^ listOfClasses
  5630 	].
  5630         ].
  5631 	^ listOfClassNames
  5631         ^ listOfClassNames
  5632     ].
  5632     ].
  5633 
  5633 
  5634     (aCategory = '* all *') ifTrue:[
  5634     (aCategory = '* all *') ifTrue:[
  5635 	anyCategory := true
  5635         anyCategory := true
  5636     ] ifFalse:[
  5636     ] ifFalse:[
  5637 	anyCategory := false.
  5637         anyCategory := false.
  5638 	(aCategory = '* no category *') ifTrue:[
  5638         (aCategory = '* no category *') ifTrue:[
  5639 	    searchCategory := nil
  5639             searchCategory := nil
  5640 	] ifFalse:[
  5640         ] ifFalse:[
  5641 	    searchCategory := aCategory
  5641             searchCategory := aCategory
  5642 	].
  5642         ].
  5643     ].
  5643     ].
  5644 
  5644 
  5645     allNameSpaces ifTrue:[
  5645     allNameSpaces ifTrue:[
  5646 	nameSpaces := Array with:Smalltalk.
  5646         nameSpaces := Array with:Smalltalk.
  5647     ] ifFalse:[
  5647     ] ifFalse:[
  5648 	nameSpaces := self listOfNamespaces.
  5648         nameSpaces := self listOfNamespaces.
  5649     ].
  5649     ].
  5650 
  5650 
  5651     listOfClasses := OrderedCollection new.
  5651     listOfClasses := OrderedCollection new.
  5652     listOfClassNames := OrderedCollection new.
  5652     listOfClassNames := OrderedCollection new.
  5653     classesPresent := IdentitySet new.
  5653     classesPresent := IdentitySet new.
  5654 
  5654 
  5655     nameSpaces do:[:aNamespace |
  5655     nameSpaces do:[:aNamespace |
  5656 	aNamespace allBehaviorsDo:[:aClass |
  5656         aNamespace allBehaviorsDo:[:aClass |
  5657 	    |thisCategory actualNamespace nm owner|
  5657             |thisCategory actualNamespace nm owner|
  5658 
  5658 
  5659 	    aClass isMeta ifFalse:[
  5659             aClass isMeta ifFalse:[
  5660 		(aClass isNamespace not
  5660                 (aClass isNameSpace not
  5661 		or:[aClass == Smalltalk]) ifTrue:[
  5661                 or:[aClass == Smalltalk]) ifTrue:[
  5662 		    (classesPresent includes:aClass) ifFalse:[
  5662                     (classesPresent includes:aClass) ifFalse:[
  5663 
  5663 
  5664 			match := anyCategory.
  5664                         match := anyCategory.
  5665 			match ifFalse:[
  5665                         match ifFalse:[
  5666 			    thisCategory := aClass category.
  5666                             thisCategory := aClass category.
  5667 			    match := ((thisCategory = searchCategory) 
  5667                             match := ((thisCategory = searchCategory) 
  5668 				     or:[thisCategory = aCategory]).
  5668                                      or:[thisCategory = aCategory]).
  5669 			].
  5669                         ].
  5670 
  5670 
  5671 			match ifTrue:[
  5671                         match ifTrue:[
  5672 			    fullClass ifTrue:[
  5672                             fullClass ifTrue:[
  5673 				aClass owningClass notNil ifTrue:[
  5673                                 aClass owningClass notNil ifTrue:[
  5674 				    match := false
  5674                                     match := false
  5675 				]
  5675                                 ]
  5676 			    ].
  5676                             ].
  5677 			].
  5677                         ].
  5678 
  5678 
  5679 			match ifTrue:[
  5679                         match ifTrue:[
  5680 			    nm := self displayedClassNameOf:aClass.
  5680                             nm := self displayedClassNameOf:aClass.
  5681 			    (namesPresent includes:nm) ifFalse:[
  5681                             (namesPresent includes:nm) ifFalse:[
  5682 
  5682 
  5683 				allNameSpaces ifFalse:[
  5683                                 allNameSpaces ifFalse:[
  5684 				    (owner := aClass topOwningClass) notNil ifTrue:[
  5684                                     (owner := aClass topOwningClass) notNil ifTrue:[
  5685 					actualNamespace := owner nameSpace
  5685                                         actualNamespace := owner nameSpace
  5686 				    ] ifFalse:[
  5686                                     ] ifFalse:[
  5687 					actualNamespace := aClass nameSpace.
  5687                                         actualNamespace := aClass nameSpace.
  5688 				    ].
  5688                                     ].
  5689 				    match := actualNamespace isNamespace not "/ a private class
  5689                                     match := actualNamespace isNameSpace not "/ a private class
  5690 					     or:[actualNamespace == aNamespace].
  5690                                              or:[actualNamespace == aNamespace].
  5691 				].
  5691                                 ].
  5692 				match ifTrue:[
  5692                                 match ifTrue:[
  5693 				    namesPresent add:nm.
  5693                                     namesPresent add:nm.
  5694 				    classesPresent add:aClass.
  5694                                     classesPresent add:aClass.
  5695 				    listOfClasses add:aClass.
  5695                                     listOfClasses add:aClass.
  5696 				    listOfClassNames add:nm.
  5696                                     listOfClassNames add:nm.
  5697 				]
  5697                                 ]
  5698 			    ]
  5698                             ]
  5699 			]
  5699                         ]
  5700 		    ]
  5700                     ]
  5701 		]
  5701                 ]
  5702 	    ]
  5702             ]
  5703 	]
  5703         ]
  5704     ].
  5704     ].
  5705 
  5705 
  5706     fullClass ifFalse:[
  5706     fullClass ifFalse:[
  5707 	"/
  5707         "/
  5708 	"/ mhm - must search through private classes of those
  5708         "/ mhm - must search through private classes of those
  5709 	"/ in smalltalk (they are not visible in the nameSpace,
  5709         "/ in smalltalk (they are not visible in the nameSpace,
  5710 	"/ but should also be displayed)
  5710         "/ but should also be displayed)
  5711 	"/
  5711         "/
  5712 	Smalltalk allBehaviorsDo:[:aClass |
  5712         Smalltalk allBehaviorsDo:[:aClass |
  5713 	    |actualNamespace owner|
  5713             |actualNamespace owner|
  5714 
  5714 
  5715 	    aClass isMeta ifFalse:[
  5715             aClass isMeta ifFalse:[
  5716 		(classesPresent includes:aClass) ifFalse:[
  5716                 (classesPresent includes:aClass) ifFalse:[
  5717 		    (owner := aClass topOwningClass) notNil ifTrue:[
  5717                     (owner := aClass topOwningClass) notNil ifTrue:[
  5718 			(classesPresent includes:owner) ifTrue:[
  5718                         (classesPresent includes:owner) ifTrue:[
  5719 			    nm := self displayedClassNameOf:aClass.
  5719                             nm := self displayedClassNameOf:aClass.
  5720 			    (namesPresent includes:nm) ifFalse:[
  5720                             (namesPresent includes:nm) ifFalse:[
  5721 				namesPresent add:nm.
  5721                                 namesPresent add:nm.
  5722 				listOfClasses add:aClass.
  5722                                 listOfClasses add:aClass.
  5723 				listOfClassNames add:nm.
  5723                                 listOfClassNames add:nm.
  5724 			    ]
  5724                             ]
  5725 			]
  5725                         ]
  5726 		    ]
  5726                     ]
  5727 		]
  5727                 ]
  5728 	    ]
  5728             ]
  5729 	].
  5729         ].
  5730     ].
  5730     ].
  5731 
  5731 
  5732     (listOfClasses size == 0) ifTrue:[^ nil].
  5732     (listOfClasses size == 0) ifTrue:[^ nil].
  5733 
  5733 
  5734     "/ sort by name
  5734     "/ sort by name
  5735     listOfClassNames sortWith:listOfClasses.
  5735     listOfClassNames sortWith:listOfClasses.
  5736 
  5736 
  5737     namesFlag ifFalse:[
  5737     namesFlag ifFalse:[
  5738 	^ listOfClasses
  5738         ^ listOfClasses
  5739     ].
  5739     ].
  5740 
  5740 
  5741     "/ indent after sorting
  5741     "/ indent after sorting
  5742     1 to:listOfClassNames size do:[:index |
  5742     1 to:listOfClassNames size do:[:index |
  5743 	|nm cls owner s|
  5743         |nm cls owner s|
  5744 
  5744 
  5745 	cls := listOfClasses at:index.
  5745         cls := listOfClasses at:index.
  5746 	owner := cls.
  5746         owner := cls.
  5747 	(owner := owner owningClass) notNil ifTrue:[
  5747         (owner := owner owningClass) notNil ifTrue:[
  5748 	    nm := listOfClassNames at:index.
  5748             nm := listOfClassNames at:index.
  5749 	    s := nm.
  5749             s := nm.
  5750 	    [owner notNil] whileTrue:[    
  5750             [owner notNil] whileTrue:[    
  5751 		s := '  ' , s.
  5751                 s := '  ' , s.
  5752 		owner := owner owningClass
  5752                 owner := owner owningClass
  5753 	    ].
  5753             ].
  5754 	    listOfClassNames at:index put:s.
  5754             listOfClassNames at:index put:s.
  5755 	].
  5755         ].
  5756     ].
  5756     ].
  5757 
  5757 
  5758     ^ listOfClassNames
  5758     ^ listOfClassNames
  5759 
  5759 
  5760     "Created: 10.1.1997 / 13:57:34 / cg"
  5760     "Created: 10.1.1997 / 13:57:34 / cg"
 11020 
 11020 
 11021 changeNameSpaceTo:nsName
 11021 changeNameSpaceTo:nsName
 11022     |n selectedClass str selectedCategory l newCat|
 11022     |n selectedClass str selectedCategory l newCat|
 11023 
 11023 
 11024     nsName = '* all *' ifTrue:[
 11024     nsName = '* all *' ifTrue:[
 11025 	currentNamespace := nsName.
 11025         currentNamespace := nsName.
 11026     ] ifFalse:[
 11026     ] ifFalse:[
 11027 	n := Smalltalk at:nsName asSymbol.
 11027         n := Smalltalk at:nsName asSymbol.
 11028 	n isNamespace ifTrue:[
 11028         n isNameSpace ifTrue:[
 11029 	    currentNamespace := n.
 11029             currentNamespace := n.
 11030 	] ifFalse:[
 11030         ] ifFalse:[
 11031 	    ^ self
 11031             ^ self
 11032 	]
 11032         ]
 11033     ].
 11033     ].
 11034 
 11034 
 11035     selectedClass := actualClass.
 11035     selectedClass := actualClass.
 11036     currentClass := actualClass := nil.
 11036     currentClass := actualClass := nil.
 11037     selectedCategory := currentClassCategory.
 11037     selectedCategory := currentClassCategory.
 11038 
 11038 
 11039     self updateClassCategoryListWithScroll:true.
 11039     self updateClassCategoryListWithScroll:true.
 11040     selectedCategory notNil ifTrue:[
 11040     selectedCategory notNil ifTrue:[
 11041 	self classCategorySelectionChanged.
 11041         self classCategorySelectionChanged.
 11042     ].
 11042     ].
 11043 
 11043 
 11044     selectedClass notNil ifTrue:[
 11044     selectedClass notNil ifTrue:[
 11045 	str := self displayedClassNameOf:selectedClass.
 11045         str := self displayedClassNameOf:selectedClass.
 11046 
 11046 
 11047 	self switchToClassNamed:str.
 11047         self switchToClassNamed:str.
 11048 
 11048 
 11049 	((l := classListView list) isNil
 11049         ((l := classListView list) isNil
 11050 	or:[(l includes:str) not]) ifTrue:[
 11050         or:[(l includes:str) not]) ifTrue:[
 11051 	     currentClassCategory := nil.
 11051              currentClassCategory := nil.
 11052 	     currentClass := nil.
 11052              currentClass := nil.
 11053 	     aspect := nil.   
 11053              aspect := nil.   
 11054 	     self updateMethodCategoryList.
 11054              self updateMethodCategoryList.
 11055 	     self updateMethodList.
 11055              self updateMethodList.
 11056 	     self updateCodeView.
 11056              self updateCodeView.
 11057 	].
 11057         ].
 11058 
 11058 
 11059 	(classCategoryListView notNil and:[currentClass notNil]) ifTrue:[
 11059         (classCategoryListView notNil and:[currentClass notNil]) ifTrue:[
 11060 	    newCat := currentClass category.
 11060             newCat := currentClass category.
 11061 	    (currentClassCategory = newCat) ifFalse:[
 11061             (currentClassCategory = newCat) ifFalse:[
 11062 		currentClassCategory := newCat.
 11062                 currentClassCategory := newCat.
 11063 		classCategoryListView setSelectElement:newCat
 11063                 classCategoryListView setSelectElement:newCat
 11064 	    ]
 11064             ]
 11065 	].
 11065         ].
 11066     ]
 11066     ]
 11067 
 11067 
 11068     "Created: 3.1.1997 / 11:11:13 / cg"
 11068     "Created: 3.1.1997 / 11:11:13 / cg"
 11069     "Modified: 29.1.1997 / 18:33:42 / cg"
 11069     "Modified: 29.1.1997 / 18:33:42 / cg"
 11070 !
 11070 !
 11759 
 11759 
 11760     allNameSpaces := (currentNamespace = '* all *').
 11760     allNameSpaces := (currentNamespace = '* all *').
 11761     nameSpaceList := self listOfNamespaces.
 11761     nameSpaceList := self listOfNamespaces.
 11762 
 11762 
 11763     Smalltalk allBehaviorsDo:[:aClass |
 11763     Smalltalk allBehaviorsDo:[:aClass |
 11764 	|actualNamespace match owner|
 11764         |actualNamespace match owner|
 11765 
 11765 
 11766 	aClass isMeta ifFalse:[
 11766         aClass isMeta ifFalse:[
 11767 	    (aClass isNamespace not
 11767             (aClass isNameSpace not
 11768 	    or:[aClass == Smalltalk]) ifTrue:[
 11768             or:[aClass == Smalltalk]) ifTrue:[
 11769 		match := allNameSpaces.
 11769                 match := allNameSpaces.
 11770 		match ifFalse:[
 11770                 match ifFalse:[
 11771 		    (owner := aClass topOwningClass) notNil ifTrue:[
 11771                     (owner := aClass topOwningClass) notNil ifTrue:[
 11772 			actualNamespace := owner nameSpace
 11772                         actualNamespace := owner nameSpace
 11773 		    ] ifFalse:[
 11773                     ] ifFalse:[
 11774 			actualNamespace := aClass nameSpace.
 11774                         actualNamespace := aClass nameSpace.
 11775 		    ].
 11775                     ].
 11776 		    match := nameSpaceList includesIdentical:actualNamespace.
 11776                     match := nameSpaceList includesIdentical:actualNamespace.
 11777 		].
 11777                 ].
 11778 		match ifTrue:[
 11778                 match ifTrue:[
 11779 		    classes addAll:(aClass withAllSuperclasses).
 11779                     classes addAll:(aClass withAllSuperclasses).
 11780 		]
 11780                 ]
 11781 	    ]
 11781             ]
 11782 	]
 11782         ]
 11783     ].
 11783     ].
 11784 
 11784 
 11785     "/ now, generate a dictionary, which associates a set of subclasses
 11785     "/ now, generate a dictionary, which associates a set of subclasses
 11786     "/ to each ...
 11786     "/ to each ...
 11787 
 11787 
 11788     subclassDict := IdentityDictionary new:classes size.
 11788     subclassDict := IdentityDictionary new:classes size.
 11789     classes do:[:aClass |
 11789     classes do:[:aClass |
 11790 	s := aClass superclass.
 11790         s := aClass superclass.
 11791 	s notNil ifTrue:[
 11791         s notNil ifTrue:[
 11792 	    l := subclassDict at:s ifAbsent:[nil].
 11792             l := subclassDict at:s ifAbsent:[nil].
 11793 	    l isNil ifTrue:[
 11793             l isNil ifTrue:[
 11794 		l := OrderedCollection new:5.
 11794                 l := OrderedCollection new:5.
 11795 		subclassDict at:s put:l
 11795                 subclassDict at:s put:l
 11796 	    ].
 11796             ].
 11797 	    l add:aClass
 11797             l add:aClass
 11798 	]
 11798         ]
 11799     ].
 11799     ].
 11800 
 11800 
 11801     "/
 11801     "/
 11802     "/ walk this ..
 11802     "/ walk this ..
 11803     "/
 11803     "/
 11806 
 11806 
 11807     "/
 11807     "/
 11808     "/ if autoloaded classes are wanted ...
 11808     "/ if autoloaded classes are wanted ...
 11809     "/
 11809     "/
 11810     withAutoloaded ifTrue:[
 11810     withAutoloaded ifTrue:[
 11811 	(remaining includes:Autoload) ifTrue:[
 11811         (remaining includes:Autoload) ifTrue:[
 11812 	    self classHierarchyOf:Autoload level:0 do:aBlock using:subclassDict removeFrom:remaining.
 11812             self classHierarchyOf:Autoload level:0 do:aBlock using:subclassDict removeFrom:remaining.
 11813 	].
 11813         ].
 11814 	(remaining asSortedCollection:[:a :b | a name < b name]) do:[:aNilSubclass |
 11814         (remaining asSortedCollection:[:a :b | a name < b name]) do:[:aNilSubclass |
 11815 	    aBlock value:aNilSubclass value:0
 11815             aBlock value:aNilSubclass value:0
 11816 	]
 11816         ]
 11817     ].
 11817     ].
 11818 
 11818 
 11819     "Created: 28.5.1996 / 13:46:23 / cg"
 11819     "Created: 28.5.1996 / 13:46:23 / cg"
 11820     "Modified: 5.1.1997 / 18:44:50 / cg"
 11820     "Modified: 5.1.1997 / 18:44:50 / cg"
 11821 !
 11821 !
 12311 
 12311 
 12312     currentClass isJavaClass ifTrue:[
 12312     currentClass isJavaClass ifTrue:[
 12313         ^ self setAcceptActionForJavaClass.
 12313         ^ self setAcceptActionForJavaClass.
 12314     ].
 12314     ].
 12315 
 12315 
 12316     (currentClass isNamespace and:[currentClass ~~ Smalltalk]) ifTrue:[
 12316     (currentClass isNameSpace and:[currentClass ~~ Smalltalk]) ifTrue:[
 12317         self clearAcceptAction.
 12317         self clearAcceptAction.
 12318     ] ifFalse:[
 12318     ] ifFalse:[
 12319         codeView acceptAction:[:theCode |
 12319         codeView acceptAction:[:theCode |
 12320             |ns|
 12320             |ns|
 12321 
 12321 
 12448                         cls := (Compiler evaluate:theCode asString notifying:codeView compile:false).
 12448                         cls := (Compiler evaluate:theCode asString notifying:codeView compile:false).
 12449                         cls isBehavior ifTrue:[
 12449                         cls isBehavior ifTrue:[
 12450                             codeView modified:false.
 12450                             codeView modified:false.
 12451                             self classCategoryUpdate.
 12451                             self classCategoryUpdate.
 12452                             self updateClassListWithScroll:false.
 12452                             self updateClassListWithScroll:false.
 12453                             cls isNamespace ifFalse:[
 12453                             cls isNameSpace ifFalse:[
 12454                                 self switchToClassNamed:(cls name).
 12454                                 self switchToClassNamed:(cls name).
 12455                             ]
 12455                             ]
 12456                         ]
 12456                         ]
 12457                     ]
 12457                     ]
 12458                 ]
 12458                 ]
 14062 ! !
 14062 ! !
 14063 
 14063 
 14064 !BrowserView class methodsFor:'documentation'!
 14064 !BrowserView class methodsFor:'documentation'!
 14065 
 14065 
 14066 version
 14066 version
 14067     ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.612 2000-03-21 14:11:44 cg Exp $'
 14067     ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.613 2000-03-24 16:42:52 cg Exp $'
 14068 ! !
 14068 ! !
 14069 BrowserView initialize!
 14069 BrowserView initialize!