scripts icon indicating copy to clipboard operation
scripts copied to clipboard

allow to select directory in wizard

Open plata opened this issue 7 years ago • 5 comments

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).

plata avatar Jun 15 '18 20:06 plata

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.

madoar avatar Jun 16 '18 08:06 madoar

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.

plata avatar Jun 16 '18 09:06 plata

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.

madoar avatar Jun 16 '18 10:06 madoar

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".

plata avatar Jun 16 '18 12:06 plata

Yes, you're right. Then I believe we should go with browseDir and browseFile.

madoar avatar Jun 16 '18 15:06 madoar