Книга: Embedded Linux development using Eclipse

7.6 Rich Client Platform (RCP)

Up to this point we’ve been using PDE to create plug-ins that operate from within the workbench. We can also use PDE to create so-called rich client applications that build on the Eclipse plug-in architecture, but run as independent programs. The Rich Client Platform, first introduced in version 3.0, is basically a refactoring of the fundamental parts of the Eclipse UI that allows it to be used for non-IDE applications.

Select File?New?Project…?Plug-in Project. Call it “HelloRCP.” In the Plug-in Content dialog, answer “Yes” to “Would you like to create a rich client application?” Click Next to bring up the Templates dialog of Figure 7.13 and select Hello RCP. Click Next. This dialog is just some basic information about our trivial Hello World RCP application. Click Finish.


Figure 7.13: RCP Templates dialog.

The new project opens in the Manifest editor and looks pretty much like the SuperView project we created earlier. Click the Extensions tab and expand both entries. What makes this an RCP application rather than an Eclipse plug-in is that we’re creating an extension to org.eclipse.core.runtime.applications. This is the class that will be executed when the platform is started. In effect, our plug-in becomes the main application program. We’re also creating a new perspective.

Expand the HelloRCP project down to the individual .java files under hellorcp and open Application.java. This file defines a class that implements IApplication, which in turn implements both a start and a stop method.

Run the project by selecting Launch an Eclipse application from the Testing section of the Manifest editor Overview tab. The result (Figure 7.14) isn’t very exciting, but it does illustrate that we’ve fired off an independent application window. The code that implements the window is in ApplicationWorkbenchWindowAdvisor.java.


Figure 7.14: HelloRCP application window.

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

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

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