Skip to main content

A few new NetBeans modules - VNC, Breadcrumbs, License Header Changer, a better Java Navigator and more

Posted by timboudreau on April 26, 2009 at 11:21 PM PDT

I just uploaded a bunch of modules I've been working on to the NetBeans Plugin Portal, and put their source code into NetBeans source repository. I'll also get them available in the daily build update center soon.

Statue at the Grand Temple in Bangkok
Some of them are things I've had lying around for a while, some are new:

  • VNC Client for NetBeans—This is a module that integrates the TightVNC Java VNC client (with much patching, which I have contributed back) into NetBeans, so that you can connect to a remote desktop inside NetBeans. Note you also need the TightVNC Library Module to install it.
  • Breadcrumb—This was actually written in about 20 minutes at a trade show in Manila - a colleague said he wished we had a breadcrumb of recently visited files. So now we do. You can see it in the bottom right of the screen shot below.
  • Color Chooser Component—This is a library that installs my single-mouse-gesture Color Chooser Java Bean into the component palette for use in Matisse. Jeremy Wood recently contributed a gorgeous color-wheel based component to the project which is also included. (web start demo here)
  • Get A Tan—A module that turns the whole NetBeans UI sort of tan, and installs a similar editor theme. Probably a love it or hate it kind of thing, but if you don't like black-on-white UI's it might be for you.
  • License Changer—This is a module which adds an action to any folder, Change License Headers. You supply a new header, and it will let you pick directories to exclude, give you a preview of what files it will change and let you exclude them, then it will mow through XML, Java and Properties files and replace or add license headers
  • Annoyance Whacker—I'll probably catch some flack from colleagues for this one - it turns off all the popups (update checking, metrics submission, welcome screen, etc.) that show up when you start NetBeans, and on non-macintosh platforms, moves the status bar to the top of the window next to the menu to save screen real estate.
  • Java List Navigator—This is a list (as opposed to Tree) Navigator view for Java files which features single click navigation, and lets you move methods and fields to different locations in your source file by dragging the method name, among other things. Note you also need the List Diffs library to use it.

It's funny the reasons some of these were created.

For example, the TightVNC module exists because I'm a musician. A small problem with home digital recording is that if you spend a bunch of money on Neumann microphones and super-quiet sound cards, it doesn't do much good if you're recording in a room with a computer with fans whirring and buzzing. Solution: Get some long mic cables, and remotely control the recording software on your desktop machine from a nice, quiet laptop in another room. The only problem was I couldn't find a decent free VNC client for my MacBook, so I could start and stop recording remotely. So, I tried the TightVNC client, found the UI atrocious, set about detangling the protocol handling code from the UI code, and ended up with a NetBeans module. Scratch your itch, as they say...

The Get A Tan module was created to solve some pain: The backlighting finally went on my 7 year old desktop monitor that travelled with me from Prague to California to Massachusetts. So I went out and bought this lovely 23" Samsung monitor. Which is great, but if you calibrate it so that photos are accurate, it's like staring at a lightbulb all day. Solution: Tweak the look and feel to get rid of all of the white. My eyes feel better already! (Screen shot below)

The License Changer module came into being because I got handed a huge codebase to work on, Java Card support for NetBeans a few months back, to get it production-worthy. I needed to add license headers to hundreds of source files. I asked friends who had needed to do this sort of thing in the past, and everyone had some one-off script they wrote and couldn't find anymore. So I figured this was a problem that should be solved once and for all. It has an API for plugging in handlers for additional file types - currently it supports Java, XML and Properties files (with tons of unit tests for every pathological case I could imagine to make sure it wouldn't turn files into garbage). Contributions are most welcome.

The Java List Navigator module has been sitting in contrib/ for about a year. When I wrote the original Navigator component for NetBeans 4.1, it was intended as a fast way of navigating through source files - single click navigation, use a list rather than a tree to avoid horizontal scrolling, and it could abbreviate class member names to keep them visible (even doing weird tricks with removing vowels). The Navigator actually started as an example for NetBeans: The Definitive Guide, and I found I couldn't live without it.

