如何自定义 EclipseChe 菜单和插件

How to customize EclipseChe menus and plugins

我想在 Eclipse Che 中进行如下自定义。 请分享样品等参考资料

  1. 增加原有菜单 想在项目的右键菜单和Eclipse Che的header菜单中添加项目

  2. 从添加的菜单中调用扩展插件处理 从1.添加的菜单中调用原来创建的插件的处理

  3. 想在Eclipse Che中应用2.中扩展的插件

这是添加工具栏的示例,您可以使用相同的示例添加菜单。 请查看此页面 https://www.eclipse.org/che/docs/assemblies/sdk-actions/index.html

  @Extension(title = "Sample Actions Extension", version = "1.0.0")
  public class SampleActionsExtensions {
  @Inject
  public SampleActionsExtensions(HelloWorldAction helloWorldAction, ActionManager actionManager) {

  actionManager.registerAction("helloWorldAction", helloWorldAction);
  actionManager.registerAction("helloWorldActionWithIcon", helloWorldActionWithIcon);
  /...

  DefaultActionGroup sampleGroup = new DefaultActionGroup("Sample actions", true, actionManager);

  sampleGroup.add(helloWorldAction);

  // add sample group after help menu entry
  DefaultActionGroup mainMenu = (DefaultActionGroup)actionManager.getAction(GROUP_MAIN_MENU);
    mainMenu.add(sampleGroup);

  // add the sample group to the beginning of the toolbar as well
  DefaultActionGroup toolbar = (DefaultActionGroup)actionManager.getAction(IdeActions.GROUP_MAIN_TOOLBAR);
  toolbar.add(helloWorldActionWithIcon);
  /...
}
}