Eclipse Monkey set out to do for the Eclipse IDE what Grease Monkey had done for the Firefox browser: create easy extensions.
Bjorn Freeman-Benson and I pair-programmed this implementation. We considered it our job to launch valuable projects and then seek additional committers from within the ecosystem.
We integrated Mozilla's Rino javascript engine into the already modular Eclipse.
We added to that a process by which scripts could be added by dropping javascript files into a well known directory.
We scanned scripts for metadata in specially formatted header comments. Specifically, we found instructions that specified where in the IDE menu hierarchy the script should appear.
We dynamically loaded additional Eclipse packages upon reference in the script. Rino had all the hooks we needed for this and the Java class loader yielded to our will eventually.
/* * Menu: Hello > Bjorn * Kudos: Ward Cunningham & Bjorn Freeman-Benson * License: EPL 1.0 */ function main() { text = "Hello Bjorn\n\n"; text += "The quick brown fox jumped..."; text += "Now is the time for all good men..." Packages.org.eclipse.jface.dialogs. MessageDialog.openInformation( window.getShell(), "Monkey Dialog", text ) }
Marcin Maciukiewicz wrote a nice introduction in his blog post, Scripting Eclipse with the Monkey Project: An Introduction, on dzone .