Twitter Logo Follow us on Twitter
Project Information About this project

RAP 3.1 M5 - New and Noteworthy

Here's a list of the most noteworthy things in the RAP 3.1 M5 milestone build which is available for download since February 05, 2016.

New service interface ClientFileLoader

Custom widgets often require their own CSS file to be loaded on the client. We already supported loading Javascript files using the JavaScriptLoader service, but we had no service to load CSS files.

So we've introduced a new service interface named ClientFileLoader that can load both, JS and CSS files. The service provides two methods, requireJs and requireCss, that both accept a URL to load. The ClientFileLoader ensures that every file is loaded only once per session, so you can safely use it in the constructor of a custom widget.

ClientFileLoader loader = RWT.getClient().getService( ClientFileLoader.class );
loader.requireJs( JS_URL );
loader.requireCss( CSS_URL );

This new service replaces the existing JavaScriptLoader service, which has been deprecated.

Badge support for CTabItem

The CTabItem widget now supports badges:

Badges on CTabItems

Those badges can be set using a data key:

ctabItem.setData( RWT.BADGE, "7" );

The given string is displayed at the top-right of the item. To adjust the look of badges, the Widget-Badge element can be used. It currently supports the properties font, color, background-color, border and border-radius.

Partial redraw

The implementation of method Control#redraw(int, int, int, int, boolean) has been improved. Now, only the provided rectangle is redrawn on the client without clearing rest of the drawing area.

Use API extensions to replace RWT utility classes

In those rare cases where RAP requires a slightly different API than SWT, we've used to provide additional methods in utility classes like BrowserUtil and DialogUtil. These utilities contain non-blocking version of the SWT methods Browser.evaluate() and, that are needed for the JEE compatible mode. We avoided making extensions to classes and interfaces from SWT.

Reconsidering this approach, we think that it makes the developer's life harder, as these methods cannot be found directly, and the separation does not bring a real advantage. So we decided to take the freedom to add those few extensions directly to the SWT classes. For example, instead of: dialog, returnCode -> {
  if( returnCode == SWT.OK ) {
    // do something

you can now write: returnCode -> {
  if( returnCode == SWT.OK ) {
    // do something

The non-blocking methods are now available on Dialog and Browser, respectively. DialogUtil and BrowserUtil have been deprecated.

New Chart component in Incubator


A new component for creating charts has been added to the RAP Incubator. It provides an extensible class Chart that is based on the famous D3.js library. Moreover, it contains some basic chart widgets that use NVD3, a chart library that builds on top of d3. Currently, there is a PieChart, a BarChart, and a LineChart widget with a basic set of properties, that is going to be extended.

See the blog post for details.


This list shows all bugs that have been fixed for this milestone build.

Previous Builds

The above features are just the ones that are new since the last milestone build. Summaries for earlier builds: