• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

How do I convert this Orcale's example into complete separate class

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all
So I was looking at this example showing how to lazy load TreeView.
Just to save a click, this is the code:



I am working on trying to convert this code to a separate complete class in itself. Something like:



This should create a treeview with filesystem structure.

So far my attempt is this (incomplete):




I am stuck (at the comment in my code). In original code, the method basically calls itself for every new file. But I can't do that with class, cant call that class within the same class.

So it would help if someone could atleast guide me a little on how to go about here.
 
Ranch Hand
Posts: 270
15
Android Angular Framework Spring AngularJS Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, this being a week later, you may not still be stuck. If so, here goes. Disclaimer: I have not used TreeView.

You write, "I am stuck (at the comment in my code). In original code, the method basically calls itself for every new file. But I can't do that with class, cant call that class within the same class."

I am thinking you could just, instead of making "TreeItem" objects, there, make FSTreeItem objects.



If you were to do that, then whenever one of those FSTreeItem children is seen (resulting from the call to "getChildren()" by client code), it will in turn have its "getChildren()" method. When called, it will lazily go out and 'look at' the filesystem to get those children.

Sorry if I have misunderstood what you were trying to do.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic