How to position a Handled Tool Item to the right

为君一笑 提交于 2019-12-31 02:59:14

问题


I've an application built on eclipse e4 framework. I want to position a Handled Tool Item to the far right end. How can I achieve it?


回答1:


You need to use two 'Toolbar' entries with a 'Tool Control' between them:

so something like:

In the Tags for the Tool Control add the word stretch this will make the trim bar manager stretch out the control to use all available space pushing everything after it to the right:

The class for the control can something simple like:

public class SpacerControl
{
  @PostConstruct
  public void postConstruct(Composite parent)
  {
    Composite body = new Composite(parent, SWT.NONE);

    body.setLayout(new GridLayout());
  }
}


来源:https://stackoverflow.com/questions/28484737/how-to-position-a-handled-tool-item-to-the-right

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!