On 2013-09-26, at 15:50, GOUBIER Thierry <thierry.goubier@cea.fr> wrote:
Thanks, Sean, I'm happy that after Erwan suggestion of an issue, someone took charge of cleaning that :)
My own position is that current Pharo has unified the filesystem issue with FileReference, and that I'm not impressed by moving ten variants of an API for choosing files from one class to another. But that's just me :)
I think at the core we have a single method which returns FileReferences, and which has four parameters: title, start path, pattern, name (no need for an open). I'll move some of the API complexity in the pattern object, so that it may be able to make the distinction between files and directory, and of course extensions (with a reflective method to list the possible extensions). The pattern should be easy to create :), i.e. nil, '*.png', #isADirectory, whatever. All parameters may be nil, and like that there isn't any dependency on Morphic or the command line.
answer := UIManager default chooseFileReference: 'Select a file' path: aFileReference pattern: '*.png' name: nil
(name: is for those Save As dialogs where you already have a pre-existing file name)
I would also say that spans over the most common options. Convert #pattern: to #filter: which takes a block over the shown file reference and you can implement almost everything ;)