|
|
||
Tim Boudreau's BlogJune 2008 ArchivesManila; Moderation done right; Breadcrumbs for NetBeansPosted by timboudreau on June 24, 2008 at 07:41 PM | Permalink | Comments (0)Here's three blogs in one (I know, I know, you're not supposed to do that): My friend Geertjan and I just did NetBeans Day Manila, in the Philippines, followed by two days of plugin-writing training at the University of the Philippines. The students were wonderful and bright and motivated and it's always a joy to teach to people who are really interested in what you have to say. There's a conversation going on on the mailing list for bloggers on this site - there's been a big issue with people posting comments that consist of 500 porn URLs and such. Back when we were little-bitty NetBeans-the-tiny-Czech-startup we had this solved on our mailing lists - 100% spam-free - a lot better than I can say for how things were after we joined Sun. The system was incredibly simple. My friend, and later, roommate for two years Karel Zatloukal, came up with this brilliant and blindingly obvious system - his becoming a manager was a huge loss to hackers everywhere. It's dead-simple:
majordomo hacked within an inch of its life, but the model is simple and easily repeated on any similar system. I feel like most moderation systems for mailing lists and blog posts are still stuck in the stone-age, and I've experienced vastly better almost ten years ago.
Lastly, at the booth in Manila last week, someone commented to me about a new "breadcrumb" feature in IDEA or Eclipse that they wished NetBeans had. I thought, gee, that would take about 20 minutes to implement, and set about doing it. Well, 20 minutes to get the rough draft. Another few hours to really make it useful. Geertjan already blogged about it (do a text search for "breadcrumb"). It's now available for NetBeans 6.0 and 6.1 on the plugin portal at this URL and should be available in the 6.0 and 6.1 built-in plugin managers soon.
Nursing a baby whale with Jonathan Schwartz's tearsPosted by timboudreau on June 03, 2008 at 10:12 AM | Permalink | Comments (3)My colleague Judith Lilienfeld did the MC honors at this year's NetBeans Day in San Francisco. I'm amazed that this went by and did not get blogged about, so I'll have to do the ungainly honors... The demo of the morning was using JasperReports iReport plug-in to create a report with pie charts based on a database, without writing any code. The Saturday before NetBeans Day, my colleague Brian Leonard sent out an urgent request for line-items for said database. I dutifully replied with my standard "turn up the bus noise on the brain and see what pops out" approach. What amazes me is that nobody sitting in the audience found it the least bit odd that one NetBeans evangelist's achievement of the month was "Nursed a baby whale on Jonathan Schwartz's tears" or "Fed the NetBeans Aardvark"... So here I am tooting our own cleverness. Meanwhile, back at the ranch, I would like to reply to an article here which borrows some continuation tooltip code I wrote for NetBeans back in '05, which is generally useful. However, whatever kind of CAPTCHA system that site is using demands that I "input" the text contained in an image, without actually supplying a place to put said information (tried it in both Safari and Firefox - it's not a browser bug). So, with apologies, here's my reply, and please fix your web site: Happy to see you found my popup tricks useful. I agree, they ought to be built into JTree and JList and just automatic, though I'm sure that would present a backward compatibility problem of some sort for anybody who has already dealt with them on their own (popup wars, anyone?). Combo boxen are their own special problem - Apple gets this fairly right by sizing the popup to the maximum preferred size of the contents; everybody else gets it semi-wrong by preferring the size of the control to the necessary size for the contents - it just ain't pretty. The only viable alternative is to write your own UI delegate and screw cross-platform appearance. I describe how to do something like that here. Egads! An actual Swing Tree-Table!Posted by timboudreau on June 03, 2008 at 03:36 AM | Permalink | Comments (22)Four years ago, I went on a hunt for best practices for doing tree table components in Swing. We had a tree-table component in NetBeans, whose maintenance was my never-ending nightmare and the biggest source of bugs on my bug list. It had been written, with the best of intentions, based on Scott Violet's Swing Connection article about how to quickly hack up a tree-table component in Swing (Scott's article was also written with the best of intentions, and I have no intention to ding him here - what he wrote does work for simple use-cases - a debugger is not a simple use-case). When I canvassed folks who had done Swing tree-tables on our mailing lists, most of them were based on that article, as ours was. What I heard back varied between groans of pain and mad rabid howls of pain. There are a few things in that original tree table design that just don't work - not reliably, anyway. Sending events to an offscreen component as if it were on-screen and expecting it to behave sanely is just a really bad idea that happens to work if the look and feel is a subclass of BasicLookAndFeel, and other look and feel implementations have been tormented into supporting this abuse by all the evil Tree-Table implementations in the wild. But the bottom line is, a look-and-feel author would have to be slightly insane to code their TreeUI to behave as if it were a live component when it has no parent and obviously is not one. In other words, the fact that the JTree-as-cell-renderer design works at all is just an accident of how BasicLookAndFeel's TreeUI implementation was designed, which other look and feels inherited. Never mind trying to use said JTree as a cell renderer in a table (I once made a 400% performance improvement in our tired, tortured, hacked-up TreeTable just by having it translate the graphics context instead of repositioning - and thus causing a re-layout) is seriously abusing the component. Now try convincing said offscreen JTree that it has keyboard focus in order to get it to paint appropriately in its role as a cell renderer for another component. On all look and feels. On all platforms. Everywhere. You see what I mean. After doing that canvassing back in '04, it was obvious that Swing needed a real tree-table component. So I started to write one (and the layout cache classes JTree uses were very, very helpful - thanks, Scott!). I started on it, got the basics working, and then moved back to the U.S., changed jobs and ended up travelling the world full-time teaching other people to write NetBeans modules - but it didn't leave time to finish up the Tree Table work. Thankfully, my former office-mate, David Strupl, picked up where I left off when he left Sun to work on Nokia's NetBeans RCP app for managing cellular telephone networks. The really, really great news is: This week, Standa Aubrecht - who took over a bunch of the stuff when I left full-time development of NetBeans in '04 and amazed me with how quickly he was able to get going in a complex codebase - committed it into the main line of NetBeans sources yesterday. So anybody who gets a dev build of NetBeans as of today has a perfectly working Swing Tree Table component they can use (the class name is Outline - I borrowed the name from Apple's Cocoa library - it's a little less clunky than "tree table" but gets the point across). The JAR file is org.netbeans.swing.outline.jar. Usage is incredibly easy - you just provide a standard Swing TreeModel of whatever sort you like, and an additional RowModel that can be queried for the other columns contents, editability and so forth. And you never have to worry about cells painted half one color and half another because the tree-cell part got repainted after focus went to a popup menu. It actually works!
The real credit here goes to David and Standa for getting this thing production-worthy - I just was pissed-off enough at having a gargantuan list of unfixable bugs (well, fix it on one platform, break it on another, or leave it unfixed everywhere, or semi-fixed some places - pure evil if you hold the illusion that what we do is computer science) four years ago to get the ball rolling. They're the guys who delivered it.
I'm incredibly happy to see this finally be real and available not just to people writing NetBeans modules, but anybody doing GUI apps in Java. There has been a need for a real, reliable tree table component for Swing programmers for a long, long, long time. All hail David and Standa!
| ||
|
|