Twitter Logo Follow us on Twitter
Project Information About this project

RAP 1.4 - New and Noteworthy

Here's a list of the most noteworthy things that will be available with RAP 1.4 (June 22, 2011).

This list shows all bugs that were fixed for this release so far.

    New API added

    This will make it easier for the community to reuse existing code or to utilize new features. Here is a list of API methods added in 1.4:
    • FontData() constructor
    • FontData#setName(), FontData#setHeight(), FontData#setStyle(), FontData#setLocale()
    • Display#getSystemTray()
    • Tree#getTopItem()
    • Tree#setTopItem( TreeItem )
    • TreeItem#getImage()
    • Tree#getGridLineWidth()
    • Text#setTextChars( char[] )
    • Text#getTextChars()
    • Browser#evaluate( String )
    • Browser#addProgressListener( ProgressListener )
    • Browser#removeProgressListener( ProgressListener )
    • GC#drawText() now supports SWT.DRAW_MNEMONIC style flag.
    • CLabel#setBackground( Color[], int[] )
    • Browser#getWebBrowser()
    • Image( Device, int, int ) constructor
    • GC#setAdvanced( boolean ) and GC#getAdvanced()
    • Display#getAppMenuBar()
    • Display#getSystemTaskBar()
    • Control#getOrientation() and Control#setOrientation( int )
    • Menu#getOrientation() and Menu#setOrientation( int )
    • Menu#getDefaultItem() and Menu#setDefaultItem( MenuItem )
    • Button now supports SWT.WRAP style flag.

    New Tree implementation

    We have a new implementation of the SWT Tree widget which is faster, more flexible, and provides many new features:
    • Item and cell colors/fonts
    • Item height does adapt to font / image size now
    • SWT.FULL_SELECTION support
    • Gridlines
    • Themeable indentation symbols (treelines, expand/collapse icons)
    • Improved SWT.VIRTUAL support makes big trees load much faster

    Improved iPad/iPhone support

    While RAP was already running on iOS before, it was barely usable. For this release the following improvements were made:
    • Fixed layouting bugs.
    • Fixed mouseclick emulation.
    • Added fullscreen support
    • Enabled native drag-and-drop behavior for ScrollBar, Shell, Sash, Scale, Slider, TableColumn anmd TreeColumn.
    There is no support for the SWT Drag and Drop API on iOS-devices.

    It is recommended to increase the size for the draggable elements to make them easier to hit with a finger. (See also "New Themeable Scrollbars".) Since this can be done using only theming, its possible to target mobile and desktop clients with the same application, but different themes.

    To run a RAP-application can in fullscreen-mode, simply touch the "+", select "Add to Home Screen", and start it from there. Note that pinch-zoom is disabled in fullscreen-mode

    CSS3-Support

    RAP now uses CSS3 to render rounded borders, gradients and shadows in Safari (including iPad/iPhone) Google Chrome (including Android), and Firefox 4. Other browser still use vector graphics. In Internet Explorer 9 CSS3 might be supported in the future.

    This also enables basic support for Anroid 2.x devices.

    New Default Theme

    After introducing the Business and Fancy Design with RAP 1.3, RWT gets a new default theme with M2. The new default theme is a migration of the existing Business theme. The old theme is still available as a separate bundle called org.eclipse.rap.rwt.theme.classic.

    New Default Theme:

    Classic Theme:

    To activate the classic theme simply add the bundle to an exsiting launch configuration and change the servlet name to "classic". An alternative way to use the classic theme is to create an own branding and set the themeId to org.eclipse.rap.rwt.theme.classic.

    General Theme Extensions

    The theming was extended in serveral places:
    • It's now possible to style the separator label like:
        Label[SEPARATOR] {
          ...
        }
              
    • The Label has a new themeable element called Label-SeparatorLine. It's possible to style the background image (gradient), background color, border, border radius and line width.
      For example:
        Label-SeparatorLine {
          background-image: none;
          background-color: transparent;
          border: 1px solid #a4a4a4;
          border-radius: 0px;
          width: 2px;
        }
              
    • MenuItem has a new themeable property background-image.
    • Table border is now themable, but border-radius property is still not supported.
    • opacity property has been added to buttons.
    • The themability of the Sash has been improved. background-image and background-color properties have been added to Sash element. :hover state is now supported:
    • It's now possible to set a background image or gradient for the list items:

    Shadows

    RAP-Theming now supports shadows on the following widgets:
    • Shell
    • Menu
    • Widget-ToolTip
    • ToolTip
    • Combo-List
    • CCombo-List
    Shadows can have configurable horizontal offset, vertical offset, blur-radius and color. In Internet Explorer the blur-effect might look slightly different due to technical limitations. Shadow also supports transparency using the rgba notation for color.

    New Themeable Scrollbars

    A new client-side scrollbar implementation replaces the previously used native scrollbars in almost all widgets. It features a number of improvements:
    • It looks and behaves the same on every client, regardless what operationg system or window system there is.
    • The new scrollbar is fully themeable. This is also another step in our effort to support mobile devices: the scrollbars can be made wider, so that they are easier to use on touch-interface.
    • It improves scrolling for Tree and Table by automatically adapting to the clients performance.

    FileUpload widget

    The widget org.eclipse.rwt.widgets.FileUpload has been introduced. This is a very basic, button-like component that lets users select a file from their local file system. This file can then be programmatically uploaded to a given URL.

    To accept and store those files on the server, a server-side component is also needed. This part is not included in the FileUpload widget itself. A default implementation is currently being developed in the RAP Incubator and will be made available soon. An implementation of the SWT FileDialog, based on the new FileUpload widget, is also under development in the Incubator.

    ToolTip widget

    RWT now has an implementation of the ToolTip widget. It represents popup windows that are used to inform or warn the user. The new ToolTip widget is fully themeable.

    Note: By introducing this new widget we had to rename the existing CSS element ToolTip to Widget-ToolTip. This CSS element is used for styling tooltip texts on widgets, as set using Control#setTooltipText(). The new ToolTip widget can now be styled with the CSS element ToolTip.
    This change was necessary to remain consistent within our naming scheme. Please update your custom themes accordingly.

    Optimized client

    RAP is now using a new Javascript-compressor (based on the YUI Compressor), and we also refactored/removed a lot of existing Javascript code. These two actions reduced the size of the client from 984 kB to 909 kB.

    The client's logging system has been drastically simplified in order to reduce client-size. RWT itself does not use the logging anymore, but a rudimentary implementation is still in place for custom-widget developers. As a result of these changes, the RWT log-levels are no longer supported. When RAP is started in the Debug variant, all log-messages are sent to the Browsers Javascript-console, while the Standard (production) variant will not output any logging messages.

    JQuery compatibility

    In the past, using JQuery with RAP (e.g. for custom-widgets) was very problematic because "$" was used by both RAP and JQuery as a global variable. RAP is not doing this anymore, so if you wish to use JQuery, now you can.

    Application Scope

    The internals of RWT have been changed so that it is now possible to run more than one instances of RWT in the same Java Virtual Machine.
    Applications that wish to leverage this should no longer use static fields to store instances with application scope. Instead they should make use of the new IApplicationStore.
    Note: for applications using the workbench, these changes don't make a difference as multiple workbench applications cannot be run in parallel in a single virtual machine.

    Response Content Compression

    We decided to entirely remove support for GZIP-compressing response content (bug 342242). Initially, RAP always compressed response content. As it turned out that this interfered with Tomcat and chunked transfer encoding (bug 259977), compression was made configurable to transition from using RAP's compression to using the servlet engines compression feature.
    If you wish to use content compression, please make sure that the servlet container that you deploy the RAP application into, is configured accordingly. Learn here how to enable content compression for Jetty and Tomcat.

    Key Bindings

    We introduced a simple and single-sourcing capable way of adding key bindings to plain RWT applications. In order to instruct the client to issue key events for certain key sequences, a list of active key sequences must be attached to the display using Display#setData() with the new constant RWT.ACTIVE_KEYS.
    The resulting key events can then be handled, just like in SWT, by adding a global key event listener to the display using Display.addFilter(). For details, please refer to the JavaDoc of RWT.ACTIVE_KEYS.
    See also "KeyBindings" in category JFace / Workbench

    AdapterFactory changed scope

    The org.eclipse.rwt.AdapterFactory changed its scope. Until now, it had so called session scope. Each session had its own instance of a registered AdapterFactory. Now, the AdapterFactories live in application scope, meaning that there is exactly one instance of every registered AdapterFactory type.
    Only those applications that register their own implementations of AdapterFactory are affected by this change. The AdapterFactories used by RWT internally have been adapted to this change. For the reasons that led to this change, please see bug 342302: Move AdapterFactory into application scope. We apologize for any inconveniences this may cause.

    JFace and Workbench upgraded to 3.7

    The JFace and Workbench implementations shipped with RAP have been upgraded to the Eclipse 3.7 code base.

    IApplication support

    IApplication support has been changed to use fully qualified application ids.

    KeyBindings

    One of the most requested features in RAP is finally available. It's now possible to use key bindings, for example CTRL+S to save editors. You can define new keybindings using the standard extension point:
    Emacs key sequences are not supported and the emacsAcceleratorConfiguration scheme is missing.
    See also "Key Bindings" in category RWT

    Tooltips for TreeViewer

    The TreeViewer now supports tooltips for its content too. It can be activated by calling ColumnViewerToolTipSupport#enableFor(). Afterwards you need to override CellLabelProvider#getToolTipText(Object) and have it return the respective tooltip text. Other tooltip-related methods (getToolTipBackgroundColor, etc.) are not supported.

    Servlet 3.0 Support

    In order to support new application servers that already ship with Servlet API (javax.servlet.*) 3.0, RAP is now able to leverage the new Servlet specification. Deploying RAP on application servers like Tomcat 7 or Glassfish 3. is now possible.

    New Bundles included

    In order to ease deployment, RAP ships with three new bundles:
    • org.eclipse.equinox.servletbridge
    • org.eclipse.equinox.servletbridge.extensionbundle
    • org.eclipse.equinox.http.servletbridge
    Together with the WAR Product tooling from the Libra project, RAP applications can be deployed as WAR archives with a few clicks.

    IApplication support

    With milestone M1 the RAP launcher supports choosing and launching IApplications.

    RAP Launcher

    We re-organized the Main tab of the RAP launcher and added some new features:

    You can now configure the location of the Instance Area in the launcher's Main tab. The instance area is the OSGi data location, where all bundles of the running application can store their state information. This includes resources that are used by the RAP server, such as images, but also the setting store. By selecting the option Clear the instance area before launching, you can ensure that all these resources are cleared when you re-start a RAP application.

    You can now specify a Context Path in the launcher. The context path is an optional additional path segment that enables you to launch your application with a URL similar to your real deployment environment. As an example, when you deploy an application named myapp on tomcat, it will usually be accessible under an URL like http://server:port/myapp/myservletname, where myapp is the webapp, and myservletname is the servlet name you choose in the branding.

    As you can see from the screenshot, the launcher will now display a preview of the URL that your application will be accessible at in the Browser group box.

    Moreover, servlet names, entry points and applications can be selected not only from the workspace but also from the active target platform.

    The serlvet name, entry point or application is now validated against the selected bundles. The launcher shows an error, if the bundle that provides the selected name is not contained in any of the selected bundles.

    RWT Application Launcher

    The RAP tooling has grown by yet another launch configuration. With the RWT Application Launcher you can run RWT applications with just one shortcut. For those that might not have heard of RWT yet, think of it as SWT/Web. RWT is RAP without the workbench and OSGi, it plays the same role in RAP as SWT does for the Eclipse Platform/RCP.
    To run an RWT application, select a class (e.g. in the editor or package explorer) that implements IEntryPoint and hit Alt+Shift+X 3 (please feel free to file a bug if you find a more suitable shortcut that is not yet taken by another launch configuration). You can also launch an RWT application by selecting a project instead of a class file. You will be prompted to select a class from those classes that define an entry point.
    Besides launching RWT applications, it can also be used to run arbitrary web applications, provided that there is a deployment descriptor (web.xml).

    Target installation

    RAP applications need to be compiled against the RAP runtime. To do so, the runtime needs to be set as the target platform in Eclipse. With this milestone the RAP tooling is able resolve the runtime from our p2 repositories and does no longer include the runtime. This tutorial shows how you can use the RAP target installation tooling.

    FileDialog

    In 1.4, the FileUpload widget has been introduced. But to handle the uploads on the server, you also need a server-side upload component. Such a component is now available in the RAP Incubator.

    To make file uploads really simple, we also provide an implementation of the SWT FileDialog in the RAP Incubator. This FileDialog allows you to select and upload files and makes the uploaded files available on the server. You can include the dialog and its dependencies in your target platform by adding the new Incubator Software Site http://download.eclipse.org/rt/rap/1.4/incubator/ to your RAP 1.4 target.