[ 
https://issues.apache.org/jira/browse/PIVOT-878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13476224#comment-13476224
 ] 

Ronald Thomas commented on PIVOT-878:
-------------------------------------

Another option might be to defer loading the file roots until the first time 
the "driveListButton" is expanded.  However, I'm not familiar enough with the 
event model to know if there is an opportunity to fill-in or replace the 
listData when the drop-down arrow on a ListButton is first clicked, but before 
the list actually expands and appears.  That "just in time" list item 
population strategy seems to be how most native windows apps have addressed the 
same issue.  In other words, it appears that in the native windows file browser 
dialogs, at least the ones which are similar to FileBrowserSheet, only the 
file-root (drive) for the current context directory is initially populated in 
the "Look in:" dropdown (ListButton).  

Note: More recent native windows apps just display a special case of 
WindowsExplorer with Open, and Cancel buttons, but it is understood that it 
wouldn't be practical or even desirable to go back to the AWT strategy of 
implementing wrappers for each platform's native components (like a file 
browser dialog) in a cross-platform Java2D-based UI framework like Pivot.

@Sandro Martini - Do you happen to know if there is a duplication of this 
particular issue in a Jira issue assigned to v2.1?  If not, this could be 
reassigned so that it is addressed along with the "related improvements" you 
mentioned.
                
> Show FileBrowserSheet while Initializing
> ----------------------------------------
>
>                 Key: PIVOT-878
>                 URL: https://issues.apache.org/jira/browse/PIVOT-878
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk-terra
>    Affects Versions: 2.0.2
>         Environment: All (Mostly Windows)
>            Reporter: Ronald Thomas
>            Assignee: Roger Whitcomb
>            Priority: Minor
>              Labels: Browsing, File, FileBrowserSheet, performance, 
> responsiveness, wtk, wtk-terra
>             Fix For: 2.1
>
>
> If the list of file roots returned by 
> http://docs.oracle.com/javase/1.4.2/docs/api/java/io/File.html#listRoots() 
> includes more than a few network drives (primarily on windows where each 
> mapped drive is its own "file system root"), or if the initial path on the 
> FileBrowserSheet maps to a device that takes a while to "spin up", the 
> FileBrowserSheet may not appear on the screen for several seconds making the 
> Pivot app appear unresponsive.  It would help if there were some indication 
> of activity immediately after the call to the FileBrowserSheet.open() method. 
>  The FileBrowserSheet could be displayed in a "loading" mode and then 
> switched to its normal display mode once the potentially long-running 
> initialization has completed.
> In this case, the long running code is around line 936-947 of the 2.0.2 
> release source file at 
> wtk-terra\src\org\apache\pivot\wtk\skin\terra\TerraFileBrowserSkin.java
> Steps to reproduce:
> # Create a Pivot application that opens a FileBrowserSheet using a button.
> # Map about 6 network drives or connect external hard drives to drive letters 
> on a machine running windows
> # Wait enough time for the power-management "spin down" on some or all of the 
> mapped or connected drives
> # Run the Pivot application and click the button that opens the 
> FileBrowserSheet
> # *Nothing appears to be happening for several seconds* (far too long) while 
> the JVM collects the results of File.listRoots() to populate the 
> "driveListButton" listData.
> # Finally after several seconds, the FileBrowserSheet appears.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to