2010年2月23日 星期二

Eclipse Rich Client Platform(RCP) Development

Reference: http://www.vogella.de/articles/RichClientPlatform/article.html

To create an eclipse RCP application, means to create a plugin which contains the application. This application can use the existing hooks of Eclipse (called Extension Points) to define functionality/UI or provide its own extension points to get extended by other plugins.

- Used extensions and provided extension-points are described in file plugin.xml
- application functionality are divided into plugins
- Eclipse workbench framework allow:
- add functionality as plugins
- use existing extension points
- provide additional extension points

An Eclipse RCP application requires:
1. Main program - A RCP main application class implements the interface IApplication. Eclipse expects that the application class is defined via the extension point org.eclipse.core.runtime.application.

2. A Perspective - The perspective is extended from org.eclipse.ui.perspective

3. Workbench Advisor- invisible technical component which controls the appearance of the application (menus, toolbars, perspectives, etc)


Startup process of an RCP application
During the startup of an Eclipse RCP application the Eclipse runtime will evaluate which class is defined via the "org.eclipse.core.runtime.application" extension point. This class will then be loaded. This class creates and runs a Workbench.

The Workbench is configured via a WorkbenchAdvisor. The Workbench will start a WorkbenchWindow which is configured via a WorkbenchWindowAdvisor. This WorkbenchWindow will create the toolbar of the application which can get configured at startup via the ActionBarAdvisor.

Each adviser allow to configure certain behavior of the application, e.g. the WorkbenchAdvisor allows to perform certain actions at startup or shutdown by overriding the methods preStartUp() and preShutdown().

沒有留言:

張貼留言