Drawing Hands by M.C. Escher (1948)

Jeff Mesnil

Archive for March, 2006


workspace and window variables in Eclipse Monkey

On March 19th, 2006 in eclipse (2 Comments »)

I’m playing with Eclipse Monkey and its DOM examples.

At first I did not understood in the Find_System_Prints.em example where the window variable was coming from.
After diving into in the org.eclipse.eclipsemonkey plug-in source code, I found out that it is defined as a standard global variable in RunMonkeyScript.defineStandardGlobalVariables(Scriptable scope) method.
Incidentally, it is the only global variable added by Eclipse Monkey.

The following code is also commented in this method (in version 0.1.6 of the o.e.eclipsemonkey plug-in):

// Object wrappedWorkspace = Context.javaToJS(ResourcesPlugin
// .getWorkspace(), scope);
// ScriptableObject.putProperty(scope, "workspace", wrappedWorkspace);

The workspace variable is instead contributed by the org.eclipse.dash.doms plug-in.

To sum up, window is available for free in your Monkey scripts while you will have to reference the http://download.eclipse.org/technology/dash/update/org.eclipse.dash.doms DOM to have access to the workspace variable.

EclipseCon’06 is approaching

On March 14th, 2006 in eclipse (1 Comment »)

EclipseCon’06 is approaching and I haven’t yet chosen the talks I want to attend. There are so many things related to Eclipse which interest me:

It’ll be hard to choose between so many talks but I’m eagerly waiting to learn more about Eclipse Monkey. Ward Cunningham and Bjorn Freeman-Benson envisioned it as just a team tool but Wayne Beaton is already pushing it and uses it to script a RCP application.

Anyway, see you at EclipseCon’06! And if you’re interested by RCP and TPTP technology, I’ve a short talk about integrating TPTP in a RCP application which might interest you.

Eclipse Monkey has been released

On March 3rd, 2006 in eclipse (No Comments »)

From its Web page:

Eclipse Monkey is a dynamic scripting tool for the automation of routine programming tasks. Monkey scripts are little Javascript programs using either the Eclipse APIs or custom Monkey DOMs.

I downloaded it and installed it on Eclipse 3.1.1 and it is promising.
It seems inspired a lot by greasemonkey and I’d like to see what kind of scripts the Eclipse community will create.

A first script I’d really like to get is to transform code comments like //BUG 12345 into a clickable URL to our bug tracker.

A concrete example of what can be done with Eclipse Monkey is Wayne Beaton’s Flickr script

Kudos to Ward Cunningham & Bjorn Freeman-Benson

Logging templates for eclipse

On March 1st, 2006 in eclipse (No Comments »)

Following Wayne Beaton’s post on more templates with eclipse, here is an example of template that I extensively use in eclipse to ease logging statements. For each logging level (debug, info, warn, error, fatal), I defined a corresponding templates. For example, I have a debug template:

if (logger.isDebugEnabled()) {
   logger.debug(${cursor});
}

It makes it simpler and quicker to write logging statements. However the class won’t compile if a logger field has not already been defined. But in that case, either you can use eclipse’s quick fix… or create a new template to define the logger.