[ https://issues.apache.org/jira/browse/PIVOT-862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13417235#comment-13417235 ]
Sandro Martini commented on PIVOT-862: -------------------------------------- Ok, after some tests I found what is the problem here: FileBrowserSheet has three constructors, and the no-argument and the one argument, both calls the two argument version and at the ane of it, it's called the install of the related skin class (which is by default, TerraFileBrowserSheetSkin), and then in its install method, is put a reference to the WTK Component and do some setup. The problem is that install can't be called more than one time, and even other approaches like calling setRootFolder or force an rootDirectoryChanged event doesn't solve completely the problem (due to the current implementation, but that most of times works). I think to refactor a small block of code in a new method: public void setRootFolder(String rootFolder) because this could be useful the same, even later. So, to avoid strange (and too much complex) solutions I'd say to write in FileBrowserSheet constructors some comments that explain when to use any version of it, and close this as resolved. Is it Ok the same (I think yes because there is a workaround) ? Tell me. > FileBrowser[Sheet] display the contents of the root instead of actual folder > in some circumstancies > --------------------------------------------------------------------------------------------------- > > Key: PIVOT-862 > URL: https://issues.apache.org/jira/browse/PIVOT-862 > Project: Pivot > Issue Type: Bug > Affects Versions: 2.0.2 > Environment: Windows XP, java 6 > Reporter: Guillaume Deshors > Assignee: Sandro Martini > Priority: Minor > Fix For: 2.0.3 > > Attachments: bug-862.png > > > When you open a fresh FileBrowser or FileBrowserSheet, with a no-argument > constructor, and then you set the root directory to a directory under another > drive than C:, say "T:\FOLDER" for example, then when you open it it seems to > be located at the right place (from the above bar) but the actual displayed > files are those at the root of the drive. See screen capture for better > comprehension. > Seems to appear when : > * the root folder is not specified in the constructor > * the root folder is not under C: (reproduced with network drives and USB > keys, couldn't try with another partition or internal drive as I don't have > one here) > Steps to reproduce : > 1/ map T: to a network drive or plug in a USB key > 2/ create the following structure : T:\FOLDER\SUBFOLDER > 3/ run the following code : > Window window = new Window(); > window.open(display); > window.setMaximized(true); > FileBrowserSheet fileBrowserSheetFile = new > FileBrowserSheet(Mode.OPEN); > // The folder structure is T:\FOLDER\SUBFOLDER > fileBrowserSheetFile.setRootDirectory(new File("T:\\FOLDER\\")); > fileBrowserSheetFile.open(window); > // Bug : it actually opens on FOLDER but displayed is the > content of T: root > Expected : I want to see my "SUBFOLDER" but I actually see "FOLDER". > Remark : If I want to set the root to a more deeply nested folder, like > d:\f1\f2\f3, I still see the content of d: > Workaround : use the constructor with the root folder in it, like : > FileBrowserSheet fileBrowserSheetFile = new FileBrowserSheet(Mode.OPEN, > "T:\\FOLDER"); -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira