Archive for the ‘swt’ 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 |
Announcing a new release of SWTBot
You can download the latest and greatest from the SWTBot download page.
A listing of some of the new features available:
Bug 263036 – SWTBot finally has an icon that was missing since two years!
Bug 269919 – Added support for toggle buttons
Bug 271246 – Better support for handling editors. This should serve as a good start towards providing support for multipage, forms based editors
Bug 271132 – Using Display#post() to support sending native click events instead of fake events. This is still work in progress and not all widgets support native events yet.
Bug 273624 – Use native keyboard events for typing. SWTBot currently defaults to using AWT robot. SWT’s Dispay#post() is available as well — it is however buggy across platforms and swt versions. Since SWTBot uses native keyboard events, it needs to understand various Keyboard Layouts.
Bug 267189 – Support capturing screenshots of widgets.
Bug 277093 – Support for Link widgets.
There are also a lot of minor bugs that were fixed in this release.
SWTBot 1.2.0 released
For the impatient:
Direct download link: https://sourceforge.net/project/showfiles.php?group_id=188411&package_id=220519&release_id=622752
Update site: http://swtbot.sourceforge.net/latest/update-site/
SWTBot 1.2.0 is the 3rd of the 1.x releases of SWTBot was released last night, and there have already been about 200 downloads by the time of writing this blog post.
SWTBot has always believed in release early release often mantra, and pushes out nightly builds out of CruiseControl. From the download stats I’m looking at, there are more downloads of the nightly build than the ‘stable’ available on the sourceforge mirrors.
The highlight of the release is support for view menus and view toolbar.
Thanks to the contributors and adoptors, for patches, criticism, and suggestions for improvement. The release has fixed about 42 issues.
Read more on the detailed release notes and the changelog.
Announcing SWTBot 1.0
I just made new release of SWTBot – 1.0
Direct download link: http://sourceforge.net/project/showfiles.php?group_id=188411&package_id=220519&release_id=601136
Update site: http://swtbot.sourceforge.net/latest/update-site/
Some features:
- A recorder API — now you can record SWTBot scripts. Still in beta though.
- Better SWTBot integration in eclipse — now you can run tests within eclipse.
- More API — now you can use more SWT controls using an even richer API.
- More stable than before.
For more details, you can read up on the release notes here.
SWTBot 1.0 out soon…
So I’ll be doing a release of SWTBot 1.0 sometime soon
After quite some rigorous tests on a real life project I believe it’s now quite stable enough to be called a major release.
A lot of folks have asked me if there’s a way I could provide any intermediate builds as and when fixes are checked in into trunk. To address this issue, I’ll be putting in some build scripts to push builds out of the CruiseControl running at ThoughtWorks.
Watch out for this space for an announcement about this…
What’s next, I hear there’s something called eSWT and eRCP out there, there’s also some search engine company doing something similar