Community
Participate
Working Groups
Since version 4.20 the FileDialog(shell, SWT.SAVE) doesn't add an extension to a file name displayed in the dialog. This problem occurs only if the set file name does not have an extension. Till version 4.19 the extension of the chosen filter index has been added automatically. static final String[] SAVE_FILTER_EXTENSIONS = new String[] { "*.bmp", "*.gif", "*.ico", "*.jpg", "*.png", "*.tif" }; static final String[] SAVE_FILTER_NAMES = new String[] { "BMP (*.bmp)", "GIF (*.gif)", "ICO (*.ico)", "JPEG (*.jpg)", "PNG (*.png)", "TIFF (*.tif)" }; FileDialog fileChooser = new FileDialog(shell, SWT.SAVE); fileChooser.setFilterExtensions(SAVE_FILTER_EXTENSIONS); fileChooser.setFilterNames(SAVE_FILTER_NAMES ); fileChooser.setFileName("testName"); fileChooser.setFilterIndex(0); String fileName = fileChooser.open();
The problem occurs at many places all over our RCP based product after an update to 4.20. Users who change the proposed filename in the FileDialog and do not include the extension within the filename will have a file without extension even if a unique filter extension was selected inside the save dialog. In previous versions the file extension was also part of the returned filepath of the FileDialog class. Should we handle/fix this changed behaviour on our side or is this change an unwanted side effect from Bug 571571 and will be fixed in the next version?
(In reply to Dominik G. from comment #1) > Should we handle/fix this changed behaviour on our side or is this change an > unwanted side effect from Bug 571571 and will be fixed in the next version? Please ask same question on bug 571571.
This is a bug, I'll upload a fix shortly. Platform is frozen for M3 right now, the fix will go into 4.22 RC1.
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/187534
(In reply to Nikita Nemkin from comment #3) > This is a bug, I'll upload a fix shortly. > > Platform is frozen for M3 right now, the fix will go into 4.22 RC1. The M3 will be declared on Thursday, and change looks small enough to be "in".
(In reply to Andrey Loskutov from comment #5) > (In reply to Nikita Nemkin from comment #3) > > This is a bug, I'll upload a fix shortly. > > > > Platform is frozen for M3 right now, the fix will go into 4.22 RC1. > > The M3 will be declared on Thursday, and change looks small enough to be > "in". I can't override it. Feel free to merge the fix if you can.
(In reply to Nikita Nemkin from comment #6) > I can't override it. Feel free to merge the fix if you can. Looks like Gerrit doesn't send mails after update. I've verified the fix, thanks. Niraj: any objections to merge?
Gerrit change https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/187534 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=4ef039061f13bca1bf804d7df99835bbc72a280f
Thanks Nikita & Niraj!
@Phil: Could you please verify the fix with latest Eclipse I-Build: https://download.eclipse.org/eclipse/downloads/drops4/I20211110-1800 ? Thanks!
(In reply to Niraj Modi from comment #10) > @Phil: Could you please verify the fix with latest Eclipse I-Build: > https://download.eclipse.org/eclipse/downloads/drops4/I20211110-1800 ? > Thanks! Please ignore above.