71 .getFileDialogAccessor(); |
71 .getFileDialogAccessor(); |
72 |
72 |
73 if (filenames == null) { |
73 if (filenames == null) { |
74 accessor.setDirectory(fd, null); |
74 accessor.setDirectory(fd, null); |
75 accessor.setFile(fd, null); |
75 accessor.setFile(fd, null); |
76 accessor.setFiles(fd, null, null); |
76 accessor.setFiles(fd, null); |
77 } else { |
77 } else { |
78 // Fix 6987233: add the trailing slash if it's absent |
78 // Fix 6987233: add the trailing slash if it's absent |
79 String with_separator = directory; |
79 String with_separator = directory; |
80 if (directory != null) { |
80 if (directory != null) { |
81 with_separator = directory.endsWith(File.separator) ? |
81 with_separator = directory.endsWith(File.separator) ? |
82 directory : (directory + File.separator); |
82 directory : (directory + File.separator); |
83 } |
83 } |
84 accessor.setDirectory(fd, with_separator); |
84 accessor.setDirectory(fd, with_separator); |
85 accessor.setFile(fd, filenames[0]); |
85 accessor.setFile(fd, filenames[0]); |
86 accessor.setFiles(fd, directory, filenames); |
86 |
|
87 int filesNumber = (filenames != null) ? filenames.length : 0; |
|
88 File[] files = new File[filesNumber]; |
|
89 for (int i = 0; i < filesNumber; i++) { |
|
90 files[i] = new File(directory, filenames[i]); |
|
91 } |
|
92 accessor.setFiles(fd, files); |
87 } |
93 } |
88 } |
94 } |
89 |
95 |
90 /** |
96 /** |
91 * Called exclusively by the native C code. |
97 * Called exclusively by the native C code. |