Archive for the ‘eclipse’ tag
JRuby and static imports
The last few weeks have been interesting working with SWT and some newly acquired (J)Ruby chops, to hack together a couple of approaches to build a recorder for SWTBot. Here is one of the interesting hacks which was cobbled together:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | require 'java' module Recorder module SWTInitializer include_package 'org.eclipse.swt' include_package 'org.eclipse.swt.layout' include_package 'org.eclipse.swt.widgets' include_package 'org.eclipse.swt.custom' include_packate 'org.eclipse.swtbot.swt.finder' # loop through a few known classes to implement static imports def method_missing(method, *args, &block) klass = [ org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory, org.eclipse.swtbot.swt.finder.utils.SWTUtils].find do |k| k.respond_to?(method) end return klass.send(method, *args, &block) if klass super end end end |
To use this class:
1 2 3 4 5 6 7 8 | class Application include Recorder::SWTInitializer # the with_text invocation falls into the method_missing # which delegates it to WidgetMatcherFactory def self.run SWTBot.new().widgets(with_text('hello')) end end |
SWTBot Release updated for Helios
A new release of SWTBot is now available at a the usual location.
This purpose of this release is to work with the helios release and contains a few bug minor fixes.
A few other improvements were done to improve the code coverage for some plugins that were not tested too well.
Forthcoming releases will improve on the code coverage. Well, the irony.
Code Complexity Visualization for Ruby
Image from http://www.osnews.com/story/19266/WTFs_m
WTF implies lack of clarity. Clear code is easier to understand, easier to maintain and easier to extend.
Announcing saikuro_treemap — an easy to setup tool to generate complexity treemaps of ruby code.
See a demo for yourself.
An embedded interpreter for eclipse
As a java developer who is starting to use ruby and javascript for a lot of things lately — there is one thing I miss most. An embedded shell/interpreter for eclipse!
An embedded console or an interpreter is a very powerful tool, it allows you to do some very interesting things with your software as it is running, play around with it, tweak it and anything else you can ever imagine. All of this without the edit-save-compile-relaunch cycle.
Lately I’ve been working on an embedded console for eclipse. The primary motivation was to try out scripting approaches for SWTBot. But I soon realized that I was using it for more than just scripting tests. I was using it to learn how eclipse works, try out different approaches to decide which one is best.
Some of the features include code completion, history lookup. This is possible using jruby’s objectspace and the readline support.
Here’s a small teaser video of what you can do with it an embedded jruby console for eclipse.
SWTBot and Eclipse 3.4 (Ganymede)
SWTBot has so been supporting Eclipse Ganymede since the last 2+ years before it moved to eclipse.org.
Ganymede is now almost 2 years old and the last bug fix release was in Feb 2009.
There has been a Galileo release of Eclipse in the Summer of 2009, and there is a new release Helios coming up the horizon.
Given this situation, it is very difficult to continue to provide a light weight testing tool that works across 3 different versions of eclipse on 4 different platforms linux, windows and macosx(carbon/cocoa) while backporting APIs that only work on newer eclipse versions.
In light of this, I’m considering dropping support for eclipse 3.4 for future releases. I’m happy to assist anyone wanting to contribute efforts towards maintaining a release of SWTBot for Ganymede.
The v2.0.0.568 of SWTBot made last night would be the last that supports Ganymede.

