Community
Participate
Working Groups
The newest version of the SWT FileDialog with SWT.OPEN under Windows does not allow entering a nonexisting file name any longer. We use this to allow creation of a new file when using File -> Open. I suspect this happened with the changes in bug #571571. ***** The following snippet can be used to reproduce this behavior: ***** package org.eclipse.swt.snippets; import org.eclipse.swt.*; import org.eclipse.swt.widgets.*; public class FileOpenSnippet { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setText("Snippet 72"); shell.open(); FileDialog dialog = new FileDialog(shell, SWT.OPEN); dialog.setFileName("non_existing_file"); System.out.println("Selected file: " + dialog.open()); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } } ***** Expected behavior: ***** The user should be able to select "Open" when a file name for a non existing file was entered **** Observed behavior: **** When trying to open a nonexisting file, a DialogBox appears that tells me that the file could not be found. I can reproduce the old behavior with the swt classes from https://archive.eclipse.org/eclipse/downloads/drops4/R-4.9-201809060745/swt-4.9-win32-win32-x86_64.zip I can reproduce the changed behavior with the newest build https://download.eclipse.org/eclipse/downloads/drops4/I20211212-1800/swt-I20211212-1800-win32-win32-x86_64.zip
Nikita, could you please check if this a system dialog limitation or SWT bug?
(In reply to Andrey Loskutov from comment #1) > Nikita, could you please check if this a system dialog limitation or SWT bug? Hi Nikita, Did you got a chance to look into this ?
(In reply to Niraj Modi from comment #2) > (In reply to Andrey Loskutov from comment #1) > > Nikita, could you please check if this a system dialog limitation or SWT bug? > > Hi Nikita, > Did you got a chance to look into this ? Yes, I think the problem is that FOS_FILEMUSTEXIST is enabled by default for COM FileOpenDialog. I'll prepare a patch.
Ping! M3 is next week
Please re-target as required.