Code Folding in Java

Hi Experts;Do you know anyway to do a code folding in a text component like JTextPane, I've seen Neatbeans, IntelliJ & JBuilder implement it but I dont know how ?Is there any solution, free class or codes to it, thanks.Hope to hear from you all.
[285 byte] By [J_Flasha] at [2007-9-30 2:25:59]
# 1

Well, NetBeans is open source, so you can look at the source code to see how they do it. Of course, you'll have to find the responsible class(es) first, which is no mean feat. I suggest you look at how jEdit does it; it's also open source, and its code is much easier to navigate: http://www.jedit.org/

uncle_alicea at 2007-7-16 13:35:54 > top of Java-index,Archived Forums,Swing...
# 2

> Do you know anyway to do a code folding in a text

> component like JTextPane, I've seen Neatbeans,

> IntelliJ & JBuilder implement it but I dont know how ?

>

My advice is to get 'bracket matching' done first, as this acts as the trigger for the hidden lines of code. I wrote a "SIMPLE NEWBIES IDE" last year. I had a seperate class file just for bracket-match hilighting and another for general syntax hilighting. You can utilise the logic of this eg (something like);

int line= BracketMatch.closingBrace(textArea.getCaretPosition(), textArea.getText());

Then rewrite the text to the screen with a symbol (mouseEvent triggered) on the line number bar.

The-Suea at 2007-7-16 13:35:54 > top of Java-index,Archived Forums,Swing...
# 3
Where is your Java IDE may I see it ?The reason I wanna do this is because I wanna do this is because I'm finishing my IDE the will be realese free at : http://www.freewebs.com/cube-j
J_Flasha at 2007-7-16 13:35:55 > top of Java-index,Archived Forums,Swing...