X

Geertjan's Blog

  • July 4, 2011

Progress Bar and Node Hierarchy?

Geertjan Wielenga
Product Manager

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.

Join the discussion

Comments ( 4 )
  • guest Monday, July 4, 2011

    Hey Geertjan !!!

    In your profile picture looks like

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


  • guest Monday, July 4, 2011

    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?


  • Jesse Glick Tuesday, July 5, 2011

    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.


  • Geertjan Tuesday, July 5, 2011

    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.


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.