简体   繁体   English

Eclipse插件,在选项卡标题旁边的轮廓上添加按钮

[英]Eclipse plugin, add buttons on the outline next to the tab header

I have a custom Eclipse plugin with an editor and a content outline on which I added action(button) with 我有一个带有编辑器和内容概述的自定义Eclipse插件,在其中添加了action(button)

@Override
public void setActionBars(IActionBars actionBars)
{       

    actionBars.getToolBarManager().add(new CustomAction());     
    actionBars.getToolBarManager().update(false);       
    actionBars.updateActionBars();      
}

The button correctly displays and is functional but it is display on a toolbar below the tab header named Outline and I want that button to be displayed next to that tab header like in the JDT. 该按钮正确显示并可以使用,但是显示在名为Outline的选项卡标题下方的工具栏上,我希望该按钮显示在该选项卡标题旁边,就像在JDT中一样。

Two pict to explain: 两张图来解释:

This is what I have 这就是我所拥有的

我有的

And what I want 而我想要的

我想要的是

In the JDT the first behavior happens when there is not enough space to display all the button but in my outline the button is always below the tab header 在JDT中,当没有足够的空间来显示所有按钮时会发生第一种行为,但是在我的轮廓中,按钮始终位于选项卡标题下方

As you can see on the picts I read the JDT outline source code but nothing helped. 正如您在图上看到的那样,我阅读了JDT概述源代码,但没有任何帮助。

我找到了一个解决方案,我的按钮使用的高度图像很大,JDT使用的图像是16x16,所以我只缩小了我的位置,并将按钮移到了选项卡标题旁边。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM