How can I filter out the "My Computer"-option in a SWT DirectoryDialog?
Posted
by Superfisi
on Stack Overflow
See other posts from Stack Overflow
or by Superfisi
Published on 2010-05-26T15:27:01Z
Indexed on
2010/05/27
11:31 UTC
Read the original article
Hit count: 143
Hello *,
in our Eclipse RCP application running on Windows XP we use a DirectoryDialog, in which the user should... ahmm... choose a directory! :D
The problem is: If the user selects the "My Computer"-option (in German Windows "Arbeitsplatz") the Dialog returns null.
The DirectoryDialog provides a method setFilterPath(String path) in which I put the File.pathSeparatorChar (to remain OS-independant).
My suggestion was that if there has to be a file separator in the directory the "My Computer"-option would be ignored cause it is null - for example the "OK"-button would be greyed out or sth. like that... but it is also valid to klick "OK".
Any suggestions from your side? :D
Thanks in advance!
Alex
© Stack Overflow or respective owner