0

我想在 Eclipse Che 中进行如下定制。请分享样品等参考信息。

  1. 添加原始菜单 想在项目的右键菜单和Eclipse Che 的标题菜单中添加项目。

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

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

4

1 回答 1

0

这是添加工具栏的示例,您可以使用相同的示例添加菜单。请查看此页面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);
  /...
}
}
于 2017-09-18T16:19:50.870 回答