List Icon
Mailing list Archive

2019 up to July 2022 | 20182017  |  2016  2015 2014 | 2013

The mailing list has been closed since July 2022, but continues to serve as an archive of information about QF-Test.
If you want to stay informed about news about QF-Test, you can simply subscribe to our newsletter:
Subscribe to Newsletter  

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [QF-Test] Select multiple files in filechooser

  • Subject: Re: [QF-Test] Select multiple files in filechooser
  • From: Gregor Schmid <Gregor.Schmid@?.de>
  • Date: Thu, 02 May 2013 20:56:52 +0200

Hello Gonzalo,

yes, it is possible to select multiple files with this procedure,
though it's neither documented nor obvious. In fact, I had to
experiment a little to find out how to do it.

In short, if a JFileChooser has multi selection enabled, it lists the
selected files as a blank-separated list of quoted filenames in the
file name field. As with single selection it is possible to simply set
the text-field to the select file(s) and click OK, which is what the
selectFile procedure does. So, if you call selectFile with the
parameter file set to

"/tmp/foo" "/tmp/bar"

the result should be a selection of those two files.

Getting the parameter into the selected format can be done with a bit
of scripting. If you've got the files as a comma-separated list, for
example, the following script should help

files = rc.lookup("files").split(",")
# Now files is the list of filenames once you've got those, the
# following statement will create the required string
files = " ".join(['"%s"' % f.strip() for f in files])
rc.callProcedure("qfs.swing.filechooser.selectFile", {"file": files})

I think we'll add a selectFiles procedure to our standard library.

Best regards,

Gonzalo Parra <gonzalo.parra@?.com> writes:

> Hello,
> I'm using the filechooser utility package included in the standard library and I have a question:
> Is it possible to select multiple files using this utility? How can I do it?
> Is there any workaround to this?
> Thank you very much.
> Best Regards
> _______________________________________________
> qftest-list mailing list
> qftest-list@?.de

Gregor Schmid                                Gregor.Schmid@?.de
Quality First Software GmbH           
Tulpenstr. 41                               Tel: +49 8171 38648-0
DE-82538 Geretsried                         Fax: +49 8171 3864816
GF: Gregor Schmid, Karlheinz Kellerer          HRB München 140833