Bring the Test Runner window back if you had it minimized. FileListTest should be the only test class selected in the list. Press the "RUN" button.
As an aside, we could have made code changes that impacted other unexpected portions of Squeak. The more complete approach here is to iterate over the specific test case in question until we are sure have everything correct and then run the complete set of test cases, "RUN ALL", to ensure we didn't break something else.We didn't really provide the hook in FileList to do this from the GUI. You can close the Test Runner now.
Adding a menu item to FileList will be easy. One of the problems we will need to solve though is, how do we prompt the user for the target directory?
Some of the optional enhancements you may have installed earlier brought along a change set that solves this problem for us. Open up a ChangeSorter and see if you have a change set named "Dialogs-sbw".
Looking at the class methods in FileList2, the method #modalFolderSelectorWithPrompt: might work for us. Let's see what it does by trying it in a Workspace. Type this code in a Workspace:
If you select the whole line and then perform a Command-I (Inspect) you will see both what it does and what it answers by way of an inspector on the result. It looks like you can choose folders using this dialog window. It answers a directory object. When cancel is pressed it answers nil.
FileList2 modalFolderSelectorWithPrompt: 'test'
Here is the instance method we can use in FileList.
| result |
listIndex = 0
ifTrue: [^ self].
(result := FileList2 modalFolderSelectorWithPrompt: 'Choose folder')
ifNotNil: [self copySelectedFileToDirectory: result]
Following a similar pattern as we did when we added a menu item before, we should add this method to FileList.
Open up a File List and test this feature manually. Select a file, see that the "copy file" menu item exists, and then use the new driectory dialog to specify the location for the copy, and then check that it worked.
Continue on to the next page of second FileList enhancement.
Back to the beginning of this example.kerry washington nude free