Progress Bar and Node Hierarchy?

The next handy feature I'm working on is integrating a pic browser into the Quick Browser. Of course, to create a thumbnail for each image identified in a folder is expensive and so the Slowness Detector (read all about that cool feature here) kicks into action:

And that brings me to something I've never been able to figure out: what is the correct way to integrate the Progress Bar into a ChildFactory? I.e., when the nodes are created, I'd like to show the progress bar. Does anyone know how to do so? Plenty of developers must have been exposed to this problem before, so I am very interested to know what the answer is.

Comments:

Hey Geertjan !!!

In your profile picture looks like

you are 'TURNING YOUR BACK' on Netbeans. ;-)

Posted by guest on July 04, 2011 at 04:35 AM PDT #

Just supply a common loading icon in the getIcon(int) method of your node and start a requestProcessor. When the requestProcessor finshes loading the Image, set the new Image and fire the icon change.
And then you can display that loadingbar in the statusbar till it's finished loading.
Or is there somthing I overlooked here?

Posted by guest on July 04, 2011 at 06:24 AM PDT #

Simpler still, in case computing the keys is expensive and subsumes getting icons: use an asynch ChildFactory; in createKeys, start a ProgressHandle, add keys to the list, stop the handle, and return. But the earlier comment by "guest" (override getIcon) is better in case you want to at least show all the items first, and then resolve icons lazily; it will work best if your explorer view indeed defers calling Node.getIcon unless and until a node is actually scrolled into view.

Posted by Jesse Glick on July 04, 2011 at 10:38 PM PDT #

Hi all,

Here are the sources:

http://java.net/projects/nb-api-samples/sources/api-samples/show/versions/7.0/misc/quickbrowser

Tried both approaches outlined above but failed, would appreciate help on this particular point.

Posted by Geertjan on July 04, 2011 at 11:44 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
12
13
14
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today