FileBrowser.st
changeset 3280 080d1640782e
parent 3272 cbd7ef76ddbc
child 3281 28434fef0cf7
equal deleted inserted replaced
3279:6f9f09bb330f 3280:080d1640782e
  2732     "rename the selected file(s)"
  2732     "rename the selected file(s)"
  2733 
  2733 
  2734     |queryBox b lastNewName lastOldName prefix initialText|
  2734     |queryBox b lastNewName lastOldName prefix initialText|
  2735 
  2735 
  2736     queryBox := FilenameEnterBox new.
  2736     queryBox := FilenameEnterBox new.
  2737     queryBox okText:(resources at:'rename').
  2737     queryBox okText:(resources at:'Rename').
  2738     fileListView selection size > 1 ifTrue:[
  2738     fileListView selection size > 1 ifTrue:[
  2739         b := queryBox addAbortButtonLabelled:(resources at:'cancel All').
  2739         b := queryBox addAbortButtonLabelled:(resources at:'cancel All').
  2740         b action:[^ self ].
  2740         b action:[^ self ].
  2741     ].
  2741     ].
  2742 
  2742 
  2743     self selectedFilesDo:[:oldName |
  2743     self selectedFilesDo:[:oldName |
  2744         queryBox title:(resources string:'rename ''%1'' to:' with:oldName).
  2744         queryBox title:(resources string:'Rename ''%1'' to:' with:oldName).
  2745         initialText := oldName.
  2745         initialText := oldName.
  2746 
  2746 
  2747         (lastNewName notNil
  2747         (lastNewName notNil
  2748         and:[lastNewName endsWith:lastOldName]) ifTrue:[
  2748         and:[lastNewName endsWith:lastOldName]) ifTrue:[
  2749             "/ intelligent default ...
  2749             "/ intelligent default ...
  2841     "ask for and create a new directory"
  2841     "ask for and create a new directory"
  2842 
  2842 
  2843     |queryBox|
  2843     |queryBox|
  2844 
  2844 
  2845     queryBox := FilenameEnterBox 
  2845     queryBox := FilenameEnterBox 
  2846 		    title:(resources at:'create new directory:') withCRs
  2846                     title:(resources at:'Create new directory:') withCRs
  2847 		    okText:(resources at:'create')
  2847                     okText:(resources at:'Create')
  2848 		    action:[:newName | self doCreateDirectory:newName].
  2848                     action:[:newName | self doCreateDirectory:newName].
  2849     queryBox showAtPointer
  2849     queryBox showAtPointer
  2850 
  2850 
  2851     "Modified: 23.4.1997 / 13:04:27 / cg"
  2851     "Modified: 23.4.1997 / 13:04:27 / cg"
  2852 !
  2852 !
  2853 
  2853 
  2855     "ask for and create a new file"
  2855     "ask for and create a new file"
  2856 
  2856 
  2857     |sel queryBox|
  2857     |sel queryBox|
  2858 
  2858 
  2859     queryBox := FilenameEnterBox 
  2859     queryBox := FilenameEnterBox 
  2860                     title:(resources at:'create new file:') withCRs
  2860                     title:(resources at:'Create new file:') withCRs
  2861                     okText:(resources at:'create')
  2861                     okText:(resources at:'Create')
  2862                     action:[:newName | newName isEmpty ifFalse:[
  2862                     action:[:newName | newName isEmpty ifFalse:[
  2863                                            self doCreateFile:newName.
  2863                                            self doCreateFile:newName.
  2864                                            self selectFile:newName.
  2864                                            self selectFile:newName.
  2865                                        ]
  2865                                        ]
  2866                            ].
  2866                            ].
  4693     |box osName|
  4693     |box osName|
  4694 
  4694 
  4695     osName := OperatingSystem platformName.
  4695     osName := OperatingSystem platformName.
  4696 
  4696 
  4697     box := FilenameEnterBox 
  4697     box := FilenameEnterBox 
  4698 		title:(resources string:'execute %1 command:' with:osName)
  4698                 title:(resources string:'Execute %1 command:' with:osName)
  4699 	       okText:(resources string:'execute')
  4699                okText:(resources string:'Execute')
  4700 	       action:aBlock.
  4700                action:aBlock.
  4701 
  4701 
  4702     fileName notNil ifTrue:[
  4702     fileName notNil ifTrue:[
  4703 	self initialCommandFor:fileName into:box.
  4703         self initialCommandFor:fileName into:box.
  4704     ].
  4704     ].
  4705     box directory:currentDirectory.
  4705     box directory:currentDirectory.
  4706     box showAtPointer.
  4706     box showAtPointer.
  4707     box destroy.
  4707     box destroy.
  4708 
  4708 
  7330 ! !
  7330 ! !
  7331 
  7331 
  7332 !FileBrowser class methodsFor:'documentation'!
  7332 !FileBrowser class methodsFor:'documentation'!
  7333 
  7333 
  7334 version
  7334 version
  7335     ^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.425 2001-10-08 16:26:45 cg Exp $'
  7335     ^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.426 2001-10-09 23:14:01 cg Exp $'
  7336 ! !
  7336 ! !