The Source for Java Technology Collaboration
User: Password:



Tim Boudreau's Blog

August 2006 Archives


Creating a Mini-Unconference - request for ideas

Posted by timboudreau on August 30, 2006 at 04:34 PM | Permalink | Comments (0)

For NetBeans Day Seattle, we have a new entry on the agenda: This Is Not A Conference - basically a mini-unconference in an hour. It's something new, and I'm looking for theme ideas and any other sort of brainstorming on what this should look like.

There is a lot of information on the web about "unconferences" - I'll include some links. Basically it means turning the traditional conference structure on its head - the audience is the presenters. The idea is to have a general theme and bring a topic that you care about enough to talk about with you.

So I've set up a brainstorming page in the new NetBeans Wiki. Anyone can add theme and/or topic ideas. I put a few straw-man themes up. In the spirit of unconferences, the agenda needs to be driven by those who will attend. If you will be at NetBeans Day Seattle on September 6, there must be something you care about :-) Add it to the wiki page! Mobile Bay, Theodore Alabama, Spring '06

Sign-up for NetBeans Day Seattle here. Some interesting reading on unconferences:

There will have to be some differences from what is described above, since we have an hour, not several days, and at least in Seattle, the seats are bolted to the floor :-/

Given the time limitations, it's doubly important that the agenda be set by the communities attending, but that it is fairly established ahead of time. So please help out with the brainstorming.

This is going to be interesting :-)

Continuation tooltips for JLists and JTrees

Posted by timboudreau on August 21, 2006 at 02:30 PM | Permalink | Comments (8)

A bit before NetBeans 5.0 was out, I wrote support for completion tooltips for JLists and JTrees for NetBeans' Explorer components. It's not at all NetBeans-specific - it can be used for any JList or JTree.

completionTooltips.png

What it does is relatively simple - provide tooltip-like popup(s) that are painted by the list or tree's cell renderer. If necessary it will provide two tooltips - one on the left, and another on the right.

The source code can be found here - all you do is call

ViewTooltips.register (theComponent);
where theComponent is a JList or a JTree. The code was written in expedience mode, not prettiness mode, but it has been in NetBeans since 5.0, is stable, and pretty useful, as such tooltips are rather slick and nice to have.

Writing it was a bit of an adventure - the basics were simple until I tried the code out on my Mac. There, heavyweight popups have drop shadows- exactly what you don't want around something that is supposed to look like it's part of another component.

badDropShadow.png

There are two solutions to the problem: The simple one, which works 60-70% of the time on Mac - which is just writing a custom PopupFactory which prefers lightweight popups when possible. But this doesn't entirely work, as the mac implementation will sometimes recycle a heavyweight popup. Both can be found here.

The second solution, that works 100% of the time, is the egregious hack (see the aptly named inner class, EgregiousHack with its giant wad of reflection code), which commits the no-no of requiring Apple's Cocoa-Java, digging up the native window using Cocoa via reflection and forcing it to have no shadow. This is disabled by default in NetBeans, as who knows what the fate of Cocoa Java will be, long-term, but can be turned on.

A really bare-bones platform

Posted by timboudreau on August 13, 2006 at 09:32 AM | Permalink | Comments (4)

My friend Jarda has a NetBeans-based application which uses only the NetBeans module system - i.e. you can use the NB module system to write server-side modular applications or whatever you want. It's a SourceForge project called DVB Central, which I believe he wrote for controlling his home video setup (signal comes into the computer and is routed to one of various destinations).

It's a pretty cool example of just what you can do with the NetBeans platform. The crack-cocaine of coding for NetBeans is the module system - the fact that you can have public classes that are public only within their own JAR, so you can design really clean, well-separated APIs. And it comes with a Manifesto - what's not to love about that?

We'll probably use DVBCentral as part of our workshop at OOPSLA 2006 in Portland, Oregon this October.

snail-small.png
This little fellow was crossing the sidewalk early the other morning when I interrupted him (her?) to pose for the camera


NetBeans Modules for HTML Authoring

Posted by timboudreau on August 05, 2006 at 02:08 AM | Permalink | Comments (15)

I write tutorials and articles quite a bit. NetBeans is an excellent editor for HTML, but there were a few things missing. So I wrote some modules to plug the gaps.

If you have a development build of NetBeans, you can get any of these from the development build update center off the Tools menu. They are:

  • HTML Projects - support for opening a directory of HTML files as a NetBeans project. By default it automatically recognizes directories named public_html and www as projects; with the New Project wizard you can just create a new HTML project over any other directory you have that contains HTML. The directories are simply remembered - nothing will be written into those directories disk to mark them as a project, and HTML projects have no settings - so there's no risk of adding project metadata into directories that might live on a web server.

    It provides a flattened logical view of all HTML files it finds, by HTML title. It will scan every subdirectory of the directory you choose, so you probably don't want to do this on the root of your hard drive (although it will do it in batches on a background thread, so if you really want to you can...).

    An open HTML Project in the Projects tab

  • Generic Navigator - this started as an HTML-specific Navigator panel, but it wasn't much more work to make it not specific to any particular file type. You can define named regular expressions and associate them with any file type, and the results will show up as list items in the Navigator, and you can select which regular expression to use.

    genericNavigator.png

    It has a customizer for adding and editing regular expressions, which also lets you test and preview matches:

    Generic Navigator Customizer

  • Folder To HTML - very often in a tutorial I need to show a directory tree and say something like "You should now have the following files on disk:" followed by a directory tree listing. Doing this stuff by hand as nested HTML list items is truly tedious. The Folder2Html module simply adds an action to all filesystem folders in NetBeans, Dump Folder as HTML. It will simply walk the directory tree and send the appropriate HTML to the output window, where you can copy/paste it into a tutorial. It includes some space and formatting for adding descriptions, e.g.
    • src/
      • syntaxtreenavigator/
        • IntrospectionTreeNode.java Tree node with children for all methods of the passed object
        • SyntaxTreeVisualizer.java Main frame
        • V.java Tree node for one element in a syntax tree
        • ViewPanel.java Inner panel
Anyway, if you write a lot of HTML, perhaps you'll also find these useful.

allOfTheAboveSmall.png
All of the above (click image for full size)

Addendum: For users of 5.0 and 5.5, here are NBM files for the modules. Simply download them to some folder, open Tools | Update Center and choose Install Manually Downloaded Modules and select them all and continue through the wizard to install them.





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