Skip to main content

NetBeans Editor Folding with style

Posted by emilian on September 2, 2008 at 6:06 AM PDT

The folding GUI is an often neglected part of the IDE. It allows you to focus on the work at hand by hiding the unneeded parts of the code. What it didn't have so far in the NetBeans IDE was... style.

Actually style and an extra feature: the ability to close a fold by clicking at the end of it not just at the beginning. This is folding so far:

folding-normal.png

Note the familiar features:

  • tree-like GUI
  • little square you can click on to collapse or expand the fold
  • a small non-functional GUI artifact at the end of the fold (the "L")

It is clear what the folding GUI was missing:

  • The ability to change the aspect of the fold. I mean here line-style, color, etc.
  • The ability to collapse the fold using the "L" artifact at the end of the fold. No point in scrolling to the beginning of the fold when you have it right in front of you and you want it closed.

Introducing a new patch submitted to NetBeans and the GUI for a demo fold type:

It's a showcase of the new feature to use the end of the fold as a collapse-trigger as well as the fact that the aspect of the fold doesn't have to be strict.

The current patch provides a fold-style per mime type. So you can use whichever style fits your work depending on the file type.

Thus, you get to use the extensibility power of NetBeans Module System for a new, or just the same-old, fold style.

Related Topics >>

Comments

ops.. typo rally -> really

Hey Emi, this is rally cool and I have voted on issue ;-)