Anyone know how to get SWTBot to import a "File System" into an existing project?
I can use SWTBot to create a new project, but when I try to import some existing files into the project using the "File -> Import -> General -> File System". there seems to be an issue with the "tree" widget in the "Import" dialog that does not allow it to get populated with the directory contents.
I use something like the following code (many variations of it as well, but nothing seems to work.)
// At this point I have the "path" in the "From Directory" filled in, but after that point nothing I do will cause the tree item to be populated with the files in that path. I;ve tried selecting other widgets in the dialog, tabbing around, chaning the path and trying again to select other widgets or tab, but nothing seems to work.
I think this is more a design issue related to the eclipse Import wizards, than an actual SWTBot problem.
On my helios version (3.6.2 64 bits, on windows 7), The path set by typing new text in the 'From directory' combo-box in the 'File System' Import wizard page is not taken into account when the combo-box loses focus. You have to:
* Either press the 'Return/Enter' key.
* Or push the 'Browse...' button (which will pop-up the 'Import from directory').
Note that, you have a very similar behavior in the 'Import Projects' Import wizard page: text typed in the 'Select root directory' text box is not taken into account until press the 'Return/Enter' key or push the 'Browse...' button right next to it. The slight difference being that if you push the 'Browse...' button and the path is correct and projects are found in the directory, then the 'Browse for Folder dialog' will not pop-up .
Hope this helps,
IBM ODM Decision Server Rules - Software Developer
IBM Software - France Lab
Can you provide some example code? I've tried both your suggestions and it doesn't work for me.
doing an "Return/Enter" does nothing, and clicking on the "Browse" button opens the browse dialog, but that is a system dialog and SWTBot can't do anything with it, so SWTBot just sits there doing nothing.