Browsers in SWT
Oct 7th, 2010 by Eugene Ostroukhov

Browsers are arguably the single most important application in the modern computing. There are many reasons why all major modern UI toolkits provide an integration with one (or several). There are many reasons to use browser in Eclipse RCP or IDE application:

  1. Use it to display static information with rich formatting (i.e. API doc, query result)
  2. Use it to integrate rich web application – either by creating a site-specific browser that connects to a remote server or by serving the application from your Eclipse instance.
  3. To provide better tools for web developers – integrating browser will let you better understand application runtime state and will allow you better explain to user the result of modifications.

SWT has a browser integration for a long time. Actually it has several integrations:

  1. Default System Browser. That’s what you get when you use the org.eclipse.swt.browser.Browser class (without specifying the “MOZILLA” style). This is by far the most stable integration that would cause you the least integration problems. It will wrap OS default browser (IE on Windows, Firefox on Linux and Webkit (Safari) on Mac OS X) – not that it will wrap the OS-default browser, not the browser that the user chose as a default. The biggest issue is that on Windows it turns into pumpkin IE – and you have no control over actual IE version it would become. So you will likely need to avoid some advanced features (including HTML5) and really invest a lot to ensure cross-platform compatibility of your web app code. Another issue is that there is little control over some more advanced browser features – i.e. as an IDE developer you may need to change the security configuration and that is not possible in a unified cross-platform way. Oh, and “default browser” might not be available on some Linux setups (at least that was a case a few years ago).
  2. XULRunner (Mozilla Firefox). This support is baked into SWT (see this snippet) and is triggered by specifying SWT.MOZILLA as a browser style. This browser provides a uniform cross-platform rich web experience but it still has a few shortcomings. First of all, it requires the browser to be installed separately. It will try to use the Firefox from the user OS and that means that you would have little control over the Firefox version – and this is exaggerated by the fact that some newer Firefox versions may break compatibility with older SWT versions and thus force the users to update their SWT-based applications. There are also some pretty irritating issues around integration edges (i.e. FF may grab input focus when you try to refresh it). There is a way to bundle XULRunner with your application if you create your custom bundle or use the one Zend created for ATF project.
  3. WebKit integration. This one gets more and traction as the WebKit is probably the most designed-for-embedding browser engine. SWT uses WebKit on Mac by default and support on GTK was introduced in SWT 3.6. Support for Webkit on Windows is planned for SWT 3.7. I have not tried it yet but it looks like there still will be a problem with the distribution as WebKit has some core components licensed under LGPL, which makes it impossible to be published on
  4. WebKit4SWT from Genuitec. This integration is Windows-only. As far as I understand, it is based on Chromium Embedding Framework so there is a chance that it will be available on other platforms when the upstream project adds those platforms (Valve used same framework for their Steam client and had published Mac source code – but it is not yet integrated into the upstream project). This project is used for Genuitec MobiOne project.
Qt WebKit integration sources published
Sep 30th, 2010 by Eugene Ostroukhov

I created a project on Google Code for the Qt WebKit integration in SWT. At this moment it will only run on Windows and Mac and only if you have Qt SDK installed. I am trying to find a way to either statically link Qt to the DLL or to bundle it in Eclipse Plug-in (it is doable on Windows but doesn’t work for me on Mac).

Current code has a basic browser view that can open pages in WebKit browser, marshal some events and has next/previous/stop/refresh actions. I was focused on more technical challenges (like making sure event queues don’t lock and events are properly propagated). From this point I will be extending API so if there is anybody interested in the component – feel free to participate in the discussion groups and bugtracker to communicate your requirements.

Qt is not only styling…
Sep 22nd, 2010 by Eugene Ostroukhov

…but is also a set of cross-platform widgets.

This is my shot at embedding WebKit into Eclipse SWT:

QWebView embedded in SWT/Win32

QWebView embedded in SWT/Win32

QWebView embedded in SWT/Cocoa32

QWebView embedded in SWT/Cocoa32

This effort is quite different from SWT/Qt as it does not intend to provide whole SWT on top of Qt – my goal is to compliment “native” SWTs with Qt widgets. I believe Qt is a great complement for SWT as:

  1. It has uniform cross-platform API – meaning developers can provide consistent functionality on all major desktop platforms.
  2. It has native look-and-feel – Qt relies on native APIs. My tests had shown that embedding Qt into SWT is more stable then embedding Swing into SWT.
  3. Qt provide a lot of well-tested ready to embed components – QWebView integration is my primary focus right now. It was fairly straightforward to embed full-fledged WebKit browser into Eclipse workbench. I researched other WebKit “bindings” like the Cocoa’s WebKit and it looks like Qt provides most comprehensive APIs of them all.

