AbstractLauncherApplication.st
changeset 18804 5e06abe51151
parent 18792 d370c81b327a
child 18819 af9f6140c93b
equal deleted inserted replaced
18803:465762645d16 18804:5e06abe51151
     1 "{ Encoding: utf8 }"
       
     2 
       
     3 "
     1 "
     4  COPYRIGHT (c) 1997 by eXept Software AG
     2  COPYRIGHT (c) 1997 by eXept Software AG
     5               All Rights Reserved
     3               All Rights Reserved
     6 
     4 
     7  This software is furnished under a license and may be used
     5  This software is furnished under a license and may be used
  7629 !AbstractLauncherApplication::PackageLoadDialog methodsFor:'private'!
  7627 !AbstractLauncherApplication::PackageLoadDialog methodsFor:'private'!
  7630 
  7628 
  7631 addItemWithPackagePath:path target:target asApplication:isApplication toRoot:aRoot
  7629 addItemWithPackagePath:path target:target asApplication:isApplication toRoot:aRoot
  7632     "add a package item to the tree"
  7630     "add a package item to the tree"
  7633 
  7631 
  7634     |item isAlreadyLoaded defClass packageID|
  7632     |item isAlreadyLoaded defClass packageID targetPath isBroken|
  7635 
  7633 
  7636     "/ see if already loaded
  7634     "/ see if already loaded
  7637 
  7635 
  7638     packageID := (path size > 1) 
  7636     packageID := (path size > 1) 
  7639                     ifTrue:[ path first , ':' , ((path copyFrom:2) asStringWith:$/) ]
  7637                     ifTrue:[ path first , ':' , ((path copyFrom:2) asStringWith:$/) ]
  7640                     ifFalse:[ path first ].
  7638                     ifFalse:[ path first ].
  7641 
  7639 
  7642     item := self getItemByPath:path packageID:packageID under:aRoot.
  7640     item := self getItemByPath:path packageID:packageID under:aRoot.
  7643 
  7641 
  7644     isAlreadyLoaded := false.
  7642     isAlreadyLoaded := isBroken := false.
  7645     Error handle:[:ex |
  7643     Error handle:[:ex |
  7646         item label:(item label , (' ERROR - please rebuild!!' withColor:Color red)).
  7644         item label:(item label , (' ERROR - please rebuild!!' withColor:Color red)).
  7647     ] do:[    
  7645     ] do:[    
  7648         isAlreadyLoaded := 
  7646         isAlreadyLoaded := 
  7649             (defClass := ProjectDefinition definitionClassForPackage:packageID) notNil
  7647             (defClass := ProjectDefinition definitionClassForPackage:packageID) notNil
  7651             and:[ defClass isFullyLoaded ]].
  7649             and:[ defClass isFullyLoaded ]].
  7652     ].
  7650     ].
  7653 
  7651 
  7654     target notNil ifTrue:[
  7652     target notNil ifTrue:[
  7655         ((target startsWith:'lib ') or:[(target startsWith:'app ')]) ifTrue:[
  7653         ((target startsWith:'lib ') or:[(target startsWith:'app ')]) ifTrue:[
  7656             pathByItem at:item put:(target copyFrom:(target indexOfSeparator + 1)) withoutSeparators.
  7654             targetPath := (target copyFrom:(target indexOfSeparator + 1)) withoutSeparators.
       
  7655             pathByItem at:item put:targetPath.
       
  7656             isBroken := ('packages' asFilename / targetPath) directory exists not.
  7657         ].
  7657         ].
  7658     ].
  7658     ].
  7659 
  7659 
  7660     "/ do not overwrite an app by a lib with the same name (happens in expecco/application)
  7660     "/ do not overwrite an app by a lib with the same name (happens in expecco/application)
  7661     (isApplication or:[ item icon isNil or:[item icon == folderIcon or:[item icon == greyFolderIcon]]]) ifTrue:[
  7661     (isApplication or:[ item icon isNil or:[item icon == folderIcon or:[item icon == greyFolderIcon]]]) ifTrue:[
  7662         isAlreadyLoaded ifTrue:[
  7662         isBroken ifTrue:[
  7663             item icon:(isApplication ifTrue:[greyApplicationIcon] ifFalse:[greyPackageIcon]). 
  7663             item icon:(ToolbarIconLibrary packageDefectOpen24x24Icon2).
  7664             item label:(item label , alreadyLoadedString)
  7664             item label:(item label , (' (broken: folder no longer present)' withColor:Color red))
  7665         ] ifFalse:[
  7665         ] ifFalse:[    
  7666             item icon:(isApplication ifTrue:[applicationIcon] ifFalse:[packageIcon]). 
  7666             isAlreadyLoaded ifTrue:[
       
  7667                 item icon:(isApplication ifTrue:[greyApplicationIcon] ifFalse:[greyPackageIcon]). 
       
  7668                 item label:(item label , alreadyLoadedString)
       
  7669             ] ifFalse:[
       
  7670                 item icon:(isApplication ifTrue:[applicationIcon] ifFalse:[packageIcon]). 
       
  7671             ].
  7667         ].
  7672         ].
  7668     ].
  7673     ].
  7669 
  7674 
  7670     "/ if it is not already loaded, make all parents non-grey
  7675     "/ if it is not already loaded, make all parents non-grey
  7671     isAlreadyLoaded ifFalse:[
  7676     isAlreadyLoaded ifFalse:[
  7681 "/                                parentItem icon:applicationIcon.
  7686 "/                                parentItem icon:applicationIcon.
  7682 "/                            ].
  7687 "/                            ].
  7683             ].
  7688             ].
  7684         ]
  7689         ]
  7685     ].
  7690     ].
       
  7691 
       
  7692     "Modified: / 05-06-2019 / 14:15:02 / Claus Gittinger"
  7686 !
  7693 !
  7687 
  7694 
  7688 filterChangedAction
  7695 filterChangedAction
  7689     |newMatchingItems filterPattern isMatch firstMatchingItem|
  7696     |newMatchingItems filterPattern isMatch firstMatchingItem|
  7690 
  7697 
  8127             ].    
  8134             ].    
  8128         ] forkAt:(Processor userBackgroundPriority).    
  8135         ] forkAt:(Processor userBackgroundPriority).    
  8129 !
  8136 !
  8130 
  8137 
  8131 readPackageTree
  8138 readPackageTree
       
  8139     "looks for the packages folder, which contains symbolic-link-like entries
       
  8140      for packages which were generated during the build process"
       
  8141      
  8132     packageDirPath := Smalltalk getSystemFileName:'packages'.
  8142     packageDirPath := Smalltalk getSystemFileName:'packages'.
  8133     packageDirPath isNil ifTrue:[
  8143     packageDirPath isNil ifTrue:[
  8134         root label:root label,((resources string:' (no "packages" folder found)') withColor:Color red).
  8144         root label:root label,((resources string:' (no "packages" folder found)') withColor:Color red).
  8135     ] ifFalse:[
  8145     ] ifFalse:[
  8136         packageDirPath asFilename directoryContentsAsFilenames sort do:[:fn |
  8146         packageDirPath asFilename directoryContentsAsFilenames sort do:[:fn |
  8216                 ].
  8226                 ].
  8217 ].
  8227 ].
  8218             ].
  8228             ].
  8219         ].
  8229         ].
  8220     ].
  8230     ].
       
  8231 
       
  8232     "Modified (comment): / 05-06-2019 / 13:52:27 / Claus Gittinger"
  8221 !
  8233 !
  8222 
  8234 
  8223 selectionChangeAction:selectionIndices
  8235 selectionChangeAction:selectionIndices
  8224     |selectedItem p itemType info|
  8236     |selectedItem p itemType info|
  8225 
  8237