eSWT overview

In Symbian devices, embedded Standard Widget Toolkit (eSWT) has been implemented from 3rd Edition FP2 onwards as an alternative UI component toolkit to LCDUI user interface component toolkit.

eSWT is a part of eRCP project in the Eclipse open source community and it is a strict subset of the desktop-oriented Standard Widget Toolkit (SWT) API combined with SWT Mobile Extensions package. The standard SWT was developed in connection with the Eclipse Project and was, for example, used to build the Eclipse IDE. The design philosophy and usage of eSWT are the same as for SWT.

In a desktop environment, the SWT is an alternative to the AWT and Swing Java GUI toolkits. It consists of UI elements – called widgets – and methods for arranging and manipulating them. To display the widgets, the SWT implementation accesses the native UI libraries of the operating system. The eSWT API follows similar guidelines, applied to mobile environment. SWT and eSWT share the same APIs, making the mobile applications developed with eSWT portable to desktop environment.

The eSWT API is implemented on top of CLDC, which combined with MIDP is the most common Java™ ME configuration. Common Java development tools can be used for eSWT development.

The core of eSWT consists of basic widgets that you can combine to create different user interfaces such as business forms, text editors, and image viewers. These basic widgets include items such as buttons, labels, and lists. You can organize widgets on the screen by using either absolute or relative positions.

For more information on how to create applications using the eSWT API, see section Using eSWT.

eSWT key features are:

  • Native look and feel

    Since eSWT widgets are implemented using native Symbian platform widgets, the look and feel of an eSWT application automatically matches that of the user interface used by the device it runs on.

  • High performance

    Because eSWT uses mostly the native implementation, it adds minimal overhead to native widget handling. Consequently eSWT stores less state information, since part or all of that data is stored by the native side.

  • Portability

    eSWT aims to be portable among different platforms. This is made possible by a unified API that is common to all platforms. When certain SWT widgets or features are not natively supported in a particular operating system, they can be emulated by the SWT implementation, so that applications become binary compatible. This, however, may depend on the packages installed on the device.

  • Low-level graphics support

    The eSWT toolkit includes a low-level graphics API containing facilities for drawing on canvases. This allows operations such as drawing lines and circles, writing text, or displaying images. These facilities are commonly used by applications that need to use drawn custom shapes on the screen but can also be used to create custom widgets if necessary.

  • Customizable UI components

    eSWT provides full control over the location and size of the UI components. In addition, focus traversal scheme can be customized by the application.

Figure: eSWT UI architecture

The eSWT package is divided further into three components. This division allows for configuration flexibility to and inclusion of components based on device capability and purpose. All components are provided in a single JAR file. Mobile applications using both Core and Expanded eSWT APIs are portable to desktop.

eSWT package contains the following components:

  • Core eSWT

    Core eSWT includes the basic SWT classes and a set of most commonly used widgets such as buttons and text fields. Additionally, Core eSWT contains low-level graphics APIs, layouts, and the event model.

    Core eSWT is all that is needed to build applications for most devices. Since Core eSWT is a required package for all eSWT implementations, applications using only the Core eSWT are likely to be compatible across many devices.

  • Expanded eSWT

    Expanded eSWT includes a set of advanced widgets such as tables and trees. Since this component is optional, its widgets may not be available on all devices. Symbian platform supports Expanded eSWT.

  • SWT Mobile Extensions

    The SWT Mobile Extensions are a collection of widgets commonly used on mobile devices, but are not always found on desktops. These widgets are adapted to mobile device screen types and input mechanisms. These include widgets such as commands, full screen Shells, and tabbed dialogs. MIDlets that require this package are not portable to desktop environment unless a compatibility library is included.

For the full list of supported classes in the three components, see the eSWT API specification.