List Icon
Archiv Mailingliste

2019 bis Juli 2022  2018  | 2017 2016 2015 | 2014 | 2013

Die Mailingliste ist seit Juli 2022 geschlossen, dient aber weiterhin als Informationsarchiv zu QF-Test.
Wenn Sie aber über Neuerungen zu QF-Test informiert bleiben wollen, können Sie einfach unseren
Newsletter abonnieren

Um aktuell die Informationen zu jeder Release - auch Minor Releases - zu bekommen, können Sie den
RSS-Feed abonnieren oder uns in sozialen Medien folgen.
Alternativ bietet QF-Test auch selbst eine Versionsinformation an.

Eine weitere Informationsquelle ist unser Blog, in dem es aktuelle Beiträge zu allgemeinen Themen, zur Firma QFS und auch diverse "How-Tos" gibt:
Blog abonnieren


[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,
    Greg

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
> http://www.qfs.de/mailman/listinfo/qftest-list

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