Alas, in 6.0 it fell victim to the Every other IDE uses a tree for this, therefore we have to use a tree too mentality (on my list with But that's the way we've always done it! of thought patterns that ought to be firing offenses...). So this is a Navigator that works the way it was intended to work - as a tool for quickly navigating a source file with a single click or a few keystrokes (it's on the right in the screen shot below).

The Annoyance Whacker module is something I'd encourage regular users of NetBeans not to use - it turns off features that help us know how many people are using NetBeans and what features we should concentrate on (if you choose to tell us - no personal data, just statistics). But if you develop NetBeans modules for a living, A. you're probably not a typical user - my usage patterns would only skew the metrics, and B., you probably start NetBeans 50-100 times a day, and popups on every startup get really annoying. So this module gets rid of a few mouse or keyboard gestures every time I start NetBeans.





A lovely (to me anyway) tan theme

(click the image for the full size version)

Related Topics >>

Comments

@steven: > I was having problems with my porting of an app to Netbeans, particularly with the custom theme of mine Don't know if this will help that much - it basically brutally mows through all the keys and values in UIManager and replaces anything resembling white, gray or black. I tested it with Windows & Metal; for GTK or any synth-based l&f that uses native painting, it will probably just make things very ugly.

tboudreau at sun

Thanks Tim, I'll shoot you an email. What is your preferred email address? BTW, here is where I was trying to get the refactored sources http://sourceforge.net/tracker/index.php?func=detail&aid=2307956&group_i... Chris

Addendum: The reason the module sources can't go in contrib/ on hg.netbeans.org is that the lawyers won't allow any sources there that are license-incompatible with the rest of NetBeans (yes these are the same lawyers with whom that is fine on java.net and kenai.com, and no this makes no sense, but it's also not a battle worth fighting). TightVNC is plain GPL therefore so is the module that integrates it (NB is GPL + classpath extension and/or CDDL).

SourceForge? Actually the VNC module sources aren't available in one piece anywhere yet. I didn't want to host a fork of TightVNC if it was avoidable (just on the general principle of not forking something unless you have to), I was hoping to get the patches accepted (see http://www.nabble.com/Hacking-the-Java-TightVNC-client-td20454903.html - the changes are attached to a bug report referenced in that thread) - but at the same time, they were pretty extensive - the UI and protocol handling were really completely tied together (you don't really want to instantiate an Applet to show a VNC ui in a random JComponent) and it took several days of careful refactoring to tease them apart. Alas, I haven't had the time to help with integrating them, and I'm not sure it will happen if I don't. I suppose it would be easy enough to set up a new project on Kenai or somewhere with the sources and the module sources (the module sources are pretty trivial - adds a VNC node to the Services tab and provides a UI for configuring and persisting server settings). In the meantime, if you want to contact me by email, I'd be happy to send you a copy.

Hi Tim, thanks for the great stuff in the blog. Just added it to my RSS feeds. I'm interested in the VNC client for Netbeans but the source zip file seems to be corrupted on SourceForge. Is there somewhere else I can find it? Thanks

Thanks! Got the project cloned here now. I was having problems with my porting of an app to Netbeans, particularly with the custom theme of mine, and this will be very helpful to review. Thanks again! steven

BTW, you want contrib/tanui

http://hg.netbeans.org/main/contrib/

Hi Tim, Thanks for sharing these! Regarding the source, I browsed the netbeans Hg repository but wasn't sure where exactly to find the source. I'm particularly interested in the "Get a Tan" module. Could you point me to where I should be looking? Thanks! steven

VNC Sources FYI, perhaps years after the fact, but the ...

VNC Sources
FYI, perhaps years after the fact, but the sources to the VNC client *with* the patched TightVNC sources are finally available: http://timboudreau.com/blog/read/The_VNC_Client_for_NetBeans_Lives_On