Eclipse 3.x Eclipse 4.x 中的修剪栏

Eclipse 3.x trimbar in Eclipse 4.x

目前我正在将 Eclipse RCP 3.7 应用程序迁移到 Eclipse 4.5 应用程序。在第一步中,我将目标平台更新为 Eclipse 4.5 并检查了与旧版本应用程序的差异。

在新版本中,状态栏的高度似乎缩小了:

在旧版本中它是这样的:

我尝试将 plugin.xml 中的 menuContributions (locationURI: toolbar:org.eclipse.ui.trim.status) 更改为 ModelFragment- >TrimContribution->Toolbar->Tool Controls in fragment.e4xmi

我需要更改主要 CSS 来调整工具栏的高度吗?我需要使用哪个选择器?

感谢 Rüdigers 的提示,我已经弄明白了如何在不显示截断的情况下添加 ContributionItems。

首先我创建了一个处理程序:

public class TrimWidget extends AbstractHandler
{
    @Override
    public Object execute(ExecutionEvent event) throws ExecutionException
    {
        return null;
    }
} 

并将其注册为 plugin.xml 中的命令:

<command
    defaultHandler="com.example.TrimWidget"
    id="com.example.trimWidget"
    name="-">
</command>

最后我将命令添加到每个 ToolbarItem:

<toolbar id="com.example.statusBarItem">
    <control 
        class="com.example.MyStatusBarContribution"
        id="MyStatusBarContribution">
    </control>
    <command
        commandId="com.example.trimWidget"
        icon="icons/toolbar-command.png">
    </command>
</toolbar>

结果看起来不像是Eclipse 3的版本,但是可以接受。项目在状态栏中左对齐,无法通过拖放移动。