Differences between RWT and SWT

Introduction to the RAP Widget Toolkit

At the core of RAP operates the RAP Widget Toolkit (RWT), which largely implements the same API as the Standard Widget Toolkit (SWT). That is why many projects that build upon SWT (like JFace) can run on RWT with little or no modifications. It can also be used with or without the Eclipse 3.x workbench layer.

Note that RWT refers only to this widget toolkit, while RAP refers to the project in its entirety, including its ports of JFace, Workbench and Forms, OSGI integration, add-ons, Branding and Interaction Design API, tooling, demos and custom themes.

RWT implements most (40+) SWT Widgets, including their events and layout manager. It also supports SWT-like key and mouse event handling, drag and drop and painting (on Canvas). If you are not already familiar with SWT, we recommend to first learn the SWT basics (almost all valid for RWT) by reading the official documentation and snippets provided by the SWT project homepage. A full reference specific to RWT can be found here.

Compatibility to SWT

RAP generally follows the rule If it compiles, it works. That means that all SWT API implemented in RWT is working within the requirements set by SWT. If an SWT feature is not implemented, the corresponding API is also missing. If this is the case, it is likely because it's hard or impossible to implement in RWT. In some cases, SWT classes and methods are implemented as empty stubs to enable single-sourcing, but only where this is a valid according of the SWT documentation of the API. Examples are the accessibility API and some SWT constants that are marked as HINT.

SWT was developed for desktop applications, but RWT is used to build web applications. For this reason, there are some features that SWT supports that RWT does not, while RWT adds some features that are tailored to the specific requirements of web application development. However, RWT does not add any new API to the classes adopted from SWT. All RWT-specific features are accessible by API in the namespace org.eclipse.rap.rwt. Many are activated using a widget's setData method with a constant from the RWT class as the key. Example:

table.setData( RWT.MARKUP_ENABLED, Boolean.TRUE )

Other additional features may be accessed via client services.

Notable Additional Features

Notable Limitations