[oXygen-user] How to turn of file filtering when using workspace.chooseFile method?

Radu Coravu
Fri Jun 24 05:02:53 CDT 2011


Hi Michael,

The "*" file extension does not seem to properly work on Windows if the 
file chooser used in Oxygen is the swing JFileChooser.

By default on Windows Oxygen shows a native file chooser (which properly 
supports the wildcard) but there are situations in which the native file 
chooser has crashed in a previous session and Oxygen shows a swing 
JFileChooser instead (this was also my case when I reported the problem 
with your plugin). The JFileChooser is also shown on Linux.

So my advice to you would be to specify specific extensions like "xml", 
"dita", etc... which are properly supported.

What we can do on our side would be to properly support the wildcard 
file filter also in the JFileChooser.
We can also allow you to set a NULL "allowedExtensions" array to the 
method if you want the file chooser to show the "All files" by default.

Regards,
Radu

Radu Coravu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 6/24/2011 12:18 PM, Michael Anthony Smith wrote:
> I have been developing an oXygen plugin and am using oXygen's 'workspace.chooseFile' filter to provide the functionality for locating a file on disk.
> The aim is to have no filtering at all, so the user can see all the files in a directory. However, I have yet to workout the correct list of filter extensions to achieve this result on all operating systems (e.g. Windows 2008 R2, Windows 7, and Mac OS X.6).
>
> The current plugin is issuing the following command is:
>
> workspace.chooseFile("Choose file", new String[]{"*", "*.*"}, "Any file", ioArg == IOArg.OUTPUT);
>
> Therefore, the current filters are "*" and "*.*".
>
> Any suggestions appreciated.
> Anthony.
>




More information about the oXygen-user mailing list