Reputation: 4103
In Windows there are (at least) two kind of dialogs to select something on the file system.
We have the tree dialog that is sometimes used to select a folder:
DirectoryDialog directoryDialog = new DirectoryDialog(shell);
System.out.println("directory=" + directoryDialog.open());
And then there is the "normal" dialog which shows the contents of a folder:
FileDialog fileDialog = new FileDialog(shell);
System.out.println("file=" + fileDialog.open());
I want to let the user select a folder that contains a couple of specific files. Everybody who was ever forced to use the directory tree dialog for something like that knows how tricky is to blindly poke around the file system until you find the directory you were looking for.
So I'd like to use the FileDialog
to open directories... or the DirectoryDialog
with a different look. Is there any way to achieve this in SWT?
Upvotes: 0
Views: 153
Reputation: 20985
The SWT FileDialog
and DirectoryDialog
cannot be customized. Furthermore, both dialogs are platform dependant and look/behave differently among platforms.
The FileDialog
gives better insight into what contents a directory has. If there is a single file that is always present in a selectable directory, you could have the user select this file - if that makes sense in the context of your application.
Otherwise, you probably need to implement a custom directory selection dialog.
Upvotes: 2