486 |allProjects generator| |
486 |allProjects generator| |
487 |
487 |
488 allProjects := IdentitySet new. |
488 allProjects := IdentitySet new. |
489 |
489 |
490 inGeneratorHolder isNil ifTrue:[ |
490 inGeneratorHolder isNil ifTrue:[ |
491 (self hideUnloadedClasses value) ifTrue:[ |
491 (self hideUnloadedClasses value) ifTrue:[ |
492 Smalltalk allClassesDo:[:eachClass | |
492 Smalltalk allClassesDo:[:eachClass | |
493 |cls pkg| |
493 |cls pkg| |
494 |
494 |
495 eachClass isLoaded ifTrue:[ |
495 eachClass isLoaded ifTrue:[ |
496 cls := eachClass theNonMetaclass. |
496 cls := eachClass theNonMetaclass. |
497 cls isPrivate ifTrue:[ |
497 cls isPrivate ifTrue:[ |
498 cls := cls topOwningClass |
498 cls := cls topOwningClass |
499 ]. |
499 ]. |
500 pkg := cls package. |
500 pkg := cls package. |
501 pkg withoutSeparators size > 0 ifTrue:[ |
501 pkg withoutSeparators size > 0 ifTrue:[ |
502 allProjects add:pkg asSymbol. |
502 allProjects add:pkg asSymbol. |
503 ] ifFalse:[ |
503 ] ifFalse:[ |
504 "/ for now, nameSpaces are not in any package; |
504 "/ for now, nameSpaces are not in any package; |
505 "/ this might change. Then, 0-sized packages are |
505 "/ this might change. Then, 0-sized packages are |
506 "/ illegal, and the following should be enabled. |
506 "/ illegal, and the following should be enabled. |
507 "/ self halt |
507 "/ self halt |
508 ]. |
508 ]. |
509 cls isJavaClass ifFalse:[ |
509 cls isJavaClass ifFalse:[ |
510 cls instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
510 cls instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
511 allProjects add:mthd package asSymbol. |
511 allProjects add:mthd package asSymbol. |
512 ]. |
512 ]. |
513 ]. |
513 ]. |
514 ]. |
514 ]. |
515 ]. |
515 ]. |
516 allProjects := allProjects asOrderedCollection. |
516 allProjects := allProjects asOrderedCollection. |
517 ] ifFalse:[ |
517 ] ifFalse:[ |
518 allProjects := NewSystemBrowser allProjectsIDs. |
518 allProjects := Smalltalk allProjectIDs. |
519 ]. |
519 ]. |
520 |
520 |
521 "/ those are simulated - in ST/X, empty projects do not |
521 "/ those are simulated - in ST/X, empty projects do not |
522 "/ really exist; however, during browsing, it makes sense. |
522 "/ really exist; however, during browsing, it makes sense. |
523 AdditionalEmptyProjects size > 0 ifTrue:[ |
523 AdditionalEmptyProjects size > 0 ifTrue:[ |
524 "/ remove those that are present ... |
524 "/ remove those that are present ... |
525 AdditionalEmptyProjects := AdditionalEmptyProjects select:[:pkg | (allProjects includes:pkg) not]. |
525 AdditionalEmptyProjects := AdditionalEmptyProjects select:[:pkg | (allProjects includes:pkg) not]. |
526 allProjects addAll:AdditionalEmptyProjects. |
526 allProjects addAll:AdditionalEmptyProjects. |
527 ]. |
527 ]. |
528 ] ifFalse:[ |
528 ] ifFalse:[ |
529 generator := inGeneratorHolder value. |
529 generator := inGeneratorHolder value. |
530 generator isNil ifTrue:[^ #() ]. |
530 generator isNil ifTrue:[^ #() ]. |
531 generator do:[:prj | allProjects add:prj]. |
531 generator do:[:prj | allProjects add:prj]. |
532 allProjects := allProjects asOrderedCollection. |
532 allProjects := allProjects asOrderedCollection. |
533 ]. |
533 ]. |
534 |
534 |
535 allProjects sort. |
535 allProjects sort. |
536 allProjects size == 1 ifTrue:[ |
536 allProjects size == 1 ifTrue:[ |
537 "/ self projectLabelHolder value:(allProjects first , ' [Project]'). |
537 "/ self projectLabelHolder value:(allProjects first , ' [Project]'). |
538 self projectLabelHolder value:(LabelAndIcon icon:(self class packageIcon) string:allProjects first). |
538 self projectLabelHolder value:(LabelAndIcon icon:(self class packageIcon) string:allProjects first). |
539 ]. |
539 ]. |
540 allProjects size > 1 ifTrue:[ |
540 allProjects size > 1 ifTrue:[ |
541 allProjects addFirst:(self class nameListEntryForALL). |
541 allProjects addFirst:(self class nameListEntryForALL). |
542 ]. |
542 ]. |
543 ^ allProjects |
543 ^ allProjects |
544 |
544 |
545 "Created: / 17.2.2000 / 23:43:05 / cg" |
545 "Created: / 17.2.2000 / 23:43:05 / cg" |
546 "Modified: / 18.8.2000 / 20:26:04 / cg" |
546 "Modified: / 18.8.2000 / 20:26:04 / cg" |