Книга: Embedded Linux development using Eclipse

7.6.2 Embedded Rich Client Platform (eRCP)

7.6.2 Embedded Rich Client Platform (eRCP)

The RCP is aimed at developing platform-independent desktop applications. So what does that have to do with embedded development, you may ask? The answer is another Eclipse project called the embedded Rich Client Platform (eRCP). This project aims to bring the power of rich client applications to embedded and mobile devices.

To explain how eRCP differs from RCP, it’s necessary to delve a little deeper into the architecture of Eclipse. Referring back to Figure 1.1, the Eclipse workbench is built on top of two hierarchical graphical toolkits. The lower level toolkit is called the Standard Widget Toolkit (SWT), a Java-defined layer sitting on top of platform-dependent GUI components. Every platform on which Eclipse runs has its own native SWT layer, but the Java side of that layer is constant.

The JFace toolkit is built on top of the SWT and is a high-level GUI layer that addresses the needs of Eclipse itself. JFace provides components that create views and support events, control tasks using progress components, and manage UI resources such as fonts. Of course, the GUI requirements of Eclipse are common to many applications, which makes JFace useful outside the Eclipse environment.

eRCP implements a subset of the SWT called, not surprisingly, the embedded Standard Widget Toolkit (eSWT) that provides a set of controls, panels, and other widgets commonly used as building blocks of user interfaces in embedded devices Additionally, eSWT introduces a new component, mobile extensions, primarily targeted at the needs of mobile devices such as PDAs and smart phones.

The design of SWT emphasizes portability among operating systems by keeping the native code layer as small and simple as possible. That’s fine in desktop environments where there’s ample processor horsepower to compensate for the performance hit of platform-independent code. But in mobile devices, performance is a critical issue. So eSWT sacrifices portability to put more of the functionality in the native layer.

eSWT consists of three elements:

• Core

• Expanded

• Mobile extensions

Figure 7.17 illustrates where eSWT fits in the scheme of things.


Figure 7.17: eSWT UI toolkit architecture.

eRCP then is a collection of runtime libraries supporting a range of platforms that includes:

• Windows Mobile 2003/5/6

• WindowsCE 5.0 Professional

• Nokia series 80: Includes emulator

• Windows desktop: For testing

Unfortunately, there’s no Linux runtime, so in order to play around with eRCP, you’ll need a Windows Eclipse installation. Download the latest version of the Windows desktop runtime from the eRCP Download Page at http://www.eclipse.org/ercp/downloads-page.html. This is a zip file that creates its own directory. I suggest unzipping it in your Eclipse directory.

The eRCP package includes three fairly simple demos that are started from batch files. Try them out. Unfortunately, the demos don’t appear to include source code. There is an example[9] with source code in your EclipseSamples/ directory in the form of a JAR file that you’ll need to import into Eclipse.

Click File?Import…, expand Plug-in Development and select Plug-ins and Fragments. This brings up the dialog in Figure 7.18. In the Import from section, uncheck The target platform and browse to your EclipseSamples/ directory. In Import As, select Projects with source folders and click Next. Only one plug-in will be found. Select that and Add it to the Plug-ins and Fragments to import list. Click Finish.


Figure 7.18: Import Plug-ins and Fragments dialog.

Back in the Project Development perspective you’ll find a new project in the Package Explorer view. Take a look at some of the Java files and open the manifest to get a feel for what’s going on.

However, before you can build and run the example, you must point PDE at the correct target environment. Select Window?Preferences?Plug-in Development?Target Platform. Browse to the eRCP/ directory under the eRCP installation directory. Back in the Manifest editor launch the application.

Оглавление книги

Оглавление статьи/книги

Генерация: 0.033. Запросов К БД/Cache: 0 / 0
поделиться
Вверх Вниз