【问题标题】:How to hide a terminal icon in toolbar of Eclipse RCP Product?如何在 Eclipse RCP 产品的工具栏中隐藏终端图标?
【发布时间】:2019-03-10 07:23:48
【问题描述】:

我的 eclipse rcp 项目需要终端插件。 org.eclipse.tm.terminal.view.ui,

将它们添加到我的 rcp 产品后,我可以从 Windows->View->Open Terminal 打开终端。

但是我想隐藏工具栏上的终端图标,我在org.eclipse.tm.terminal.view.ui插件中看到,它定义了终端工具栏的位置,直接位于org.eclipse.ui.main .toolbar,保存按钮旁边。

我该怎么办?有什么办法可以隐藏吗?

工具栏上的终端按钮:

【问题讨论】:

    标签: terminal eclipse-rcp toolbar rcp


    【解决方案1】:

    尝试修改RCP应用的ApplicationWorkbenchWindowAdvisor类的postWindowCreate方法。

    IWorkbenchPage page = this.getWindowConfigurer().getWindow().getActivePage();
    MenuManager menuBarManager = ((ApplicationWindow)page.getWorkbenchWindow()).getMenuBarManager();
    menuBarManager.remove("<ID>"); // pass the id of your terminal toolitem
    

    【讨论】:

      猜你喜欢
      • 2012-07-12
      • 1970-01-01
      • 2011-05-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-09
      • 1970-01-01
      • 2022-01-10
      相关资源
      最近更新 更多