站内搜索: 请输入搜索关键词
当前页面: 图书首页 > Eclipse Rich Client Platform: Designing, Coding, and Packaging Java Applications

Section 6.4.  Summary - Eclipse Rich Client Platform: Designing, Coding, and Packaging Java Applications

Previous Page
Next Page

6.4. Summary

There you have itHyperbola now has a minimal set of actions and some more advanced desktop integration. As we mentioned at the outset, actions are one of the key elements of building RCP applications. There are many ways actions can be used and placed in the Workbench. With the information in this chapter, you are well on your way to mastering action definition and placement.

But what about declarative actions?

If you have some Eclipse plug-in development experience, you may be asking yourself why we have not used any of the Workbench's extension points for defining actions. After all, Eclipse is all about declarative contributions. This is a common questionwhen should an RCP application use the declarative Workbench extension points as opposed to simply creating the actions programmatically as in Hyperbola?

The short answer is that within the context of a single small application, there is usually no need to use the extension point approach. In fact, an RCP application must minimally define a top-level menu structure using programmatic actions because without this, there would be no place to contribute actions declaratively.

However, there are advantages to using declarative actions. These are detailed later in the book but summarized here:

  • They allow lazy loading of plug-ins by being shown in the UI without loading their associated plug-in. In large applications with many plug-ins, this is very important.

  • Declarative actions can be associated with perspectives and easily allow dynamic reconfiguration of top-level menus and toolbars based on the active perspective.

  • They allow users to configure top-level menus and toolbars via the perspective customization dialog (refer to the ActionFactory.EDIT_ACTION_SETS class for more details).

  • Declarative action contributions can easily be filtered out of the application using capabilities.

Refer to Chapter 17, "Actions," for examples on how to use declarative actions in Hyperbola. Programmatic actions are used for the remainder of the Hyperbola tutorial.



Previous Page
Next Page