I finished up my ScriptLoader Eclipse Monkey DOM last night. Spent more time building the freaking plugin, feature, site.xml, etc than on the actual code. But once all the feature stuff working, it is pretty nice. If you're interested in my vanilla Ant script that does this, look for the project source zip on the web site. Although my feature only has one plugin, I think this could scale to a multi-plugin feature if you were willing to have the feature and all the plugins at the same version number every time.
I also put the lamo web page for it (link above) in Eclipse as a help document. It's nice to have simple examples of doing this, like the eclipsemonkey plugin did. Thanks!
Something really bad happened while I was editing the HTML page, at one point. I lost the source some how. Deleted it accidently or something. I've never figured out the local editing stuff in Eclipse, or never seen it work in action, so I figured all was lost. A bummer too, because there was at least 1/2 hour worth of typing in there. But, I did have the page open in a web browser with the full content. hmmmm. Clearly I could cut-paste the code into a text editor and redo all the formatting. Or maybe paste into Word and try to recover from whatever bad HTML it would have generated. Then I remembered a little note on a blog I saw last week. Someone wanted to get the source for their page easily, and they had a little javascript: url you could plop in the address bar that would show you the source. Something like a document.innherHTML or something. Tried it and it didn't work, but then I thought I should try it in the JavaScript Shell, which is a really nice little bookmarklet thingamajigee. Brought it up, and after a few tries, found that document.body.parentNode.innerHTML got me exactly what I needed, except the HTML elements at the beginning and end. Swipe, copy, paste back into Eclipse. And it was a single, hugely long line. Sigh. I didn't have time to figure out if pasting somewhere else (Word or a text editor) might have left the line delimiters intact, so I decided to re-layout by hand. But boy was I glad I could at least get all the text + markup saved.
I'm starting to work on some little utilities with Eclipse Monkey + ScriptLoader. Experiencing what I have before in losing the one nice bene of overly strict typing in Java: code assist. Based on some of the snippets I've been typing, it seems to me like some static and flow analysis could yield pretty good typing information, given all the Java glorp I'm actually doing in JavaScript. Can't imagine anyone ever doing this though, and I'm not interested enough to do it myself.
First thing I'm going to try to build is a EM script to toggle showing unchanged (in the team sense) projects in the navigator. I really hate it when I have changes to commit across multiple projects, which are widely separated visually. I'd like to have a 'working set' which was programmatically defined: 'projects that are dirty in the team sense'. And be able to toggle that on and off easily.
Lots of stuff to learn.
No comments:
Post a Comment