This project will become an open-source project on one of the OSS hosting sites. I see following issues with the project:

  1. It will be LGPL project. Qt is LGPL and my code statically compiles to some other LGPLed Qt code. There isn’t really a lot of options. LGPL means that no Eclipse Foundation project will ever be able to leverage it. Note: WebCore and JavaScriptCore (they are primary WebKit components) are both released under LGPL meaning that any WebKit binary will always have LGPL code.
  2. Huge size and distribution problems. I have little C++ and Qt experience so I was unable to statically link JNI DLL to Qt libraries. Qt dynamic libraries introduce both distribution and size concerns.

Current state and future directions:

  1. The code will be published after I expose more QWebView APIs to SWT clients and will improve the build configuration.
  2. I plan to focus on QWebKit functionality like QWebInspector and QWebPage
  3. Research other Qt components that are attractive to SWT crowd (native combo with images)?

Help wanted:

  1. Build configuration to produce binaries as small as possible.
  2. SWT/GTK port – I am completely unfamiliar with GTK development so I haven’t even started looking in this direction. It shouldn’t be hard – both Win32-specific and Cocoa-specific parts are a few dozen lines long.
Using expressions in your extension points
Sep 7th, 2010 by Eugene Ostroukhov

Originally I meant to create a reference of the Eclipse expressions and properties available in SDK but there is already such article in Eclipse Wiki. I would strongly recommend bookmarking that article – it is an excellent reference. I would like to describe how you could leverage the expressions in your extension points (when you declare extension points as opposed to providing extensions to platform extension points). There are several reasons to use expressions as a part of your extension point:

  1. Lazy initialization – expression can be tested without activating the plugin that contributed the extension.
  2. External declaration – expressions are declared in the plugin.xml and that sometimes makes it easier to maintain them.
  3. Flexible and pluggable language. Users can leverage org.eclipse.core.expressions.definitions extension point to declare reusable expressions. Users can also leverage org.eclipse.core.expressions.propertyTesters to declare property testers that contain complex logic.

To use expression in your extension point you will need to update your extension point schema file (exsd file) to declare expression language elements. The easiest way is by referencing expression language schema:

<include schemaLocation="schema://org.eclipse.core.expressions/schema/expressionLanguage.exsd"/>

This will import all the elements so you can use them in the extension elements editor:

Expression elmeents in the extension element editorNote that you can specify any expression element as the expression root. I would recommend to using the “enablement” element as this would let you get all changes to expression languages as they appear in the subsequent Eclipse releases. Plug-in developers will see the expressions in the PDE editor after extension point definition is updated.

To test the expression you will need to parse the expression:

