Eclipse Kepler RCP Main Toolbar Actions

前端 未结 1 1714
别那么骄傲
别那么骄傲 2021-01-21 13:51

Google is my best friend, but the information I\'m getting is too scattered and very unclear. There isn\'t a concise tutorial describing my needs.

I want to add a

相关标签:
1条回答
  • 2021-01-21 14:19

    The really new way is to use a pure e4 RCP which uses the new application model with commands and handlers! (but e4 doesn't support a lot of existing code). In e4 menus and toolbars are defined in the application model. Commands and handlers are used in a similar way to traditional code (but handlers are implemented differently).

    For Eclipse 3 style as you have found there is a jumble or ways of doing things. Eclipse 4.3 does deprecate some of the oldest (and this is now flagged in the plugin.xml).

    If you are writing a RCP which uses its own ActionBarAdvisor then you can define your tool bar items there. Or you can define them in the plugin.xml for individual plugins. Both methods are fine. Eclipse itself defines core actions in the advisor with add on plugins defining more in their plugin.xmls.

    Actions such as Save which need to be handled by multiple parts (such as editors) should be created in the advisor and use RetargetAction. This allows each individual part to hook up its own action with the globally defined action. This can also be done with commands and multiple handlers which are closer to the e4 style.

    org.eclipse.ui.menus is now the main extension point for contributing to menus and toolbars (ignoring all the deprecated parts). This does pretty much force you to use commands and handlers.

    The Eclipse action bar advisor is org.eclipse.ui.internal.ide.WorkbenchActionBuilder which may help although it is big.

    I think the coolbar in Kepler is constructed using the new e4 application model with styling using some tricky CSS.

    0 讨论(0)
提交回复
热议问题