|
|
|||||||||||||||||||||||||||||||||||||||||||||||||
Tim Boudreau's Blog
In my other life I'm a musicianPosted by timboudreau on June 24, 2009 at 12:31 AM | Permalink | Comments (3)A few people know that since I was 11 I've been writing and recording music. I recently created a ReverbNation profile to share some of it. Of course, I can't resist prefacing a song with a bit about what it's about and how it got written. So I'll embed the player in this blog and tell a story or two. It's a hard thing, to decide what to say about a song or any work of art you've created - some people want to know what you were thinking and feeling when you created it; some people want to know the technical details of how you did it. Both are valuable and interesting information, but they are interesting to different audiences. I'll say below what matters to me - sometimes the technical details, sometimes the personal ones, and it will just have to do.
There are about 240 more songs where these came from. Some better than what's here. If you think my programming work is good, and that my musical work might be good too, you'd be doing me a personal (and repaid if you ever ask me to repay it) favor by clicking the "Become a Fan" link on the widget above. Enough of those and one day I can get some of this stuff on ITunes and Rhapsody. I've been writing songs for 20 - wait, no, going on 30 - years - not because I want fame and fortune, but because it's a compulsion and I love doing it. Listen to the stuff. If you like one of the songs, click the Become A Fan link (and uncheck any send-me-spam boxes - I don't like it any more than you do). After all this time making this stuff, it would be nice for it to be heard. My style is so schizophrenic that you get one jazz tune, one Rossini overture, one death metal tune, followed by a hard rock tune, a folk rock tune, and something uncategorizable - give me two songs in any style and I can write in that style. So if you don't like the first thing you hear, please try another before giving up - my style is really whatever I've been listening to most recently. And let me know your thoughts, what you like, don't, and what could be improved. Nothing is ever finished (especially if you have all the raw tracks. Harry Chapin got all his family members to bombard Boston radio stations with requests for his songs. They did it. If it hadn't happened, "Cat's in the Cradle" and "Taxi" would not be in our collective consciousness - we all heard them when we were kids and for many of us they caught our hearts. You could help that happen again just by going to my music page and clicking the "Become a Fan" link on top of my picture. You'd be helping me out, and it would be much appreciated. Only if you think some of this stuff is good. -Tim Juggy gives Duke a workoutPosted by timboudreau on June 05, 2009 at 12:56 PM | Permalink | Comments (1)Bruno Souza got a whole bunch of us together to participate in creating this video (embedded below) - how Java Users Groups drive Java - from an unusual perspective :-) Photos from JavaOnePosted by timboudreau on June 03, 2009 at 02:53 PM | Permalink | Comments (3)A few photos from around JavaOne, taken with the world's weirdest lens - a Lensbaby Control Freak - this is a lens that you can twist and turn like a flexible tube. It lets you do some things that were possible on old-fashioned bellows cameras, but are normally impossible with an SLR camera, where you can't change the relative angle of the lens to the film/sensor. For example, the "Java = Opportunity" photo below is taken at an extreme angle - yet all of the phrase is in focus. It's also great for putting the "sweet spot" in the focus in weird places.
NIO file backed buffered imagesPosted by timboudreau on May 31, 2009 at 11:37 PM | Permalink | Comments (4)Over the years, a few people have come across and used a bit of code I wrote for Imagine. You basically have the problem that Java image data is stored on the heap as giant byte[] arrays and you quickly run out of memory. One of the JDK team guys assured me about two years ago that with JDK 7 this would no longer be a problem - but I got no sense that he either understood what the problem was, and I couldn't think of a way you could really solve it without doing your own memory management. Say you're writing an image editor application. "Tools" draw on the surface of an image. You want to provide undo support. You have a few options: Pong: The most truly daft NetBeans plugin everPosted by timboudreau on May 31, 2009 at 09:47 PM | Permalink | Comments (1)One of the first games I ever wrote, circa 1982, was a version of Pong for the TRS-80. Yes, pong - with the two paddles and bouncing ball. Now there's a NetBeans plugin! I had a pong game when I was in about 3rd grade. It plugged into the black and white TV in the kitchen, had two paddles and one switch for ball speed. The real fun was when the cat would stand up with her paws on the bottom of the screen and try to swat the ball as it went by. I've been demoing integrating a hex editor into NetBeans for years, to show how easy it is to take a Swing app and turn it into a plugin. It was time for something new. So I spent an hour and wrote a Java pong game - enhancements are welcome. I'm thinking the demo should be a backward version of the "boss key" those apps that pop a fake spreadsheet up on your desktop whenever your manager walks by so it looks like you're not surfing the net. This is just that, in reversed. It's the "Please fire me" key - press it whenever your boss walks by, and you're obviously spending all your time playing dimwitted video games! There are enough dumb companies and awful programming jobs out there that I think it just might have a market :-) I'll demo it at our Java University talk tomorrow night - we've now got seven speakers lined up, and it's going to be a load of fun - and I'm trying to get the doors opened for anyone who wants to come, whether you paid for Java U or not (still waiting for the response on that, but I'm hopeful). And in a totally unrelated development, I was in an elevator today and ran into two colleagues from when I was in Grenoble, France, (still one of my favorite places in the world - although, do not buy reblochon (sp?) cheese, let it sit in a backpack for two days and then open it in a train car and not expect to get dirty looks - it's much less stinky when cooked!) helping out the Real Time Java guys. It seems they've been retasked for some months with creating a really cool JavaFX graphical designer - animation timelines and all. These guys are really good, and I'm looking forward to seeing their work on Tuesday! NetBeans and Its Ponderous Plugificators - coming to JavaOne - fun to be hadPosted by timboudreau on May 26, 2009 at 09:11 PM | Permalink | Comments (5)I'm going to JavaOne next week - doing a talk I'd love you to come to as part of Java University at 6PM this coming Monday (I mistakenly originally posted Sunday) night. I'm gathering a bunch of NetBeans core developers, dream team members who build apps on NetBeans and all and sundry to come demo the things they love about NetBeans and give the audience a chance to talk with the people who really make the tools they use. You'll meet a lot of the NetBeans developers and I promise some fun. Yes, the title is "NetBeans and It's Powerful Plugins", and no, I had nothing to do with the title. My job is to make it something you'll enjoy so much that you'll be proud to have attended a talk with a name like that. And the main thing is to open it up to the audience - what can we show you, what can you show us, what do you want to learn about, what do you wish we'd support more in NetBeans. Open source is collaboration between the users of a technology and the makers of a technology - and ideally the merging of the two. I hope you find you can come and be part of that. Ohloh's open source project statistics - WTF?Posted by timboudreau on May 26, 2009 at 08:56 PM | Permalink | Comments (3)Ohloh is a neat service. It does some basic statistical analysis of open source projects, and tries to come up with useful information. But it sure comes up with some wacky statistics. Take, for example, the Wizard project. Now, this is something that I initially whipped up in two afternoons in September '05. It's a small library - it's attracted six contributors since then, who've all made valuable contributions. I tend to do work on it sporadically, for a couple days every 4-6 months. At most I've put 2 weeks work into it. With contributors, the pattern is that it's people who are using the library and want a feature that isn't there. They implement it, and get on with doing what they wanted to use the library for, which is as it should be. If somebody wanted to take on an ongoing role, that would be great, but I'm not holding my breath. According to Ohloh, this weekend project represents (!)
warning icon - for example, it is displayed on Ohloh's page for my Color Chooser project.
I mean, think about it: Especially with small projects (IMO in a perfect world, most library projects should be small and tackle one thing well), a positive goal is for the project to reach a steady state where it does not need a great deal of, or ideally any, maintenance. If software rotted like fruit, there wouldn't be any progress in the software industry. There is such a thing as a library that can be finished!
What was that quote about lies, damned lies and statistics?
A library for diffing java.util.ListsPosted by timboudreau on May 12, 2009 at 11:18 AM | Permalink | Comments (3)I recently set up a new project on kenai.com - this is something that has been available in NetBeans for years, and is probably useful to a wider audience. It is a library for taking two java.util.Lists and generating a diff between them.
There are a number of libraries around that support using Collections as models for Swing components. But most revolve around observable lists, or wrapping lists in observable wrappers.
But sometimes, you simply don't control the code that is handing you a list. I was in that situation when writing the Navigator for NetBeans 4 — I could get a list of class members, but there was no way to detect changes between them except to compare the previous list I got with the new one.
So I wrote this general-purpose library for generating diffs between lists. It has proven useful in many projects, some not NetBeans-related, so it makes more sense as a project apart from NetBeans.
The main wiki page for the project describes it, and the choices of algorithms available, in detail.
With it, there is also a subproject that implements Swing ListModels, to make it easy to use with JLists (it will be there as soon as I make a build of NB with this bug fixed).
Trademarks and Open SourcePosted by timboudreau on May 10, 2009 at 10:19 PM | Permalink | Comments (1)Simon Phipps posted a URL to this interesting article on PCWorld, Trademarks: The Hidden Menace. Having been involved in Sun's open source projects from the beginning, and dealt with lawyers on trademark issues over the years, I have a few thoughts - and some serious disagreements with some of the comments. Since article comments are less often read, I am posting my comments in expanded form here. This comes with the usual caveat: I am not a lawyer (I don't even play one on TV), and my opinions are my own. Ironically, most of what I am discussing does not help the author of that PC World article, since his issue was with using the trademark of a Linux distribution. In the article, however, he brings up the subject of the licensing of the word "linux" — which touches on a legal rats' nest in open source licensing that I have seen cause a great deal of trouble. I've been saying for years that somebody needs to do for trademarks what the free software and open source movements have done for licensing. At Sun Microsystems, I have watched trademarks wreak havoc with various open source projects. I disagree strongly with the comments such as "Trademark laws are critical to the success of open source software." I have seen them be harmful or benign, but I have never seen them provide a positive benefit.
Names are important - software is for human beings, and human cognition requires that a piece of software have a name - ideally a sayable, memorable name. Especially with open source projects, where there may be multiple distributions, name recognition builds perceived ubiquity. Without a name, potential users and community members cannot find each other.
Imagine if every Linux distribution had to have a different name that didn't use the word "linux" (think: Joe's Operating System, Foobar Corp. OS), would linux have ever become popular? In the early '90s I used Slackware Linux, and later RedHat Linux. If these things had not used "linux" in their names, how would I have even known that they could be somewhat interchangeable, or how to find help on using them? As a Linux user, there have been plenty of times that documentation from, say, Gentoo Linux, has helped me solve a problem in my install of Ubuntu Linux, or vice-versa. If I didn't have the noun "linux", would I have ever found that documentation? Or would I have given up at some point and not even be a linux user today?
In the real world, I have never seen trademarks be good for open source. At best, they're sometimes not harmful.
One response said:I can download Ubuntu for free, but how do I know I am getting the real thingYou know where you are downloading it from. And that's the point - a trusted source for software is much more reliable than a trusted name when it comes to open source software. Open source software can be recompiled by anyone to create the same binary. The distributor, or the point of distribution, is the brand. The name of the software belongs, or should belong, to the community. To pick on one of Sun's own projects for a minute (let the hate mail come), the kind of mess trademarks can cause when they meet open source can be seen in action with OpenSolaris where alternative distributions are required not to use the word "solaris". This is suicidally stupid for the health of the project, particularly for distributions - there is no way for people who don't already know that multiple distributions are really the same thing to find out. That puts a very low cap on the amount of adoption it is ever going to receive, by undermining the ability of distributors to even indicate what it is they are distributing. Go to the OpenSolaris download page. There are distributions called BeleniX, Jaris, MartUX mBE, MilaX, NexentaOS and SchilliX. Who would ever guess that these are names for the same thing? Each of those vendors would probably like to become the 10,000 pound gorilla which takes over the operating system world. But none of them are today. If these things could say, in their name, what they are, these distributions could synergize each others' popularity. They would still compete, and there would be winners and losers. But the common name creates the competitive playing field. It facilitates competition. Without it, all of the burden to connect the dots and figure out that all of these distributions are versions of the same thing is put on the potential customer. That's too much work to ask of people - the lack of a common vocabulary, a common noun, ends up being a massive barrier to adoption. The result is an order of magnitude fewer potential customers.
The Apache license's requirement that distributions of Apache software be named something different seems similarly wrongheaded and destructive. I can think of 6 or 7 Linux distributions, off the top of my head. I can think of 1 Apache web server distribution — WebSphere.
Demanding that users of software figure out on their own that five different things with five different names are actually the same thing is demanding that human nature be violated. If we want the open source software we create to compete viably with commercial software, this is like trying to run a marathon with untied shoes.
In other words, the way trademarks are currently handled in open source projects stifles competition and hurts smaller or less-known vendors. The name of the software is the way a vendor communicates what they are adding value to.
There is a fundamental tension between an open source project's name, and how it is subsequently branded. It is somewhat expressed by the fact that the person who posted the above comment used "Ubuntu" several times as a noun (which is actually verboten for the trademark holder if they want to protect their trademark). A small vendor creating a distribution benefits from name recognition of the underlying software - if I am familiar with Linux, I am much more likely to try something called Acme Linux, because my expectations are set by the use of the word Linux. If it were called Acme Super Operating System, I would be much less likely to ever hear of it, or find it in a search, much less consider it something I might want to use. Which is exactly the situation with OpenSolaris - how would I ever figure out that a distro called Nexenta is actually Solaris? I have to start by knowing about Nexenta, which is exactly where their potential customer does not start.
As a particular distribution increases in ubiquity, the vendor is less dependent on the name of the underlying software, because it has developed independent brand recognition. When a distribution reaches a level of popularity where many people will just use the name "Ubuntu", unqualified, in a forum post, and can have a reasonable expectation that others will know what they are talking about, the vendor has less interest in using the name of the underlying software, and more interest in protecting the brand belonging to their distribution.
The respective value of the vendor's brand and the name of the underlying software, to the vendor, changes over time. So does the value of the vendor's work to the underlying project. Yet trademark law assumes a fixed and permanent value for both — one which must be vigorously and labor-intensively defended from the start. In doing so, it pits two parties in a mutually beneficial relationship against each other — and in fact creates an advantage for closed-source vendors who suffer no such conflict. While this might make such vendors happy, reducing competition definitely does not benefit the consumer.
This is particularly a problem when smaller vendors are creating the software - they cannot afford a massive marketing campaign to build recognition of their "brand". For small vendors, brand growth has to happen virally. That fairly guarantees that the trademark must be violated, as a condition of success. Especially in the early stages of an open source project's lifespan, you have a no-win situation with the way trademarks are currently handled: You have a trademark which gains its value over time by being violated. And if it is not violated, it will most likely never develop any value at all. If people had not been allowed to use the word "linux", there would be no Linux today - it would have never become a competitive force.
In some ways this is analogous to how pirated copies of Microsoft Windows were the thing that made it ubiquitous — the success of the software actually depends on others violating the rights, as they are currently legally defined, of its creator.
Revising the legal framework to take into account the actual behavior of the market seems to me to be a reasonable response.
Especially early in an open source project's life, other people using the name is a sign of success - in fact it is necessary for the project to succeed. Someone else calling their distribution "Ubuntu Linux" helps the "Linux" brand (and I think it would be safe to say that there would be no Linux as a force in the O/S marketplace if the name "Linux" had not been freely usable in the '90s).
I work on NetBeans. Now, if someone creates spam-mailing software and calls it NetBeans, trademark law is a way to stop that. But if someone is redistributing NetBeans, why on earth would I want to stop them from using the name? It can only enhance NetBeans brand equity to allow that — and a cease-and-desist letter from your lawyers is not a nice thing to do to people who are helping you. The best decision we ever made for NetBeans was to stop having Sun "branded distributions" of NetBeans — nobody could figure out that Forte for Java Internet Edition cum Sun Java Studio actually was NetBeans — it just fragmented the user base and guaranteed that no distribution was successful because NetBeans was competing with itself! Now, I still think creating rebranded versions of something you own the brand and the code to is mind-bogglingly stupid, but if these things had at least been called Something NetBeans, it wouldn't have been as disasterous as it was. From those times, I have first-hand experience of how much damage not having a common name can do — and we wouldn't even have been violating our own trademark to do it!
The problem is that the way the law handles trademarks is exactly backward for the needs of open source - the requirement is that the trademark holder treat all third-party uses of their trademark as violations and pursue them aggressively, even when the trademark holder benefits from the third party usage.
An open source project needs permissive trademark licensing - at worst, no more difficult than filling out a web form with contact information, a description and a URL - while still having recourse to pursue clear abuses of that trademark.
I wonder if something like that is possible, even within the framework of existing U.S. trademark law — I suspect some creative lawyering is possible. Given my experiences with regard to trademarks, at least with Sun's lawyers, I suspect nobody has tried — or stated succinctly what the problem is. It does look like LinuxMark.org is pretty close to what would be needed.
While not as broken as patent law is, with respect to software, long-term, trademarks do cause significant problems — problems that are a greater burden to open-source than closed-source projects, and which hurt new projects and small vendors disproportionately. What is really needed is trademark law that better fits how trademarks work in practice. In the meantime, it would be nice if our industry could develop some best practices for mitigating the harm.
Sneak Preview: Java Card tools for NetBeans 6.7Posted by timboudreau on May 10, 2009 at 01:07 PM | Permalink | Comments (4)I've spent the last few months collaborating with the Java Card team to create Java Card plugins for NetBeans. It's not released yet, but here are some screen shots to whet your appetite. Java Card is an interesting platform to work with - a JVM that runs on smart cards and tiny devices that fit in the palm of your hand. As of Java Card 3.0, it comes in two flavors:
java.lang.String and so forth. The boot classpath will be different for Classic and Extended projects, so, for example, code completion will not show
java.lang.String in Classic projects, but will in Extended projects.
Servlet implemented, and you have access to the full Servlet API. This is vastly easier to work with than either of the Applet-style application types—you don't need any special code on the client to interact with an application running on a device, just a web browser! You can test your applications locally using the Reference Implementation and your desktop web browser.
Properties files which are imported by the build script. The card vendor provides a set of Ant tasks for deployment to the actual device. So the projects created are not IDE-specific at all.
We're in the home-stretch of getting these plugins out the door and available to everyone using NetBeans—hopefully we'll also be able to bundle the Java Card runtime so that you can get everything you need to play with Java Card in one simple download. Look for more news soon!
A lot of the credit for these modules goes to Anki Nelaturu and the rest of the Java Card team, who created the first draft of these plugins, and who have been fantastic to collaborate with over the last few months.
Per-object workqueues - is this a thing anybody needs?Posted by timboudreau on May 05, 2009 at 10:05 PM | Permalink | Comments (2)A couple of years ago, at OOPSLA '06, I think, I had a lot of fun hanging out with Jarda Tulach and Rich Unger and writing a generic library for enqueueing a batch of jobs that run against an object on a background thread.
The fun part was really getting to dig into the The basic idea is simple:
public interface QueueWorkProcessorand then just create a Dispatcher for it (Drainable is just a collection of jobs which can be emptied by type - so different things can handle different kinds of jobs - for example, in the DocBook module, there are both jobs that use ContentHandlers and jobs that use java.util.regex.Patterns - different code grabs the jobs of each type and runs them when the work is ready to be done). When you call Dispatcher.put (Target target, WorkType worktype), it gets enqueued - and put() never blocks and the work always gets completed (at least, so say my unit tests).
The question is, is this too esoteric and weird a thing to have its own project (you can already get it from NetBeans sources, after all), or is there someone out there who actually needs such a beast?
And as usual, there is the question what do you call a thing that does this? I've been calling it "workqueues" (you can find it in NetBeans sources in contrib/api.workqueues), but suggestions are welcome.
What do you call a...well, that's the problemPosted by timboudreau on May 05, 2009 at 06:45 PM | Permalink | Comments (6)A few of months ago I blogged about a simple but powerful pattern for working with Objects not key/value pairs - use dynamic proxies to generate an implementation of an interface, which delegates to the backing storage transparently. It's ready to become a small open source project. Names are important — they should either be communicative and say what a thing is/does — or they should be completely ad-hoc (think bird names and such). What do you call a library/class where:
Lobby of the Blue Tree hotel in Brasilia, Brasil It amazes me that they found real trees that look like computer-generated fractal trees in an architect's 3D model How evil would it be to enforce direct subclasses only?Posted by timboudreau on May 01, 2009 at 11:43 AM | Permalink | Comments (1)
Converting objects from A to B and back - there ought to be a libraryPosted by timboudreau on May 01, 2009 at 11:33 AM | Permalink | Comments (4)One pattern that is an incredibly frequent recurring theme is converting an Object of type A into an object of type B for something that understands B to consume. Tons of libraries have something like this embedded in them - beans binding, pretty much anything that validates strings. If there were ever something that deserves a simple common library, it's this. I was just looking at Fabrizio Guiduci's Better Beans Binding project, which took me to the original beans binding project. Embedded in it is a mini-framework for converting objects back and forth between types - an application provides a List, a JList wants a ListModel. Last week as part of my new Simple Validation project I wrote into it a mini framework for object conversion and a converter registry:
public abstract class Converter<From,To> {
public abstract <To> convert (From from);
public static <From,To> Converter<From,To> find (Class<From> from, Class<To> to);
}
Java Beans property editors are de-facto Object -> String -> Object convertors - I've long thought that one of the bigger messes in the beans spec (there are so many!) is the fact that type conversion is a completely orthagonal concern that should have been factored out.
And on it goes - I'm sure there are many, many more examples. All of the subclasses of java.text.Format in the JDK count. Pretty much anything that communicates via HTTP and uses an object-oriented language is one.
Perhaps something like this already exists and I don't know about it.
But what I would really like to see is a simple framework that solves the problem, that the rest of these projects could use - it's really an area where there is endless spinning of wheels. The characteristics something like that would be:
Too bad about IBM and Sun...Posted by timboudreau on April 27, 2009 at 06:43 AM | Permalink | Comments (7)Now I won't get to surreptitiously replace the NetBeans splash screen with this...
:-) "Fisheye View" plugin for NetBeansPosted by timboudreau on April 27, 2009 at 02:57 AM | Permalink | Comments (5)While I'm on my plugin-writing rampage, I just committed a plugin I was working on a few years ago to NetBeans source base. It's a fisheye view of the editor. Just drag the mouse in the error marker bar on the left of the editor, and get an overview of your whole file and rapidly navigate it! A picture is worth a thousand words...
The basic thinking is, if you're working in a source file you're familiar with, you probably know your way around it well enough that an outline of what it looks like will be useful, and being able to scroll through it all very rapidly is more efficient than dragging a scrollbar (if you just want to look, but not scroll anywhere, just release the mouse outside the error marker bar; if you release it inside it, the editor will be scrolled to what you were looking at and the caret moved there). And if an error marker shows up somewhere in your source file, but it's above or below what is visible, then in one mouse gesture you can both see the error message (which you could see by hovering the mouse on the error marker bar beside the editor, or in the task list if you have it open), and you can also see the code associated with the error without losing your place in the editor by scrolling or changing the caret position. It shows any annotation (error markers, breakpoints, bookmarks, etc.) by highlighting it, and providing a description is one is available (same as the tooltip for the mark in the error bar). It also was a chance to have fun with some animated fade-ins for the component itself and the text-bubbles that show the annotation text. The code for it is actually not NetBeans-specific. It is a general-purpose text fish-eye view for Swing text components which will work with any JTextComponent and another component to drag the mouse on, so this can be used in any Swing application (as long as you don't mind that it will screw around with the glass pane of whatever window it's in) - the sources are in contrib/fisheye - just one interface to implement to use it.
Alas, I'm doing a bit of a hack to hook into the error marker bar, so it is using an implementation dependency to get access to it. So publishing a binary would be somewhat useless, since it requires that it run against the exact version of the error marker bar that it was compiled against. But I can probably get it on the update center for development builds.
So ideally this would be tuned a little more and go into the actual NetBeans distro. If you think this would be a Good Thing, you can vote for enhancement request 163729.
And of course, if you think it's a horrible or insane idea, comment below :-)
A few new NetBeans modules - VNC, Breadcrumbs, License Header Changer, a better Java Navigator and morePosted by timboudreau on April 26, 2009 at 11:21 PM | Permalink | Comments (10)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.
Some of them are things I've had lying around for a while, some are new:
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) A simple library for Swing UI validationPosted by timboudreau on April 14, 2009 at 02:14 PM | Permalink | Comments (5)I recently created a project for Swing UI validation, which is now available on Sun's new open source hosting site, Kenai. I'd love to get some feedback on it. If you have an existing Swing UI and want to add input validation with user feedback to it, you might find it useful.
The project can be found here, and there are JAR, source, javadoc and NetBeans library module downloads available. An overview of the project can be found in the project wiki. I'm currently working on mobile and embedded tools for NetBeans - in particular a marathon race to get the new Java Card development tools ready for release (there's nothing in NetBeans source repository yet - we're waiting for the lawyers to give their okay to move it there). In both the Java ME modules, and the Java Card modules, there are a lot of pieces of user interface where you want to show the user a “problem” if their input is not valid. In the case of the mobility modules, for a lot of the code, there is no validation implemented at all; for the Java Card modules, I wanted to replace many lines of code that look like
String text = fooTextField.getText();
if (text.trim().length() == 0) {
setProblem ("Enter foo");
return false;
}
text = barTextField.getText();
if (text.trim().length() == 0) { ...
This sort of thing is no fun to write, hard to test, and tends to grow like weeds in UI code.
Then there is the issue that some UIs live inside a wizard, and there is one API for showing problems in wizards in NetBeans; there is another API for disabling the OK buttons in dialogs, but there there is no API for showing the user problems; there is another API for showing problems in project customizers, and yet another for option panels. And some of these UIs are used more than one such place. So I wanted a way to encapsulate and reuse that sort of validation logic, and make it simple to attach it to any UI. The result was the Simple Validation project. I looked at some of the existing libraries for doing validation - particularly JGoodies Validation. The existing solutions are nice - and if I were probably writing a UI from nothing, I would use one of them. The two main problems I had with the existing solutions are
Validator for integers, or to require non-empty strings. If you have other common cases that would be useful to others, contributions are very welcome - writing a Validator simply requires implementing a single method. The framework takes care of things like adapting a javax.swing.Document to a Validator<String>.
With this project, I also got to try out Kenai for the first time. It is quite slick and speedy - much nicer to work with than java.net or netbeans.org - I'm pretty impressed. The only annoyance or bug that I noticed was that there seems to be no way to modify the content of the home page except for the 500 char project description and a logo image.
Are constructors the enemy?Posted by timboudreau on March 31, 2009 at 06:47 PM | Permalink | Comments (7)My friend Jon writes an interesting blog on the problem of constructors, and how a language might improve on them - and comes to a fairly startling solution.
The major problems with constructors as I see it are
|
June 2009
Search this blog:CategoriesBusinessCommunity Community: Embedded Java Community: Java Enterprise Community: Java Patterns Community: Java Specification Requests Community: Java Tools Community: Java User Groups Community: JavaDesktop Community: Jini Community: NetBeans Community: Portlet Extreme Programming J2EE J2ME J2SE JavaOne Jini JSR Linux Open Source Patterns Programming Swing Tools Web Applications Archives
June 2009 Recent EntriesIn my other life I'm a musician | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|