IConfigurationElement[] children = configurationElement.getChildren("enablement");
if (children.length == 1) {
    expression = ExpressionConverter.getDefault().perform(children[0]);

Then you will have to create “evaluation context” and evaluate the expression. Evaluation context provides all the variables that are available to the expression – like “activeWorkbenchWindow” and others in the commands framework. You may spacify one object as a “default” (it is “project” variable in my snippet):

final EvaluationResult result = expression.evaluate(new EvaluationContext(null, project));

“result” will be one of FALSE, TRUE and NOTLOADED. NOTLOADED is mostly when the user references the propery tester from inactive plug-in and tells the framework to avoid plug-in activation to instantiate just the property tester.

After this point the user will be able to use the expressions with your extension point just the same way they are used in extension points declared by core Eclipse.

Tools for Mobile Web
Jul 27th, 2010 by Eugene Ostroukhov

We (the Symbian Foundation) proposed a new project – Tools for Mobile Web. We offer our code as a basis for this new Eclipse project and now that we released version 1.0 of our product we would like to focus on this contribution. I would like to better explain what we would like to see out of this project. We did several presentations already so there are some common questions we had to answer.

What is “mobile web”?

In the scope of this project “mobile web” means “mobile web runtimes” that are present on most modern popular smartphones. Developers can use web technologies (HTML, CSS and JavaScript) to create mobile applications. These applications are quite different from the regular web pages in that they are not served from a web site but are installed on the device not unlike regular “native” mobile applications. They can be distributed through the OVI store or other platform-dependent application stores. These application have a broader access to device capabilities – they can access GPS and accelerometer sensor readings, use device-specific UI (i.e. software buttons on Symbian phones), read address book or be notified when SMS or MMS message was received.

Simulator can run web runtime applications and provides basic controls to trigger events

Device simulator

But there is Web Tools Project already!

TWM does not mean to reimplement WTP functionality. We build on top of the WTP reusing all the powerful tools in provides (like JSDT). We focus on adding functionality that is specific to mobile development – like deployment to phone or mobile API simulation.

Will you add support for JQuery UI (or <your other favorite JS library>)?

Our focus is on adding mobile development-specific functionality. We do not plan to implement functionality that users consider “missing” from the WTP. On the other hand we hope to cooperate with WTP and possibly contribute to such areas. Once the WTP gets support for the library then TMW will “inherit” it.

We are watching closely JavaScript frameworks that are more specific to mobile application development. We already added support for PhoneGap framework and we may add support for other frameworks as they mature and gain popularity.

Is there any timeframe on when the tools will be available?

You can already download Tools that support Symbian WRT development. They are feature complete and EPL licensed so we encourage you to try them whether you are a JavaScript developer looking to expand to mobile platforms or an Eclipse enthusiast interested in IDEs for mobile. Currently we are focused on refactoring our code to add support for any number of the runtimes and to prepare it for migration to From that point we will continue development of both Symbian-specific and runtime-agnostic parts.

What about support for other platforms?

We have implemented support for PhoneGap APIs but we only package applications for Symbian platform. Aplix already stepped up to contribute support for BONDI runtime. We expect other interested parties to contribute support for other platforms.

What can the IDE do?

It is a fully integrated IDE that supports application development cycle from creating a new application project to deployment on the device or packaging for distribution.

IDE main screen

Main screen

Our editing experience is based on WTP were we extended JSDT with the support for mobile libraries and added CSS validator and application manifest validator.

Another important part is the simulator and debugger that are built into our IDE. It can be used as a live preview of your application or as a runtime for debugging. Our primary goal was to reduce overhead of the mobile application development so we chose to use desktop browser (Chrome) to ensure maximum debugger performance. We understand that this approach is not completely accurate but it had proven to be “good enough” for debugging of the vast majority of the tasks. We plan on adding on-device debugging in one of the next releases.

How do I start using this IDE?

Follow this link for up-to-date information on using our IDE. Do not hesitate to contact us on our forums or submit bugs to bugtracker.

How is this IDE related to other solutions for WRT development (i.e. Nokia plug-in for Aptana, Dreamweaver)?

Our code owes to a large degree to Nokia code contribution. Our initial goal was to achieve feature-parity with Aptana-based solution. We added several important features including PhoneGap support and acceleration events simulation that were not available in the original code.

Why open-source?
Jun 4th, 2010 by Eugene Ostroukhov

The first questions developers ask about out new Mobile Web IDE is “why do we need another solution?” This question is really justified provided there are already several established alternatives in all shapes and sizes.

Our answer is that we wanted to have a completely open-sourced tools – and that leads to another question. “Why should we (as users) care?” Now that open-source is not that much of a buzz-word it used to be most users don’t really care if they can see the source code – they are more concerned with usability and ROI. This is what we hope to achieve with our project:

  1. Single all-in-one download for every platform. All you need to install our IDE is to download ZIP file for your platform and to unzip it anywhere on your filesystem.
  2. Use latest-and-greatest upstream projects available from the community. We use JSDT for JavaScript editing, Chrome Java SDK for debugging, W3C CSS validator for validation.
  3. Use our codebase for an effort to provide a reference IDE for mobile web development. We want to contribute our project to serve as a basis for Eclipse project that will foster development of similar IDEs for different runtimes. Currently all major mobile platforms provide a way to create and deploy applications using web technologies. Until this point there was a separate IDE for each platform and we hope our project will encourage cooperation and ultimately result in better tools and consistent user experience.

We have a lot of plans that should justify having “yet another” Mobile Web IDE even more:

  1. Support other mobile APIs. Currently we are working on out-of-box PhoneGap support but we will also consider other APIs and runtimes.
  2. Improve preview and simulation. We are working on support for more sensors and mobile APIs.
  3. Streamline UI.

So we encourage you to give the IDE a try. You can post your comments and suggestions to our forum. We would be grateful for any bug reports posted to our bugtracker.

“Participate in community!” they said…
Dec 11th, 2009 by Eugene Ostroukhov

I see a lot of discussion in the blogs on how to invite new developers to participate. They all are talking about people being reluctant to do development, making the site interface more inviting – but really, is this the biggest problem? I wonder, does anybody think obscure location of the CVS URL would really stop anybody from trying to enhance the favorite framework?

Consider this (the ones that I remember):

Bug 287887 – I haven’t seen response like “why would anybody want this” or else. The patch was submitted 3 months ago.

Bug 155479 – several commercial projects would like to see it. Patch was submitted in April.

Bug 166906 – pretty irritating bug. The patch was submitted four years ago.

Note – these are patches to make Eclipse better from the end-user POV. It’s not the patches to make Eclipse frameworks more open for extension so we can build better products on top of it – I’m pretty sure that most commercial developers know that there is next to no chance to get such change into

The result is quite simple. I joined a new company recently and from the start I say – do not expect the to cooperate. We need to consider a way to branch projects we use – before we reach the point it is not possible to deliver proper product to our customers because the framework was not designed to support something.

I believe there should be a strict policy in for handling patches – i.e. the projects should commit to responding for the patch in 2 weeks or one month – and either describe what’s wrong or to incorporate the patch into main repository. Otherwise there will be many Eclipses – Git makes it really simple.

And I’m not mentioning this: 262846 – pure enhancement to make simple API for the popular feature. I submitted this one in February – and I missed some deadline. The result? Even in the best-case scenario I won’t be able to use this in my commercial product till Summer 2010 – 1.5 years. That’s if we don’t consider that the chances of this bug being committed are still slim. So why bother? 1.5 years is a long time.

Release names
Nov 17th, 2009 by Eugene Ostroukhov

I wonder if I’m the only one who can’t remember fancy names for Eclipse releases – Europa, Ganymede, Galileo, Helios. I think it’s not really good that there’s no easy way to memorize them (I wonder if they were meant to be in alphabetical order – if not for “Ganymede” and “Galileo”). Eclipse releases annually – so why doesn’t it has name like “Eclipse 2007”?


Name Platform/JDT/PDE CDT WTP BIRT Site
Callisto 3.2 3.1 1.5 2.1 link
Europa 3.3 4.0 2.0 2.2 link
Ganymede 3.4 5.0 3.0 2.3 link
Galileo 3.5 6.0 3.1 2.5 link
Helios 3.6 link
WTP Frameworks Not Only For Web
Oct 15th, 2009 by Eugene Ostroukhov

WTP is a huge codebase with a lot of ready solutions for the problems that many Eclipse plug-in developers face. Unfortunately to me it looks like these solutions are not picked up as the people consider WTP only to concern with web site authoring. I would like to list some frameworks I believe are useful in all areas where Eclipse is adopted:

1. Faceted Project Framework

(Link to tutorial)

facetsEssentialy Facets are project natures – only on steroids. Project natures can easily be added to a project and you can test if the project has specific nature – but the facets framework provides so much more:

  1. Well defined facet lifecycle. Facet can be added, removed, upgraded you can define interdependence between facets. All done using clean API.

  2. UI. You don’t need to implement your own menu action cramming the toolbars and confusing the user. You can contribute wizard pages that users will be able to invoke either when creating new project or when editing project properties. Sure, it is still possible to create custom action, wizard, etc.

As far as I understood this framework will be a basis for a projects framework in E4. I believe that will really streamline Eclipse user experience in many ways.

2. Structured Source Editing Framework

(Link to subproject page)

sseExtremely great source editors for XML, XSL, JSP, HTML, CSS, XSD – and other files. The editor has rich navigation & editing features JDT user would expect and is also extremely extensible. If you need to create an editor for XML-based file type you can pick the SSE XML editor and start customizing in small increments – outline view, content assistant, auto edit strategies, formatting, validation, hyperlinks. SSE editors can be embedded into multipage editors. Model management facilities can be used outside of the editor itself (i.e. from some toolbar action) and will help avoid conflicts when user did some change to the file that is already opened in the editor.

It is also possible to use custom parser to create editor for non-XML files.

I believe that SSE is long overdue in core Eclipse platform – PDE editor and ANT script would really benefit from reacher source editing capabilities (i.e. formatting).

3. Validation Framework

(Extension point description)


This framework provides a clean and easy way to add build-time validation to workspace resources. This way project will have only one validation builder attached to it and it is easy to change the set of validators between product versions. The framework will handle dull tasks like markers management (i.e. there’s no need to remove the markers after the user fixed the problem) and properly call the validator on manual or auto build. There is also UI to manage validators on workspace and project levels.

Export Limitation?
Jul 6th, 2009 by Eugene Ostroukhov

I live in Ukraine. I use Amazon for ages – but at last I found top-secret book that it seems like can’t be exported from US:


I know no other Eclipse/Java/Cocoa/whatever book that can’t be exported from US. There should be something really big in this one – if only I find some bookstore that would smuggle it here for a decent delivery price…

»  Substance:WordPress   »  Style:Ahren Ahimsa