Quite a while back now (July of last year?), I talked about maybe hacking up some print code for SQuirreL. I'll readily admit I didn't make time nearly as fast as I would've liked, but having hacked a bit last week I thought I'd post as far as I've gotten in the day or so I've spent so far.
You can grab the jar with both source and binaries (so you can just drop into plugins) here:
http://mywebpages.comcast.net/rufbo1/wackApps/SqlWhitespace.jar
There are actually two plugins there, both very much works in progress. One adds whitespace to your *first SQL pane's* (so if you have multiple connections open, watch out) SQL code -- I haven't made it recurse through nested statments yet so it's not all that useful right now. Feel free to check it out with code without nested statements to kinda see where I'm headed. Note that it also uses Jakarta ORO for regexp (for 1.3 compat), so you'll need ORO in your classpath. Easiest route is probably to grab this jar:
http://mywebpages.comcast.net/rufbo1/wackApps/lib/jakarta-oro-2.0.8.jar
... and slap it into your lib folder for SQuirreL.
The second is printing, no less. Again, hard coded for the *first SQL pane* and doesn't print results -- just the code in the first SQL pane. Also only prints in a monospace (whatever's your default), 8 point font with 1 inch margins right now. Should be relatively easy to change, but rather than wait until I cleaned it up, I thought I'd send it on. Tested only in Win2k...
java version "1.4.2_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_02-b03)
Java HotSpot(TM) Client VM (build 1.4.2_02-b03, mixed mode)
... though I built it on Mac OS X as well (the nonstandard jar placement there took a while to "fix", and I haven't tried executing).
Also, I think the code does actually do a pretty good job showing how to make a plugin with a minimum effort, for better or, more likely, worse. If you've wanted to write a plugin that screws with the SQL code pane, take a look!
Comments welcome, etc. Will hack more as time permits.
Ruffin Bailey
|