Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Code Folding

800349Jul 25 2009 — edited Jul 27 2009
Could someone explain to me please the best techniques for code folding?
I know what it is obviously, and what it does, however I'm trying to write my own program using code folding and hitting a big problem with it.

I have found the Bounce XMLEditorKit which is great but the code folding doesn't work (at least I can't get it to work) so that doesn't help.
I can use the netbeans platform but I'd firstly rather have an entirely custom written app, plus I don't really like the creation process. (Don't understand it fully as well)

So how do I go about it myself?


I know I need to determine fold points (thinking syntax based as it will be XML documents)
Where I get confused is how to keep track. Once I've determined where a fold starts and ends, say I minimize the code replacing it with a ... and put the replaced code in a variable. This is fine, but if code is then added to the program before this fold line, how do I keep track of where it now is, so I know where to open the fold?

Basically, could someone give me the entire logic behind code folding? Or an easy to implement ready made solution


Thanks
Adrian
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 24 2009
Added on Jul 25 2009
19 comments
235 views