AbstractFileBrowser.st
branchjv
changeset 12401 4714b9640528
parent 12315 26537451c956
parent 12102 9512a4336434
child 12431 9f0c59c742d5
equal deleted inserted replaced
12330:235b77901045 12401:4714b9640528
    96     Especially the fact, that AbstractFileBrowser defines things both as abstract superclass
    96     Especially the fact, that AbstractFileBrowser defines things both as abstract superclass
    97     and as a container is almost incomprehensable...
    97     and as a container is almost incomprehensable...
    98 "
    98 "
    99 ! !
    99 ! !
   100 
   100 
       
   101 
   101 !AbstractFileBrowser class methodsFor:'accessing'!
   102 !AbstractFileBrowser class methodsFor:'accessing'!
   102 
   103 
   103 currentSelection
   104 currentSelection
   104 
   105 
   105     LastFileSelection isNil ifTrue:[
   106     LastFileSelection isNil ifTrue:[
   108     ^ LastFileSelection
   109     ^ LastFileSelection
   109 !
   110 !
   110 
   111 
   111 currentSelection:aFilenameCol
   112 currentSelection:aFilenameCol
   112     aFilenameCol notEmptyOrNil ifTrue:[
   113     aFilenameCol notEmptyOrNil ifTrue:[
   113         LastFileSelection := aFilenameCol collect:[:file | file asFilename]
   114         LastFileSelection := aFilenameCol collect:[:file | (file ? '') asFilename]
   114     ]
   115     ]
   115 !
   116 !
   116 
   117 
   117 directoryHistory
   118 directoryHistory
   118 
   119 
   143 
   144 
   144 rootHolder:aRoot
   145 rootHolder:aRoot
   145 
   146 
   146     RootHolder := aRoot
   147     RootHolder := aRoot
   147 ! !
   148 ! !
       
   149 
   148 
   150 
   149 !AbstractFileBrowser class methodsFor:'accessing-bookmarks'!
   151 !AbstractFileBrowser class methodsFor:'accessing-bookmarks'!
   150 
   152 
   151 addBookmark:aDirectoryPath
   153 addBookmark:aDirectoryPath
   152     "add aDirectoryPath to the list of our known bookmarks.
   154     "add aDirectoryPath to the list of our known bookmarks.
   295 
   297 
   296 saveBookmarksInDefaultBookmarksFile
   298 saveBookmarksInDefaultBookmarksFile
   297     self saveBookmarksIn:(self defaultBookMarksFileDirectory construct:self defaultBookMarksFilename)
   299     self saveBookmarksIn:(self defaultBookMarksFileDirectory construct:self defaultBookMarksFilename)
   298 ! !
   300 ! !
   299 
   301 
       
   302 
   300 !AbstractFileBrowser class methodsFor:'accessing-classes'!
   303 !AbstractFileBrowser class methodsFor:'accessing-classes'!
   301 
   304 
   302 directoryHistoryClass
   305 directoryHistoryClass
   303     ^ DirectoryHistory
   306     ^ DirectoryHistory
   304 
   307 
   305     "Modified: / 21-11-2012 / 08:46:34 / cg"
   308     "Modified: / 21-11-2012 / 08:46:34 / cg"
   306 ! !
   309 ! !
       
   310 
   307 
   311 
   308 !AbstractFileBrowser class methodsFor:'defaults'!
   312 !AbstractFileBrowser class methodsFor:'defaults'!
   309 
   313 
   310 commandHistory
   314 commandHistory
   311 
   315 
   552       )
   556       )
   553 
   557 
   554     "Modified: / 11-05-2012 / 09:22:04 / cg"
   558     "Modified: / 11-05-2012 / 09:22:04 / cg"
   555 ! !
   559 ! !
   556 
   560 
       
   561 
   557 !AbstractFileBrowser class methodsFor:'help specs'!
   562 !AbstractFileBrowser class methodsFor:'help specs'!
   558 
   563 
   559 basicFlyByHelpSpec
   564 basicFlyByHelpSpec
   560     <resource: #help>
   565     <resource: #help>
   561 
   566 
   705      self flyByHelpSpec
   710      self flyByHelpSpec
   706     "
   711     "
   707 
   712 
   708     "Modified: / 03-11-2007 / 12:05:01 / cg"
   713     "Modified: / 03-11-2007 / 12:05:01 / cg"
   709 ! !
   714 ! !
       
   715 
   710 
   716 
   711 !AbstractFileBrowser class methodsFor:'image specs'!
   717 !AbstractFileBrowser class methodsFor:'image specs'!
   712 
   718 
   713 clearHistoryIcon
   719 clearHistoryIcon
   714     <resource: #programImage>
   720     <resource: #programImage>
   916 vt100Terminal
   922 vt100Terminal
   917     <resource: #programImage>
   923     <resource: #programImage>
   918 
   924 
   919     ^ ToolbarIconLibrary shell20x20Icon
   925     ^ ToolbarIconLibrary shell20x20Icon
   920 ! !
   926 ! !
       
   927 
   921 
   928 
   922 !AbstractFileBrowser class methodsFor:'interface specs'!
   929 !AbstractFileBrowser class methodsFor:'interface specs'!
   923 
   930 
   924 encodingDialogSpec
   931 encodingDialogSpec
   925     "This resource specification was automatically generated
   932     "This resource specification was automatically generated
  1265         )
  1272         )
  1266       )
  1273       )
  1267 
  1274 
  1268     "Modified: / 28-02-2012 / 11:12:38 / cg"
  1275     "Modified: / 28-02-2012 / 11:12:38 / cg"
  1269 ! !
  1276 ! !
       
  1277 
  1270 
  1278 
  1271 !AbstractFileBrowser class methodsFor:'menu specs'!
  1279 !AbstractFileBrowser class methodsFor:'menu specs'!
  1272 
  1280 
  1273 baseBookmarksMenuSpec
  1281 baseBookmarksMenuSpec
  1274     "This resource specification was automatically generated
  1282     "This resource specification was automatically generated
  2585         nil
  2593         nil
  2586         nil
  2594         nil
  2587       )
  2595       )
  2588 ! !
  2596 ! !
  2589 
  2597 
       
  2598 
  2590 !AbstractFileBrowser class methodsFor:'menu specs-scm'!
  2599 !AbstractFileBrowser class methodsFor:'menu specs-scm'!
  2591 
  2600 
  2592 cvsMenu
  2601 cvsMenu
  2593     "This resource specification was automatically generated
  2602     "This resource specification was automatically generated
  2594      by the MenuEditor of ST/X."
  2603      by the MenuEditor of ST/X."
  2762       )
  2771       )
  2763 
  2772 
  2764     "Created: / 15-01-2012 / 13:12:30 / cg"
  2773     "Created: / 15-01-2012 / 13:12:30 / cg"
  2765 ! !
  2774 ! !
  2766 
  2775 
       
  2776 
  2767 !AbstractFileBrowser class methodsFor:'misc'!
  2777 !AbstractFileBrowser class methodsFor:'misc'!
  2768 
  2778 
  2769 newLock
  2779 newLock
  2770     ^ CodeExecutionLock new
  2780     ^ CodeExecutionLock new
  2771 ! !
  2781 ! !
  2772 
  2782 
       
  2783 
  2773 !AbstractFileBrowser class methodsFor:'resources'!
  2784 !AbstractFileBrowser class methodsFor:'resources'!
  2774 
  2785 
  2775 classResources
  2786 classResources
  2776     ^ FileBrowser classResources
  2787     ^ FileBrowser classResources
  2777 ! !
  2788 ! !
       
  2789 
  2778 
  2790 
  2779 !AbstractFileBrowser class methodsFor:'utilities'!
  2791 !AbstractFileBrowser class methodsFor:'utilities'!
  2780 
  2792 
  2781 contentsOfBytesAsHexDump:data numberOfAddressDigits:addrDigits addressStart:virtualStart
  2793 contentsOfBytesAsHexDump:data numberOfAddressDigits:addrDigits addressStart:virtualStart
  2782     "utility helper: generate a hexDump with addresses"
  2794     "utility helper: generate a hexDump with addresses"
  2943         addressStart:0
  2955         addressStart:0
  2944 
  2956 
  2945     "Modified: / 13-02-2012 / 15:01:19 / cg"
  2957     "Modified: / 13-02-2012 / 15:01:19 / cg"
  2946 ! !
  2958 ! !
  2947 
  2959 
       
  2960 
  2948 !AbstractFileBrowser methodsFor:'actions'!
  2961 !AbstractFileBrowser methodsFor:'actions'!
  2949 
  2962 
  2950 askForCommandFor:fileName thenDo:aBlock
  2963 askForCommandFor:fileName thenDo:aBlock
  2951     "setup and launch a querybox to ask for a unix command.
  2964     "setup and launch a querybox to ask for a unix command.
  2952      Then evaluate aBlock passing the command-string as argument."
  2965      Then evaluate aBlock passing the command-string as argument."
  3294     ] ensure:[
  3307     ] ensure:[
  3295         self activityVisibilityChannel value:false.
  3308         self activityVisibilityChannel value:false.
  3296     ]
  3309     ]
  3297 ! !
  3310 ! !
  3298 
  3311 
       
  3312 
  3299 !AbstractFileBrowser methodsFor:'actions bookmarks'!
  3313 !AbstractFileBrowser methodsFor:'actions bookmarks'!
  3300 
  3314 
  3301 addBookmark
  3315 addBookmark
  3302     self currentFilesAreInSameDirectory ifFalse:[^ self].
  3316     self currentFilesAreInSameDirectory ifFalse:[^ self].
  3303     self addBookmarks:(self currentSelectedDirectories).
  3317     self addBookmarks:(self currentSelectedDirectories).
  3338 !
  3352 !
  3339 
  3353 
  3340 saveBookmarks
  3354 saveBookmarks
  3341      self class saveBookmarks
  3355      self class saveBookmarks
  3342 ! !
  3356 ! !
       
  3357 
  3343 
  3358 
  3344 !AbstractFileBrowser methodsFor:'actions history'!
  3359 !AbstractFileBrowser methodsFor:'actions history'!
  3345 
  3360 
  3346 addToCommandHistory:aCommandString for:aFilename
  3361 addToCommandHistory:aCommandString for:aFilename
  3347     |cmd suffix cmdHist historySize|
  3362     |cmd suffix cmdHist historySize|
  3391         self enableForward value:false.
  3406         self enableForward value:false.
  3392 
  3407 
  3393     ].
  3408     ].
  3394 ! !
  3409 ! !
  3395 
  3410 
       
  3411 
  3396 !AbstractFileBrowser methodsFor:'applications'!
  3412 !AbstractFileBrowser methodsFor:'applications'!
  3397 
  3413 
  3398 applicationNamed:anApplicationName ifPresentDo:aBlock
  3414 applicationNamed:anApplicationName ifPresentDo:aBlock
  3399     |appl|
  3415     |appl|
  3400 
  3416 
  3406 !
  3422 !
  3407 
  3423 
  3408 directoryContentsBrowser
  3424 directoryContentsBrowser
  3409     ^ self applications at:#DirectoryContentsBrowser ifAbsent:nil.
  3425     ^ self applications at:#DirectoryContentsBrowser ifAbsent:nil.
  3410 ! !
  3426 ! !
       
  3427 
  3411 
  3428 
  3412 !AbstractFileBrowser methodsFor:'aspects'!
  3429 !AbstractFileBrowser methodsFor:'aspects'!
  3413 
  3430 
  3414 applications
  3431 applications
  3415     ^ aspects at:#applications
  3432     ^ aspects at:#applications
  3763 rootHolder:aHolder
  3780 rootHolder:aHolder
  3764 
  3781 
  3765     self aspectFor:#rootHolder put:aHolder
  3782     self aspectFor:#rootHolder put:aHolder
  3766 ! !
  3783 ! !
  3767 
  3784 
       
  3785 
  3768 !AbstractFileBrowser methodsFor:'aspects handling'!
  3786 !AbstractFileBrowser methodsFor:'aspects handling'!
  3769 
  3787 
  3770 aspectFor:something ifAbsent:aBlock
  3788 aspectFor:something ifAbsent:aBlock
  3771     "returns the model for an aspect; these are stored in a common dictionary"
  3789     "returns the model for an aspect; these are stored in a common dictionary"
  3772 
  3790 
  3872         ifAbsent:nil "(self class userPreferencesAspectList at:something)".
  3890         ifAbsent:nil "(self class userPreferencesAspectList at:something)".
  3873 
  3891 
  3874     "Modified: / 14-10-2010 / 19:16:38 / cg"
  3892     "Modified: / 14-10-2010 / 19:16:38 / cg"
  3875 ! !
  3893 ! !
  3876 
  3894 
       
  3895 
  3877 !AbstractFileBrowser methodsFor:'aspects-filter'!
  3896 !AbstractFileBrowser methodsFor:'aspects-filter'!
  3878 
  3897 
  3879 filter:aString
  3898 filter:aString
  3880     self filterModel value:aString
  3899     self filterModel value:aString
  3881 !
  3900 !
  3994 
  4013 
  3995 fileHistory
  4014 fileHistory
  3996     ^ self aspectFor:#fileHistory ifAbsent:[OrderedSet new]
  4015     ^ self aspectFor:#fileHistory ifAbsent:[OrderedSet new]
  3997 ! !
  4016 ! !
  3998 
  4017 
       
  4018 
  3999 !AbstractFileBrowser methodsFor:'aspects-visibility'!
  4019 !AbstractFileBrowser methodsFor:'aspects-visibility'!
  4000 
  4020 
  4001 activityVisibilityChannel
  4021 activityVisibilityChannel
  4002     " activityVisibilityChannel switches the activity indicator on/off"
  4022     " activityVisibilityChannel switches the activity indicator on/off"
  4003 
  4023 
  4222 viewType
  4242 viewType
  4223     " aspect for show suffix (type) information in DirectoryContentsBrowser"
  4243     " aspect for show suffix (type) information in DirectoryContentsBrowser"
  4224 
  4244 
  4225     ^ self directoryContentsBrowser viewType
  4245     ^ self directoryContentsBrowser viewType
  4226 ! !
  4246 ! !
       
  4247 
  4227 
  4248 
  4228 !AbstractFileBrowser methodsFor:'background processing'!
  4249 !AbstractFileBrowser methodsFor:'background processing'!
  4229 
  4250 
  4230 executeCommand:cmd
  4251 executeCommand:cmd
  4231 
  4252 
  4305     self backgroundProcesses add:process.
  4326     self backgroundProcesses add:process.
  4306     appl process value:process.
  4327     appl process value:process.
  4307     process resume.
  4328     process resume.
  4308 ! !
  4329 ! !
  4309 
  4330 
       
  4331 
  4310 !AbstractFileBrowser methodsFor:'change & update'!
  4332 !AbstractFileBrowser methodsFor:'change & update'!
  4311 
  4333 
  4312 currentFileNameHolderChanged
  4334 currentFileNameHolderChanged
  4313     "/ self currentFileNameHolderChangedForCommon
  4335     "/ self currentFileNameHolderChangedForCommon
  4314 !
  4336 !
  4432 
  4454 
  4433 updateListAfterDelete:colOfFiles
  4455 updateListAfterDelete:colOfFiles
  4434     self updateCurrentDirectory
  4456     self updateCurrentDirectory
  4435 ! !
  4457 ! !
  4436 
  4458 
       
  4459 
  4437 !AbstractFileBrowser methodsFor:'clipboard'!
  4460 !AbstractFileBrowser methodsFor:'clipboard'!
  4438 
  4461 
  4439 canPaste
  4462 canPaste
  4440 
  4463 
  4441     ^ self aspectFor:#canPaste ifAbsent:[ false asValue ].
  4464     ^ self aspectFor:#canPaste ifAbsent:[ false asValue ].
  4482     self notify:stream contents.
  4505     self notify:stream contents.
  4483     stream close.
  4506     stream close.
  4484     clp files:colOfFiles.
  4507     clp files:colOfFiles.
  4485     self canPaste value:true.
  4508     self canPaste value:true.
  4486 ! !
  4509 ! !
       
  4510 
  4487 
  4511 
  4488 !AbstractFileBrowser methodsFor:'drag & drop'!
  4512 !AbstractFileBrowser methodsFor:'drag & drop'!
  4489 
  4513 
  4490 canDropFiles:dropedObjects for:filename 
  4514 canDropFiles:dropedObjects for:filename 
  4491     |filenameDirString filenameDir|
  4515     |filenameDirString filenameDir|
  4613             wakeUp
  4637             wakeUp
  4614     ].
  4638     ].
  4615 
  4639 
  4616     "Created: / 13-10-2006 / 18:26:41 / cg"
  4640     "Created: / 13-10-2006 / 18:26:41 / cg"
  4617 ! !
  4641 ! !
       
  4642 
  4618 
  4643 
  4619 !AbstractFileBrowser methodsFor:'file operations'!
  4644 !AbstractFileBrowser methodsFor:'file operations'!
  4620 
  4645 
  4621 copyFile:aSourceFile to:aDestFile
  4646 copyFile:aSourceFile to:aDestFile
  4622     "copy to"
  4647     "copy to"
  5127     ].
  5152     ].
  5128 
  5153 
  5129     "Modified: / 04-12-2006 / 13:15:24 / cg"
  5154     "Modified: / 04-12-2006 / 13:15:24 / cg"
  5130 ! !
  5155 ! !
  5131 
  5156 
       
  5157 
  5132 !AbstractFileBrowser methodsFor:'menu accessing'!
  5158 !AbstractFileBrowser methodsFor:'menu accessing'!
  5133 
  5159 
  5134 bookmarksMenu
  5160 bookmarksMenu
  5135     <resource: #programMenu>
  5161     <resource: #programMenu>
  5136 
  5162 
  5360     menu findGuiResourcesIn:self.
  5386     menu findGuiResourcesIn:self.
  5361     ^ menu
  5387     ^ menu
  5362 
  5388 
  5363     "Modified: / 09-09-2012 / 13:07:45 / cg"
  5389     "Modified: / 09-09-2012 / 13:07:45 / cg"
  5364 ! !
  5390 ! !
       
  5391 
  5365 
  5392 
  5366 !AbstractFileBrowser methodsFor:'menu actions'!
  5393 !AbstractFileBrowser methodsFor:'menu actions'!
  5367 
  5394 
  5368 doCompareTwoFiles
  5395 doCompareTwoFiles
  5369     self openDiffView.
  5396     self openDiffView.
  5451     ^ Filename tempDirectory.
  5478     ^ Filename tempDirectory.
  5452 
  5479 
  5453     "Created: / 29-12-2010 / 11:03:00 / cg"
  5480     "Created: / 29-12-2010 / 11:03:00 / cg"
  5454 ! !
  5481 ! !
  5455 
  5482 
       
  5483 
  5456 !AbstractFileBrowser methodsFor:'menu actions-file'!
  5484 !AbstractFileBrowser methodsFor:'menu actions-file'!
  5457 
  5485 
  5458 copyFiles
  5486 copyFiles
  5459     self 
  5487     self 
  5460         withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self copyFilesToClipBoard:filesOrDirs]
  5488         withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self copyFilesToClipBoard:filesOrDirs]
  5497             aBlock value:dirs.        
  5525             aBlock value:dirs.        
  5498         ].
  5526         ].
  5499     ].
  5527     ].
  5500 ! !
  5528 ! !
  5501 
  5529 
       
  5530 
  5502 !AbstractFileBrowser methodsFor:'menu actions-help'!
  5531 !AbstractFileBrowser methodsFor:'menu actions-help'!
  5503 
  5532 
  5504 openAboutThisApplication
  5533 openAboutThisApplication
  5505     "opens an about box for this application."
  5534     "opens an about box for this application."
  5506 
  5535 
  5508 !
  5537 !
  5509 
  5538 
  5510 openHTMLDocument:relativeDocPath
  5539 openHTMLDocument:relativeDocPath
  5511     HTMLDocumentView openFullOnDocumentationFile:relativeDocPath
  5540     HTMLDocumentView openFullOnDocumentationFile:relativeDocPath
  5512 ! !
  5541 ! !
       
  5542 
  5513 
  5543 
  5514 !AbstractFileBrowser methodsFor:'menu actions-scm-cvs'!
  5544 !AbstractFileBrowser methodsFor:'menu actions-scm-cvs'!
  5515 
  5545 
  5516 cvsAddAndCommit
  5546 cvsAddAndCommit
  5517     self cvsAddAndCommitAsBinary:false
  5547     self cvsAddAndCommitAsBinary:false
  5813         stream nextPutAll:file baseName.
  5843         stream nextPutAll:file baseName.
  5814         stream nextPutAll:'" '.
  5844         stream nextPutAll:'" '.
  5815     ].
  5845     ].
  5816     ^ stream contents.
  5846     ^ stream contents.
  5817 ! !
  5847 ! !
       
  5848 
  5818 
  5849 
  5819 !AbstractFileBrowser methodsFor:'menu actions-scm-mercurial'!
  5850 !AbstractFileBrowser methodsFor:'menu actions-scm-mercurial'!
  5820 
  5851 
  5821 mercurialAdd
  5852 mercurialAdd
  5822     |executionBlock sel maxCmdSize|
  5853     |executionBlock sel maxCmdSize|
  7192             |pkcs7SignedData signatureFilename|
  7223             |pkcs7SignedData signatureFilename|
  7193 
  7224 
  7194             self notify:'Generating signed file from: ', (fn baseName), '...'.
  7225             self notify:'Generating signed file from: ', (fn baseName), '...'.
  7195 
  7226 
  7196             pkcs7SignedData := Expecco::KeyFileGenerator new signExpeccoCode:fn contentsOfEntireFile.
  7227             pkcs7SignedData := Expecco::KeyFileGenerator new signExpeccoCode:fn contentsOfEntireFile.
  7197             signatureFilename := fn addSuffix:'signed'.
  7228             signatureFilename := fn withSuffix:'expeccoPatch'.
  7198             signatureFilename contents:pkcs7SignedData.
  7229             signatureFilename contents:pkcs7SignedData.
  7199         ].
  7230         ].
  7200         self notify:nil.
  7231         self notify:nil.
  7201     ]
  7232     ]
  7202 !
  7233 !
  8084     self notify:nil.
  8115     self notify:nil.
  8085 
  8116 
  8086     "Modified: / 04-12-2006 / 13:15:28 / cg"
  8117     "Modified: / 04-12-2006 / 13:15:28 / cg"
  8087 ! !
  8118 ! !
  8088 
  8119 
       
  8120 
  8089 !AbstractFileBrowser methodsFor:'menu queries-cvs'!
  8121 !AbstractFileBrowser methodsFor:'menu queries-cvs'!
  8090 
  8122 
  8091 canCvsAddAndCommit
  8123 canCvsAddAndCommit
  8092 
  8124 
  8093     |selectedFiles|
  8125     |selectedFiles|
  8104             dirOfFile := self getDirWithoutFileName:fileName.
  8136             dirOfFile := self getDirWithoutFileName:fileName.
  8105             cvsDir := dirOfFile construct:'CVS'.
  8137             cvsDir := dirOfFile construct:'CVS'.
  8106             cvsDir isDirectory
  8138             cvsDir isDirectory
  8107         ].
  8139         ].
  8108 ! !
  8140 ! !
       
  8141 
  8109 
  8142 
  8110 !AbstractFileBrowser methodsFor:'menu queries-tools'!
  8143 !AbstractFileBrowser methodsFor:'menu queries-tools'!
  8111 
  8144 
  8112 anySTFilesOrDirectoriesPresent
  8145 anySTFilesOrDirectoriesPresent
  8113     ^ self anyDirectoriesOrFilesPresentWithSuffix:'st'
  8146     ^ self anyDirectoriesOrFilesPresentWithSuffix:'st'
  8295 
  8328 
  8296     ^ false
  8329     ^ false
  8297 ! !
  8330 ! !
  8298 
  8331 
  8299 
  8332 
  8300 
       
  8301 !AbstractFileBrowser methodsFor:'presentation'!
  8333 !AbstractFileBrowser methodsFor:'presentation'!
  8302 
  8334 
  8303 getModeString:modeBits
  8335 getModeString:modeBits
  8304     "convert file-mode bits into a more user-friendly string.
  8336     "convert file-mode bits into a more user-friendly string.
  8305      This is wrong here - should be moved into OperatingSystem."
  8337      This is wrong here - should be moved into OperatingSystem."
  8335         ]
  8367         ]
  8336     ].
  8368     ].
  8337     ^ modeString
  8369     ^ modeString
  8338 ! !
  8370 ! !
  8339 
  8371 
       
  8372 
  8340 !AbstractFileBrowser methodsFor:'private'!
  8373 !AbstractFileBrowser methodsFor:'private'!
  8341 
  8374 
  8342 theSingleSelectedDirectoryOrHomeDir
  8375 theSingleSelectedDirectoryOrHomeDir
  8343     |dir|
  8376     |dir|
  8344 
  8377 
  8352 
  8385 
  8353     dirs := self currentSelectedDirectories.
  8386     dirs := self currentSelectedDirectories.
  8354     dirs size ~= 1 ifTrue:[ ^ nil].
  8387     dirs size ~= 1 ifTrue:[ ^ nil].
  8355     ^ dirs anElement.
  8388     ^ dirs anElement.
  8356 ! !
  8389 ! !
       
  8390 
  8357 
  8391 
  8358 !AbstractFileBrowser methodsFor:'queries'!
  8392 !AbstractFileBrowser methodsFor:'queries'!
  8359 
  8393 
  8360 cBrowserLoaded
  8394 cBrowserLoaded
  8361     ^ CBrowser::Browser notNil
  8395     ^ CBrowser::Browser notNil
  8499 !
  8533 !
  8500 
  8534 
  8501 systemIsUnix
  8535 systemIsUnix
  8502     ^ OperatingSystem isUNIXlike
  8536     ^ OperatingSystem isUNIXlike
  8503 ! !
  8537 ! !
       
  8538 
  8504 
  8539 
  8505 !AbstractFileBrowser methodsFor:'queries-file'!
  8540 !AbstractFileBrowser methodsFor:'queries-file'!
  8506 
  8541 
  8507 allItemsOfCurrentDirectory
  8542 allItemsOfCurrentDirectory
  8508     self 
  8543     self 
  8683 
  8718 
  8684 recursiveAnySTFilesPresent
  8719 recursiveAnySTFilesPresent
  8685     ^ self recursiveAnyFilesPresentWithSuffix:'st'
  8720     ^ self recursiveAnyFilesPresentWithSuffix:'st'
  8686 ! !
  8721 ! !
  8687 
  8722 
       
  8723 
  8688 !AbstractFileBrowser methodsFor:'selection'!
  8724 !AbstractFileBrowser methodsFor:'selection'!
  8689 
  8725 
  8690 currentSelectedDirectories
  8726 currentSelectedDirectories
  8691     ^ self currentDirectoriesValue.
  8727     ^ self currentDirectoriesValue.
  8692 !
  8728 !
  8701     ^ self currentFileNameHolder value 
  8737     ^ self currentFileNameHolder value 
  8702 !
  8738 !
  8703 
  8739 
  8704 firstSelectedFile
  8740 firstSelectedFile
  8705     ^ self currentSelectedObjects 
  8741     ^ self currentSelectedObjects 
  8706         detect:[:file | file asFilename isDirectory not]
  8742         detect:[:file | (file ? '') asFilename isDirectory not]
  8707         ifNone:[].
  8743         ifNone:[].
  8708 
  8744 
  8709     "Modified: / 04-12-2006 / 13:14:50 / cg"
  8745     "Modified: / 04-12-2006 / 13:14:50 / cg"
  8710 !
  8746 !
  8711 
  8747 
  8735     ^ self currentSelectedObjects size == 2 
  8771     ^ self currentSelectedObjects size == 2 
  8736         and:[self hasOnlyFilesSelected]
  8772         and:[self hasOnlyFilesSelected]
  8737 
  8773 
  8738     "Modified: / 04-12-2006 / 13:15:04 / cg"
  8774     "Modified: / 04-12-2006 / 13:15:04 / cg"
  8739 ! !
  8775 ! !
       
  8776 
  8740 
  8777 
  8741 !AbstractFileBrowser methodsFor:'sorting'!
  8778 !AbstractFileBrowser methodsFor:'sorting'!
  8742 
  8779 
  8743 currentSortOrder
  8780 currentSortOrder
  8744     ^ self aspectFor:#currentSortOrder ifAbsent:[ Dictionary new asValue ].
  8781     ^ self aspectFor:#currentSortOrder ifAbsent:[ Dictionary new asValue ].
  8818     self sortBlockHolder value:sorter.
  8855     self sortBlockHolder value:sorter.
  8819 
  8856 
  8820     "Modified: / 18-09-2007 / 09:42:47 / cg"
  8857     "Modified: / 18-09-2007 / 09:42:47 / cg"
  8821 ! !
  8858 ! !
  8822 
  8859 
       
  8860 
  8823 !AbstractFileBrowser methodsFor:'startup & release'!
  8861 !AbstractFileBrowser methodsFor:'startup & release'!
  8824 
  8862 
  8825 makeDependent
  8863 makeDependent
  8826     self filterModel addDependent:self.            
  8864     self filterModel addDependent:self.            
  8827     self currentFileNameHolder addDependent:self.
  8865     self currentFileNameHolder addDependent:self.
  8859     self windowGroup showWaitCursorWhenBusyForMillis:100.
  8897     self windowGroup showWaitCursorWhenBusyForMillis:100.
  8860 
  8898 
  8861     "Modified: / 25-07-2006 / 09:12:45 / cg"
  8899     "Modified: / 25-07-2006 / 09:12:45 / cg"
  8862 ! !
  8900 ! !
  8863 
  8901 
       
  8902 
  8864 !AbstractFileBrowser::Clipboard methodsFor:'accessing'!
  8903 !AbstractFileBrowser::Clipboard methodsFor:'accessing'!
  8865 
  8904 
  8866 files
  8905 files
  8867     "return the value of the instance variable 'files' (automatically generated)"
  8906     "return the value of the instance variable 'files' (automatically generated)"
  8868 
  8907 
  8885     "set the value of the instance variable 'method' (automatically generated)"
  8924     "set the value of the instance variable 'method' (automatically generated)"
  8886 
  8925 
  8887     method := something.
  8926     method := something.
  8888 ! !
  8927 ! !
  8889 
  8928 
       
  8929 
  8890 !AbstractFileBrowser::CodeExecutionLock methodsFor:'accessing'!
  8930 !AbstractFileBrowser::CodeExecutionLock methodsFor:'accessing'!
  8891 
  8931 
  8892 locked
  8932 locked
  8893     "return the value of the instance variable 'locked' (automatically generated)"
  8933     "return the value of the instance variable 'locked' (automatically generated)"
  8894 
  8934 
  8895     locked isNil ifTrue:[
  8935     locked isNil ifTrue:[
  8896         locked := false.
  8936         locked := false.
  8897     ].
  8937     ].
  8898     ^ locked
  8938     ^ locked
  8899 ! !
  8939 ! !
       
  8940 
  8900 
  8941 
  8901 !AbstractFileBrowser::CodeExecutionLock methodsFor:'actions'!
  8942 !AbstractFileBrowser::CodeExecutionLock methodsFor:'actions'!
  8902 
  8943 
  8903 doIfUnLocked:aBlock
  8944 doIfUnLocked:aBlock
  8904 
  8945 
  8913     aBlock ensure:[
  8954     aBlock ensure:[
  8914         locked := false.
  8955         locked := false.
  8915     ]
  8956     ]
  8916 ! !
  8957 ! !
  8917 
  8958 
       
  8959 
  8918 !AbstractFileBrowser::DirectoryHistory class methodsFor:'defaults'!
  8960 !AbstractFileBrowser::DirectoryHistory class methodsFor:'defaults'!
  8919 
  8961 
  8920 defaultHistorySize
  8962 defaultHistorySize
  8921     ^ 50
  8963     ^ 50
  8922 ! !
  8964 ! !
  8923 
  8965 
       
  8966 
  8924 !AbstractFileBrowser::DirectoryHistory class methodsFor:'instance creation'!
  8967 !AbstractFileBrowser::DirectoryHistory class methodsFor:'instance creation'!
  8925 
  8968 
  8926 new
  8969 new
  8927     ^ (super new) initializeHistory.
  8970     ^ (super new) initializeHistory.
  8928 ! !
  8971 ! !
  8929 
  8972 
       
  8973 
  8930 !AbstractFileBrowser::DirectoryHistory methodsFor:'accessing'!
  8974 !AbstractFileBrowser::DirectoryHistory methodsFor:'accessing'!
  8931 
  8975 
  8932 historySize
  8976 historySize
  8933     historySize isNil ifTrue:[^ self class defaultHistorySize].
  8977     historySize isNil ifTrue:[^ self class defaultHistorySize].
  8934     ^ historySize
  8978     ^ historySize
  8935 !
  8979 !
  8936 
  8980 
  8937 historySize:aNumber
  8981 historySize:aNumber
  8938     historySize := aNumber
  8982     historySize := aNumber
  8939 ! !
  8983 ! !
       
  8984 
  8940 
  8985 
  8941 !AbstractFileBrowser::DirectoryHistory methodsFor:'actions'!
  8986 !AbstractFileBrowser::DirectoryHistory methodsFor:'actions'!
  8942 
  8987 
  8943 addToHistory:aPath
  8988 addToHistory:aPath
  8944     | item pathToAdd |
  8989     | item pathToAdd |
  9029             item position:aPosition.
  9074             item position:aPosition.
  9030         ]
  9075         ]
  9031     ].
  9076     ].
  9032 ! !
  9077 ! !
  9033 
  9078 
       
  9079 
  9034 !AbstractFileBrowser::DirectoryHistory methodsFor:'initialization'!
  9080 !AbstractFileBrowser::DirectoryHistory methodsFor:'initialization'!
  9035 
  9081 
  9036 initializeHistory
  9082 initializeHistory
  9037 
  9083 
  9038     backForwardList := OrderedCollection new.
  9084     backForwardList := OrderedCollection new.
  9039     self reverseDo:[:el|
  9085     self reverseDo:[:el|
  9040         backForwardList add:el path.
  9086         backForwardList add:el path.
  9041     ].
  9087     ].
  9042     backForwardIndex := backForwardList size.
  9088     backForwardIndex := backForwardList size.
  9043 ! !
  9089 ! !
       
  9090 
  9044 
  9091 
  9045 !AbstractFileBrowser::DirectoryHistory methodsFor:'queries'!
  9092 !AbstractFileBrowser::DirectoryHistory methodsFor:'queries'!
  9046 
  9093 
  9047 canBackward
  9094 canBackward
  9048 
  9095 
  9125         retPath := backForwardList at:backForwardIndex + 1.
  9172         retPath := backForwardList at:backForwardIndex + 1.
  9126     ].
  9173     ].
  9127     ^ retPath.
  9174     ^ retPath.
  9128 ! !
  9175 ! !
  9129 
  9176 
       
  9177 
  9130 !AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem class methodsFor:'instance creation'!
  9178 !AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem class methodsFor:'instance creation'!
  9131 
  9179 
  9132 path:aPath
  9180 path:aPath
  9133 
  9181 
  9134     ^ self new path:aPath
  9182     ^ self new path:aPath
  9135 ! !
  9183 ! !
  9136 
  9184 
       
  9185 
  9137 !AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem methodsFor:'accessing'!
  9186 !AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem methodsFor:'accessing'!
  9138 
  9187 
  9139 asFilename
  9188 asFilename
  9140     ^ path asFilename
  9189     ^ path asFilename
  9141 !
  9190 !
  9166 
  9215 
  9167 printString
  9216 printString
  9168 
  9217 
  9169     ^ self path asString
  9218     ^ self path asString
  9170 ! !
  9219 ! !
       
  9220 
  9171 
  9221 
  9172 !AbstractFileBrowser::SaveAspectItem class methodsFor:'instance creation'!
  9222 !AbstractFileBrowser::SaveAspectItem class methodsFor:'instance creation'!
  9173 
  9223 
  9174 withValue:aValue isHolder:aBoolean
  9224 withValue:aValue isHolder:aBoolean
  9175 
  9225 
  9179     instance value:aValue.
  9229     instance value:aValue.
  9180     instance isHolder:aBoolean.
  9230     instance isHolder:aBoolean.
  9181     ^ instance
  9231     ^ instance
  9182 ! !
  9232 ! !
  9183 
  9233 
       
  9234 
  9184 !AbstractFileBrowser::SaveAspectItem methodsFor:'accessing'!
  9235 !AbstractFileBrowser::SaveAspectItem methodsFor:'accessing'!
  9185 
  9236 
  9186 isHolder
  9237 isHolder
  9187     "return the value of the instance variable 'isHolder' (automatically generated)"
  9238     "return the value of the instance variable 'isHolder' (automatically generated)"
  9188 
  9239 
  9205     "set the value of the instance variable 'value' (automatically generated)"
  9256     "set the value of the instance variable 'value' (automatically generated)"
  9206 
  9257 
  9207     value := something.
  9258     value := something.
  9208 ! !
  9259 ! !
  9209 
  9260 
       
  9261 
  9210 !AbstractFileBrowser class methodsFor:'documentation'!
  9262 !AbstractFileBrowser class methodsFor:'documentation'!
  9211 
  9263 
  9212 version
  9264 version
  9213     ^ '$Id: AbstractFileBrowser.st 8084 2013-01-14 12:06:02Z vranyj1 $'
  9265     ^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.507 2013-01-15 14:07:08 stefan Exp $'
  9214 !
  9266 !
  9215 
  9267 
  9216 version_CVS
  9268 version_CVS
  9217     ^ '§Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.505 2012/11/21 07:48:33 cg Exp §'
  9269     ^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.507 2013-01-15 14:07:08 stefan Exp $'
  9218 !
  9270 !
  9219 
  9271 
  9220 version_SVN
  9272 version_SVN
  9221     ^ '$Id: AbstractFileBrowser.st 8084 2013-01-14 12:06:02Z vranyj1 $'
  9273     ^ '$Id: AbstractFileBrowser.st 8084 2013-01-14 12:06:02Z vranyj1 $'
  9222 ! !
  9274 ! !
       
  9275