Tools__ProjectList.st
changeset 14292 99cbd608202b
parent 14291 0c9a68d379d5
child 14857 9516317af493
equal deleted inserted replaced
14291:0c9a68d379d5 14292:99cbd608202b
   682     projectList removeDependent:self.
   682     projectList removeDependent:self.
   683 ! !
   683 ! !
   684 
   684 
   685 !ProjectList methodsFor:'private'!
   685 !ProjectList methodsFor:'private'!
   686 
   686 
       
   687 allShownProjects
       
   688     |hideUnloaded allProjects projectBag generator addWithAllParentPackages hideModules|
       
   689 
       
   690     hideModules := HideModules ? true.
       
   691     hideModules := HideModules ? false.
       
   692 
       
   693     allProjects := IdentitySet new.
       
   694     projectBag := Bag new.
       
   695 
       
   696     inGeneratorHolder isNil ifTrue:[
       
   697         hideUnloaded := self hideUnloadedClasses value.
       
   698 
       
   699         addWithAllParentPackages := 
       
   700             [:package |
       
   701                 |p parent module|
       
   702 
       
   703                 (allProjects includes:package) ifFalse:[
       
   704                     allProjects add:package.
       
   705                     (package ~= PackageId noProjectID 
       
   706                     and:[package ~= #private]) ifTrue:[
       
   707                         p := package asPackageId.
       
   708                         [(parent := p parentPackage) notNil] whileTrue:[
       
   709                             allProjects add:parent asSymbol.
       
   710                             p := parent.
       
   711                         ].
       
   712                         hideModules ifFalse:[
       
   713                             (module := p module) notNil ifTrue:[
       
   714                                 allProjects add:module asSymbol.
       
   715                             ].
       
   716                         ].
       
   717                     ].
       
   718                 ].
       
   719             ].
       
   720 
       
   721         environment allClassesDo:[:eachClass |
       
   722             |cls pkg p classPackage|
       
   723 
       
   724             eachClass isRealNameSpace ifFalse:[
       
   725 
       
   726                 (hideUnloaded not or:[eachClass isLoaded]) ifTrue:[
       
   727                     cls := eachClass theNonMetaclass.
       
   728                     (cls isPrivate and:[cls isJavaClass not]) ifTrue:[
       
   729                         cls := cls topOwningClass
       
   730                     ].
       
   731 
       
   732                     classPackage := cls package ? (PackageId noProjectID).
       
   733                     classPackage size > 0 ifTrue:[
       
   734                         classPackage := classPackage asSymbol.
       
   735                         addWithAllParentPackages value:classPackage.
       
   736                         projectBag add:classPackage.
       
   737                     ] ifFalse:[
       
   738                         "/ for now, nameSpaces are not in any package;
       
   739                         "/ this might change. Then, 0-sized packages are
       
   740                         "/ illegal, and the following should be enabled.
       
   741                         "/ self halt
       
   742                     ].
       
   743 
       
   744                     cls isJavaClass ifFalse:[
       
   745                         cls instAndClassSelectorsAndMethodsDo:[:sel :mthd |
       
   746                             |mpkg|
       
   747 
       
   748                             mpkg := mthd package asSymbol.
       
   749                             mpkg ~~ classPackage ifTrue:[   
       
   750                                 (allProjects includes:mpkg) ifFalse:[
       
   751                                     addWithAllParentPackages value:mpkg.
       
   752                                 ]
       
   753                             ].
       
   754                         ].
       
   755                     ].
       
   756                 ].
       
   757             ].
       
   758         ].
       
   759         allProjects := allProjects asOrderedCollection.
       
   760 
       
   761         "/ those are simulated - in ST/X, empty projects do not
       
   762         "/ really exist; however, during browsing, it makes sense.
       
   763         AdditionalEmptyProjects size > 0 ifTrue:[
       
   764             "/ remove those that are present ...
       
   765             AdditionalEmptyProjects := AdditionalEmptyProjects select:[:pkg | (allProjects includes:pkg) not].
       
   766             allProjects addAll:AdditionalEmptyProjects.
       
   767         ].
       
   768     ] ifFalse:[
       
   769         generator := inGeneratorHolder value.
       
   770         generator isNil ifTrue:[^ #() ].
       
   771         generator do:[:prj | allProjects add:prj].
       
   772     ].
       
   773     ^ allProjects asOrderedCollection.
       
   774 
       
   775     "Modified: / 16-01-2007 / 15:56:16 / cg"
       
   776     "Modified: / 28-04-2014 / 10:15:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   777 !
       
   778 
   687 defaultSlaveModeValue
   779 defaultSlaveModeValue
   688     |mode|
   780     |mode|
   689 
   781 
   690     mode := self topApplication perform:#initialOrganizerMode ifNotUnderstood:nil.
   782     mode := self topApplication perform:#initialOrganizerMode ifNotUnderstood:nil.
   691     mode == OrganizerCanvas organizerModeProject ifTrue:[^ false].
   783     mode == OrganizerCanvas organizerModeProject ifTrue:[^ false].
   931 ! !
  1023 ! !
   932 
  1024 
   933 !ProjectList class methodsFor:'documentation'!
  1025 !ProjectList class methodsFor:'documentation'!
   934 
  1026 
   935 version
  1027 version
   936     ^ '$Header: /cvs/stx/stx/libtool/Tools__ProjectList.st,v 1.69 2014-04-28 09:54:21 vrany Exp $'
  1028     ^ '$Header: /cvs/stx/stx/libtool/Tools__ProjectList.st,v 1.70 2014-04-28 09:58:55 vrany Exp $'
   937 !
  1029 !
   938 
  1030 
   939 version_CVS
  1031 version_CVS
   940     ^ '$Header: /cvs/stx/stx/libtool/Tools__ProjectList.st,v 1.69 2014-04-28 09:54:21 vrany Exp $'
  1032     ^ '$Header: /cvs/stx/stx/libtool/Tools__ProjectList.st,v 1.70 2014-04-28 09:58:55 vrany Exp $'
   941 ! !
  1033 ! !
   942 
  1034