I finally sat down and spent two hours on using SWTbot. It is a automatic GUI testing tool for RCP/SWT programs. If you are writing AWT/Swing programs, it’s not for you. For AWT/Swing, you may want abbot.
I experienced several problems with setting it up. Finally I installed SWTbot 1.2, configured the launch settings, eliminated a NullPointerException error, and finally got it running. Feeling pretty good now.
SWTbot is being proposed to become an eclipse subproject. The latest version is 2.0. However, you might want to try 1.2 before getting more familiar.
I am looking into DSL (domain specific language) recently. There are a few links below, bookmarked for my own convenience:
- Language Oriented Programming: The Next Programming Paradigm
A good paper introduction to DSL. The language is plain, vivid, and easy to understand. Really a good start point.
- An introductory example of domain specific languages – by Martin Fowler
It’s a very good start point. Martin gives explanations by examples, which make everything clear to understand. There are some examples in XML, ruby-like, and vbscript-like forms.
- The Pragmatic Code Generator Programmer by Sven Efftinge et. al.
Another article for using openArchitectWare Xtext.
- The Help Documentation coming along with the Xtext Framework
Definitely the good documentation to start with Xtext.
- Sven Efftinge’s Blog
Svem plays an important role in developing Xtext, which is a DSL framework.
- More blogs ……
More blogs at ohloh……
- The Xtext Framework: TMF Xtext and oAW Xtext
The former is a subproject of eclipse TMF (textual modeling project). The latter is under the umbrella of OpenArchitectAWare. Definitely there is connection between them. Yes, by the same group of people.
- MPS Project – Developed by a famous European company, they published the paper of the #1 item.
HttpClient looks very nice, as it supports many HTTP actions. I tried the webpage download code, but encountered an encoding issues with Chinese web pages.
Language encoding is always a problem for non-English developers, especially Asian developers, whose languages are encoded in 2 bytes for each character.
After playing with the source code for hours, I finally googled a very simple solution. Here it comes:
HttpClient client = new HttpClient();
HttpMethod method = new GetMethod(url);
// .... set other parameters
int statusCode = client.executeMethod(method);
// other operations
// exception handling
Though spent hours, I am very glad that the solution is very simple.
I am trying to write an XML Editor using JFace Text Framework. I started from the default XML Editor template created by eclipse. The editor is much more powerful than the very beginning. What I have finished during the weekend are:
- Document Partitioning
- Add CDATA scanner
- Configured SourceViewConfiguration
- Modified TagRule and a couple of classes
- Syntax Coloring
- Mimicked the color theme in XMLSpy, but added more colors
- Merged some functions. Therefore a couple of classes are of no use now. Will clean them later.
I wish to add the following features:
- XML validation
- Error marker
- Content Assist
- Proposal for errors
- Define extension points for easy customization
I have created a project at google code. But right now it is not the timing to paste the link here. I might release it in the future.
If you are looking for reference materials about writing an editor, I recommend the following staff:
- Building an Eclipse Text Editor with JFace Text
- Rinzo – Open Source XML Editor
- Java Developer’s Guide to Eclipse, download the CD-ROM content and find the SQL Editor sample:
- Eclipse Web Tools Platform (WTP) has an XML Editor:
- HTML Editor also contains an XML editor: