Yeah, here it is:

http://svn.apache.org/repos/asf/pivot/branches/1.5.x/tutorials/src/org/apache/pivot/tutorials/filebrowsing/FileBrowsing.java

See the following lines:

    if (fileBrowserSheetMode == FileBrowserSheet.Mode.SAVE_AS) {
        fileBrowserSheet.setSelectedFile(new 
File(fileBrowserSheet.getRootDirectory(), "New File"));
    }

That example just uses the current root directory rather than changing it, but 
the result is the same.

G

On Jun 18, 2010, at 4:17 PM, Greg Brown wrote:

>> Do you have any ballpark guess on when 2.0 will be released?
> 
> I'd guess somewhere in the 6-9 month timeframe, but it is really too early to 
> say at this point.
> 
>> Also I remember reading a forum or defect somewhere about being able to set
>> a default file name for the FileBrowserSheet when it loads.  1.4 did not
>> support that but I thought 1.5 would.  I can't seem to find that thread but
>> was wondering if you recall if that was incorporated?  I left in the
>> following code and thought when I upgraded to 1.5 it would work, but doesn't
>> seem to.
>> 
>> fileBrowserSheet.setSelectedFile(new File("somefile.txt"));
>> fileBrowserSheet.open(window, new SheetCloseListener() {...});
> 
> 
> I don't think relative files will work. The selected file has to be a valid 
> path on the file system. You may also need to call 
> fileBrowserSheet.setRootDirectory() to navigate to the right folder:
> 
> File rootDirectory = new File("/tmp/foo");
> fileBrowserSheet.setRootDirectory(rootDirectory);
> fileBrowserSheet.setSelectedFile(new File(rootDirectory, "somefile.txt"));
> 
> I didn't test this example though, so let me know if it doesn't work.
> 
> G
> 

Reply via email to