Twitter Logo Follow us on Twitter
Project Information About this project

RAP 3.1 - New and Noteworthy

Here's a list of the most noteworthy things in the RAP 3.1 release which is available for download since June 22, 2016.

Minimum Requirements

Move org.eclipse.rap.jface.databinding to Java 8

The underlying platform bundles org.eclipse.core.databinding.* now require Java 8. The Bundle-RequiredExecutionEnvironment (BREE) of "org.eclipse.rap.jface.databinding" bundle has been updated to JavaSE-1.8.

Application Development

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.

Use API extensions to replace RWT utility classes

In those rare cases where RAP requires a slightly different API than SWT, we used to provide additional methods in utility classes like BrowserUtil and DialogUtil. These utilities contain non-blocking versions of the SWT methods Browser.evaluate() and Dialog.open(), 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:

DialogUtil.open( dialog, returnCode -> {
  if( returnCode == SWT.OK ) {
    // do something
  }
});

you can now write:

dialog.open( 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.

Incubator Projects Migrated to RAP Core

Nebula RichTextEditor

The RichText widget has been graduated as Nebula RichTextEditor and moved from the RAP Incubator to the RAP repository. It supports a subset of the API from the RichTextEditor found in the Nebula Release.

The RichTextEditor is included in the RAP target platform and can be used simply by importing the org.eclipse.nebula.widgets.richtext package.

Widget Set

Right-to-left support

In this release we added support for right-to-left orientation to all widgets. Like in SWT, the coordinate system of an RTL Composite is mirrored horizontally (the [ 0, 0 ] point is on top-right corner).

RTL Tree

Support for alpha in Color

Support for alpha in Color has been added to SWT in Mars. As RAP client supports RGBA natively, we added the missing API:

  • RGBA class
  • constructor Color(Device, RGBA)
  • constructor Color(Device, RGB, int)
  • constructor Color(Device, int, int, int, int)
  • getAlpha()
  • getRGBA()

Add support for more image formats

The internal org.eclipse.swt.internal.image package has been updated to the latest SWT sources, which provides support for more image formats like 256x256 px ICOs.

Transformation Support for Canvas

GC now implements the setTransform method.

Transform transform = new Transform( display );
gc.setTransform( transform );
gc.setBackground( display.getSystemColor( SWT.COLOR_BLACK ) );
gc.fillRectangle( 0, 0, 100, 50 );

transform.rotate( 10 );
gc.setTransform( transform );
gc.setBackground( display.getSystemColor( SWT.COLOR_RED ) );
gc.fillRectangle( 0, 0, 100, 50 );

transform.rotate( 10 );
gc.setTransform( transform );
gc.setBackground( display.getSystemColor( SWT.COLOR_YELLOW ) );
gc.fillRectangle( 0, 0, 100, 50 );

Graphics Transformation

Column Span Support for Nebula Grid

GridItem now implements the setColumnSpan method. The Grid itself has been given a more spreadsheet-like default look to better work with this new feature. It is now also separately themeable (previously shared a theme with Tree).

Grid column spanning

Selection Theming update for all Table/List-based Widgets

Tree, Table, Grid, List, Combo, CCombo and DropDown have a new default theming for selected items. Instead of a dark-blue gradient a solid, semi-transparent light blue is used. This preserves the color of the text elements (they are no longer set to white) and allows elements like cell backgrounds that are normally hidden beneath the selection effect to shine through. It also works better with the new Nebula Grid look. The business theme remains unchanged.

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.

Support for native HTML document overflow behaviour

For better support of RAP applications that look like normal web sites, we added a possibility to enable native HTML document overflow behaviour. To enable it, a new property WebClient.PAGE_OVERFLOW with one of the values "scroll", "scrollX" or "scrollY" must be set to your application.

public class MyApplication implements ApplicationConfiguration {

  @Override
  public void configure( Application application ) {
    Map properties = new HashMap();
    ...
    properties.put( WebClient.PAGE_OVERFLOW, "scrollY" );
    application.addEntryPoint( "/", MyEntryPoint.class, properties );
  }

}

Bugfixes

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