<AWT Dev> A patch so multiple selected files can have different directories.

Matthew Smith melkor at orangepalantir.org
Mon Jan 23 12:50:22 PST 2012


     This patch is intended to address the issue of newer versions of 
gtk where the file dialog lets you select files w/out selecting a 
directory via Search or Recently Used. When this happens the 'current 
directory' is returned as null, and the Files selected will be returned 
with the current working directory appended to the path.

     The .java file will show the incorrect behavior if you run it and 
use Recently Used to select a file (gnome 3).

     This patch does not change the behavior when a directory is 
selected, or when the dialog is canceled. If you select a file from the 
Recently Used option the directory will be set to the root directory, 
and the filename will be the complete path and filename. When multiple 
files are selected from a folder the original behavior occurs. If 
multiple files are selected from Recently Used then the directory is 
again set to root, and all of the fiIes have the complete name.

     This work around can be verified with the .java file provided.

     Finally this is an updated version of the patch, originally I used 
'bool' instead of a 'gboolean' I did compile it and test that it works.

     Thank you
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestFileChooser.java
Type: text/x-java
Size: 547 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20120123/3d5382ab/TestFileChooser.java 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.txt
Url: http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20120123/3d5382ab/patch.txt 

More information about the awt-dev mailing list