I wrote a simple DOM to write message to Eclipse console from a Monkey Script.
I have not yet created an update site for it so you have do download it and install it in your plugins directory manually.
It provides a out variable that you can use to write to a console.
Here is the mandatory “Hello, World” example:
--- Came wiffling through the eclipsey wood ---
/*
* Menu: Console > Hello
* Kudos: Jeff Mesnil
* License: EPL 1.0
* DOM: http://jmesnil.net/eclipse/updates/net.jmesnil.doms
*/
function main() {
out.print("Hello, ").println("World");
}
--- And burbled as it ran! ---
and its output


May 22nd, 2007 at 15:55
Jeff,
I ran across your site while digging around for monkey scripts. I downloaded the plugins from the update site, but when I run the sample, it throws the error “The script test.em requires this missing DOM plugin: org.eclipse.dash.doms”
I’ve scoured the internet and I can’t find this anywhere. I know this is off-topic, but I thought you may know. Here’s the script I’m running,
Thanks in advance,
Jon
/*
* Menu: Maven > Make Maven Targets Derived
* Kudos: Donnchadh
* License: EPL 1.0
* DOM: http://download.eclipse.org/technology/dash/update/org.eclipse.dash.doms
*/
function main() {
var files = resources.filesMatching(”.*/pom\.xml”);
var targetFolder;
for each( file in files ) {
if (targetFolder = file.eclipseObject.parent.findMember(”target”)) {
targetFolder.setDerived(true);
}
}
}
May 23rd, 2007 at 9:04
Hi Jon,
since the time I wrote this script, the DOM URL has changed.
In your script, I replaced:
by
and it worked as expected.
May 23rd, 2007 at 19:38
Beautiful! Thanks a ton. I’m not sure why I couldn’t find this documented anywhere. Is it?
Jon
May 24th, 2007 at 8:03
The only place I saw this DOM was in the script examples generated by Eclipse Monkey.
As an aside, this DOM directive is really misleading: it is not the real URL of a plug-in.
It is composed in fact of 2 things:
In the case of
http://download.eclipse.org/technology/dash/update/org.eclipse.eclipsemonkey.lang.javascript, that means that Eclipse Monkey will connect to the update sitehttp://download.eclipse.org/technology/dash/update/and asks the user to choose among the features listed by the update site (in thesite.xmlfile) the one which contains theorg.eclipse.eclipsemonkey.lang.javascriptplug-in (in that case, theorg.eclipse.eclipsemonkeyfeature).–
jeff