Tuesday, December 26, 2006

Version 0.4.0 is released

I have released the latest version of Groovy Monkey with the following new features:

Version 0.4.0 - December 24, 2006



  • Added autocomplete for binding variables.

  • Added method autocompletion for bound variables.

  • Now can publish to clipboard directly from the editor.

  • Added a "Save Script To" dialog to allow the user to select where in their workspace they want the script written.



I am also in the process of merging Groovy Monkey with the original Eclipse Monkey, so future work maybe accomplished over there.

Tuesday, December 19, 2006

Quickly remove unwanted markers in your workspace.

I have been asked, "Groovy Monkey why?" Now there are the default answers of API exploration, Eclipse Automation and rapid prototyping, however, now I have a new one: "You think someone will bother to write a plugin to do that?" The following example highlights this feature.

Here is a quick script written whilest I was debugging the Groovy Eclipse Plugin. The problem I had was that the plugin left some markers lying around that I don't want to see anymore.

So you can use this script to parse through your Eclipse workspace and find all the problem markers and then choose to delete those that don't apply anymore. I think it is pretty useful when you are working on plugins or if you downloaded a particularly buggy plugin. Sure does beat shutting down Eclipse, then opening up the $workspace/.metadata/org.eclipse.core.resources/.projects/$projectname/ and then manually deleting any .markers files you find.

To import the script into Eclipse follow the following steps.
First you must have installed Groovy Monkey.

Secondly, then you must select all the text below ( starting with '--- Came wiffling...' and copy it into your clipboard on your browser (Ctrl-C usually works).

Now goto eclipse and under the Groovy Monkey menu select 'Paste New Script'.

Voila it will be incorporated into your workspace and can be run as 'Groovy Monkey > Remove Markers'. Enjoy.




--- Came wiffling through the eclipsey wood ---
/*
* Menu: Remove Markers
* Script-Path: /GroovyMonkeyScripts/monkey/removeMarkers.gm
* Kudos: ERVIN
* License: EPL 1.0
* DOM: http://groovy-monkey.sourceforge.net/update/plugins/net.sf.groovyMonkey.dom
*/
import org.eclipse.core.resources.*

out.clear()
workspace.root.projects.each
{ project ->
out.println "${project.name}"
project.findMarkers( null, true, IResource.DEPTH_INFINITE ).each
{ marker ->
out.println " ** ${marker.type} ${marker.id} ${marker.attributes}"
if( marker.type == 'org.codehaus.groovy.eclipse.groovyFailure' )
marker.delete()
}
}

--- And burbled as it ran! ---