3011 "Created: / 23.3.1999 / 14:16:12 / cg" |
3009 "Created: / 23.3.1999 / 14:16:12 / cg" |
3012 "Modified: / 23.3.1999 / 14:18:38 / cg" |
3010 "Modified: / 23.3.1999 / 14:18:38 / cg" |
3013 ! |
3011 ! |
3014 |
3012 |
3015 updateProjectTree |
3013 updateProjectTree |
3016 |tree root showWhat| |
3014 |tree moduleRoots root showWhat| |
3017 |
3015 |
3018 showWhat := self showWhat value. |
3016 showWhat := self showWhat value. |
3019 |
3017 |
|
3018 moduleRoots := Dictionary new. |
|
3019 |
3020 tree := SelectionInTree new. |
3020 tree := SelectionInTree new. |
3021 tree root:(root := TreeItem name:'invisibleRoot'). |
3021 tree root:(root := ProjectTreeItem name:'invisibleRoot'). |
3022 root hide:false. |
3022 root hide:false. |
3023 |
3023 |
3024 showWhat == #current ifTrue:[ |
3024 showWhat == #current ifTrue:[ |
3025 root add:(self nodeFor:Project current). |
3025 root add:(self nodeFor:Project current). |
3026 ] ifFalse:[ |
3026 ] ifFalse:[ |
3027 (Project knownProjects asOrderedCollection |
3027 (Project knownProjects asOrderedCollection |
3028 sort:[:a :b | a packageName < b packageName]) |
3028 sort:[:a :b | a packageName < b packageName]) |
3029 do:[:aProject | |
3029 do:[:aProject | |
3030 |doShow| |
3030 |newNode nodeToAdd doShow childNode path| |
3031 |
3031 |
3032 (doShow := showWhat == #all) ifFalse:[ |
3032 (doShow := showWhat == #all) ifFalse:[ |
3033 doShow := (aProject package startsWith:'stx:') not |
3033 doShow := (aProject package startsWith:'stx:') not |
3034 ]. |
3034 ]. |
|
3035 |
3035 doShow ifTrue:[ |
3036 doShow ifTrue:[ |
3036 root add:(self nodeFor:aProject). |
3037 newNode := self nodeFor:aProject. |
|
3038 |
|
3039 "/ insert into tree ... |
|
3040 nodeToAdd := root. |
|
3041 |
|
3042 path := aProject package asCollectionOfSubstringsSeparatedByAny:'/\:'. |
|
3043 path from:1 to:path size-1 do:[:part | |
|
3044 childNode := nodeToAdd children detect:[:child | child name = part] ifNone:nil. |
|
3045 childNode isNil ifTrue:[ |
|
3046 nodeToAdd add:(childNode := ProjectTreeItem new name:part). |
|
3047 ]. |
|
3048 nodeToAdd := childNode. |
|
3049 ]. |
|
3050 newNode name:(path last). |
|
3051 nodeToAdd add:newNode. |
3037 ] |
3052 ] |
3038 ]. |
3053 ]. |
3039 ]. |
3054 ]. |
3040 projectTree := root. |
3055 projectTree := root. |
3041 |
3056 |