The Source for Java Technology Collaboration
User: Password:



Tim Boudreau

Tim Boudreau's Blog

NetBeans tweaks you've probably never heard of

Posted by timboudreau on August 08, 2005 at 02:11 PM | Comments (11)

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. nb.exe -J-Dnb.tabnames.html=true
  • 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.no.related.items=false plus 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...


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • over past year all u write about is netbeans. do different something

    Posted by: ibendover4netbeans on August 08, 2005 at 09:06 PM


  • It is a nice article, some nice "hacks".


    But somehow i think i would be happier if you fixed some of the UI problems i know they are low priority but still they annoy me.

    Posted by: danielmd on August 09, 2005 at 09:04 AM

  • In NB 41 the navigator-settings don't work. Is it just 42 that we can use this?

    Iwan

    Posted by: ieising on August 09, 2005 at 01:40 PM

  • somehow i think i would be happier if you fixed some of the UI problems i know they are low priority but still they annoy me

    UI problems are not low priority at all - in fact, they're very high priority. But without specifics, I can't help you. The best possible way to make sure that happens is to file bugs. I can't emphasize how important that is - a bug report goes into a database, and the developer(s) that deal with that area of the code have to pay attention. We don't do a release until every bug that has been filed has been read and commented on. Mailing lists and forums like blogs are great, but the only place that will always get you a response (maybe not that day, but before the next release) and possibly a fix is to file a bug.

    In NB 41 the navigator-settings don't work. Is it just 42 that we can use this? Iwan - some of the settings were introduced in 4.2. I'll double check it for 4.1 - I've got a checkout of that branch at home.

    over past year all u write about is netbeans. do different something.

    Boy, you can't please everybody, can you. If you're being held hostage and forced to read my blog at gunpoint by militant aardvarks, reload this page three times inside one minute and we'll get the message and send a SWAT team to rescue you.

    If not, well, we both know how to solve that problem.

    Posted by: timboudreau on August 09, 2005 at 08:11 PM


  • Oh I have filed bugs and RFEs but the Ui bugs that i am talking about have to do with strange behavior not functionality so they get very low priority.

    I must say that NB does have a great response time to RFEs and Bugs.

    Like having a sliding projects window and the context menus get a resize icon wend you are in the margin of the window. Another of my favorites, is wend you Right click on the new projects dialog, and then walk around the IDE and the icons menus, etc.. Get focus even though they should not.

    Stuff like that makes me crazy, but it does not mess with functionality.

    Posted by: danielmd on August 09, 2005 at 09:41 PM

  • The following stuff is in Eclipse which I really like and want in Netbeans 4.2:
    - will there be highlighting for class field access (i.e. more options in syntax highlighting)?
    - will there be warnings for unused stuff (imports, local variables, private methods, etc.)?
    - easier and less buggy CVS client support?

    Posted by: pholthuizen on August 12, 2005 at 10:08 PM

  • A total rewrite of CVS support which is much easier to use was just made the default in trunk builds - try a dev build from NetBeans.org - we need testers.

    Highlighting of accesses of class fields is coming; the navigator tweak above might serve in the mean time (showing all methods that access whatever the caret is on).

    Warnings for unused stuff I believe you can get right now with the PMD module/tasklist integration. I don't think we've got annotations in the sources yet, but that will probably be in the release after 4.2.

    Important: I'm happy to discuss feature requests for NetBeans, but the right place to do that is in Issuezilla on netbeans.org.

    Posted by: timboudreau on August 13, 2005 at 12:21 AM

  • Tim, thanks for your response. Yes you are right about the place to make RFE's.
    I've downloaded the dev version of Netbeans and I'm gonna give it a swing!

    From your post I believe that warnings for unused stuff is not really to be integrated. I'm gonna find me an issue in Issuezilaa on that. Your PMD suggestion is not really my cup of tea as it is not really nice integrated in my Netbeans experience (another menu option to use)...

    By the way, now that you've mentioned PMD I'm gonna search for an RFE about FindBugs too as I think it should also be an available Netbeans plug-in....

    My wish on these things is: hit F9... -> compile the stuff , issue warnings (e.g. PMD and FindBugs).... and ready...

    Posted by: pholthuizen on August 13, 2005 at 04:25 AM

  • My wish on these things is: hit F9... -> compile the stuff , issue warnings (e.g. PMD and FindBugs).... and ready...

    Hmm...that gave me a really interesting idea about providing the ability for another module to conditionally hook Save or F9 to do something like invoke one of these tools and bring up the tasklist if it finds anything.

    Posted by: timboudreau on August 13, 2005 at 10:01 AM

  • Tim, sorry to hijack this blog (but since both are on NB, I doubt its a problem). Can you keep taps on the license promise you made in your last blog, nothing has changed in the last two and a halve weeks.

    Posted by: zander on August 14, 2005 at 09:49 AM

  • FYI, all of the Navigator line switches now work in trunk builds again - details in my latest blog - international flights are great for bug fixing.

    Posted by: timboudreau on September 12, 2005 at 09:37 AM





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds