scripts
scripts copied to clipboard
allow to select directory in wizard
In StepRepresentationBrowse, we have a FileChooser. To select a directory, we need a DirectoryChooser. Makes sense to have it, the only question is how the API should look like: additional parameter or new method (e.g. browseDir).
If we add a new DirectoryChooser, which is accessible via browseDir we should rename browse to browseFile.
In addition we could extend the current browse method with an additional parameter, which specifies whether a file or a directory is to be choosen.
Depending on the specified value either a DirectoryChooser or a FileChooser is opened.
Yes, these are exactly the two possibilities. The question is: which one do we prefer? I think I would prefer browseDir and browseFile because it's closer to the Java semantics.
Can't we support both, i.e. browse, browseDir and browseFile?
browse only needs to call browseDir or browseFile depending on the extra input parameter.
We could do that but to be honest, I don't like it because the API is not really clear. For me, if someone asks "how should I do xyz", there should be one unique answer and not "you could do this, but you could also do that".
Yes, you're right.
Then I believe we should go with browseDir and browseFile.