In S60 devices, eSWT (embedded Standard Widget Toolkit) has been implemented from 3rd Edition FP2 onwards as an alternative UI component toolkit to LCDUI. eSWT is a part of eRCP project in the Eclipse open source community and it is a strict subset of the desktop-oriented SWT (Standard Widget Toolkit) API combined with SWT Mobile Extensions package. The standard SWT has been developed in connection with the Eclipse Project and it has been used to build the Eclipse IDE, for example. The design philosophy and usage of eSWT are the same as in SWT.
On 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 JavaTM ME configuration. Common Java development tools can be used for eSWT development.
The core of eSWT consists of basic widgets that can be combined 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. Widgets can be organized on the screen either manually using specific positions, or with the help of layouts that keep a relative order on the screen.
For more information on how to create applications using the eSWT API, see section Using eSWT.
The key features of eSWT are as follows:
Native look and feel
Since eSWT widgets are implemented using native S60 platform widgets, the look and feel of an eSWT application automatically matches the look and feel of a device and is customizable.
High performance
Since the library uses the native implementation for most of the work, eSWT adds minimal overhead to native widget handling. This also means that 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.
The eSWT package is divided further into three components (explained below). This model allows for flexibility to configure what components should be included on the device, 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.
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. Also, since Core eSWT is a required package for all eSWT implementations, applications using only the Core eSWT should be compatible across many devices.
Expanded eSWT
Expanded eSWT includes a set of advanced widgets such as tables and trees. These widgets are appropriate only for certain types of devices and may not be available on all devices. Nonetheless, S60 platform supports Expanded eSWT completely.
SWT Mobile Extensions
The SWT Mobile Extensions are a collection of widgets that are appropriate
for mobile devices but are not always found on desktops. These widgets are
especially adapted to screen types and input devices commonly found on mobile
devices. 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.