Posted by timboudreau
on August 8, 2005 at 2:11 PM PDT
In its rich history, NetBeans has grown various command-line options that affect how some things work or look. I thought I'd share some useful ones...
In its rich history, NetBeans has grown various command-line options that affect how some things work or look. Some are for screen-real-estate freaks who want to minimize the size of everything but the editor; some turn on features that are off by default for one reason or another.
Just for fun, the other day I patched Boolean.getBoolean() to find out just what was actually still in use (now, how many people do that for fun?). As with anything undocumented and unsupported, caveat emptor - nothing is guaranteed to work or keep working in the future. But here are some useful ones. First, how to use them:
- Try it out - run NetBeans with -J-D and the argument on the command line, i.e.
- If you like it, add it to your
netbeans.conf - you can find netbeans.conf in the
etc/ subdirectory of your install (make a backup, and if you have changes you like, keep a copy somewhere else to reuse if you install a new version)
Here we go. Unless otherwise noted, all of these are boolean, and most are defaulted to false - so you want to specify
-J-Dsome.flag=true to use them.
Settings for Screen Real Estate Fanatics
nb.tabnames.html - Instead of displaying a * beside the name of a modified file, and "[read-only]", on editor tabs, use bold for modified and italic for read-only.
netbeans.winsys.statusLine.in.menuBar - Instead of having a statusbar at the bottom of the screen, make it part of the menu bar (won't work on Mac OS in current 4.2 builds, since they now use the screen menu bar)
netbeans.small.main.window - This did a lot on the 3.5 windowing system; something is still checking it, but I didn't find out what. Related to statusline-in-menubar, for making size smaller
nb.cellrenderer.fixedheight - This is an integer in pixels, i.e.
-J-Dnb.cellrenderer.fixedheight=12 - Set a fixed height for cells in all tree/list/table views. You can make the more cluttered this way (less space between items), which, if you want to fit the maximum info on screen possible, is desirable.
Settings that affect the Navigator component
Some of these are features that I wrote into the original navigator module which are disabled either for performance or aesthetic reasons. The highlighting stuff
nb.navigator.singleclick - In list views, such as the class members view, clicking once on a method/field/etc. name will scroll the editor there (ala IDEA)
navigator.string.abbrevs - Shorten names of methods that won't fit, rather than use a horizontal scrollbar. It selectively omits characters using a weighting algorithm - the results are readable for the same reason we know what all those ads for Genric Vigara are talking about.
nb.navigator.decorate - This one will cause some performance issues - once they're solved, it will probably be on by default. Boldface any methods that override methods in the parent class, italicize final methods, show native methods in blue, deprecated methods with strikethrough
nb.navigator.relatedItems=true - (both of them) - Poor man's Find Usages - Whenever you put the caret in the editor inside a method or field definition/body, Navigator will highlight all of the methods in that same class which call the method/use the field where the caret is. This seems not to be working in today's build, but should work in 4.1.
And, one switch you definitely won't want to use in daily, but which is briefly amusing:
nb.tabcontrol.fx.gratuitous - causes switching tabs to do all sorts of funky transparency/scaling/sliding stuff to make the new tab come up. It is, as the line switch says, gratuitous - and more importantly, whether and how it works, and if it's slow or performs well depends way too much on the vagaries of the operating system, the graphics card driver, etc. for it ever to be useful in production. But it's cute.
Remember, caveat emptor. Enjoy...