gpt4 book ai didi

java - RCP 3 - 锁定工具栏菜单贡献

转载 作者:行者123 更新时间:2023-12-02 10:59:43 26 4
gpt4 key购买 nike

目前,我正在使用 RCP 4 中的兼容性将 RCP 3 项目移植到 RCP 4。到目前为止,尽管我必须对我正在使用的 ContributionItem 进行更改,但到目前为止效果还不错对于工具栏,现在需要 WorkbenchWindowControlContribution
更改此设置后,我注意到我现在可以拖动工具栏并移动它。我想删除允许单击以移动面板的图标(带有 3 个点)。

这就是我定义菜单贡献的方式。

<menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar">
<toolbar id="contributions.toolbar">
<control
class="name.of.Class"
id="perspectiveSwitcherToolbar">
</control>
</toolbar>
</menuContribution>

如何锁定工具栏?

最佳答案

在 Eclispe e4 中,我们通过在 Application.e4xmi 模型中添加标签来实现这一点。

  1. 点击工具栏
  2. 转到该工具栏的补充部分,如下所示。

enter image description here

  • 在“标签”部分下的“新值”文本框中输入不带空格的标签“NoMove”,如下所示,然后单击“添加”按钮。
  • enter image description here

    现在保存并重新启动应用程序,用于移动面板的控件(3 个点)将被禁用。

    enter image description here

    要在 e3 中实现类似功能,请访问此讨论链接 Remove ToolBar Drag .

    关于java - RCP 3 - 锁定工具栏菜单贡献,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51425836/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com