如何将处理的工具项放置在右侧 [英] How to position a Handled Tool Item to the right

查看:84
本文介绍了如何将处理的工具项放置在右侧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于eclipse e4框架构建的应用程序。我想将处理工具项放置在最右端。如何实现?

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?

推荐答案

您需要使用两个工具栏条目,它们之间带有工具控件:

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

类似这样:

在工具控件的标签中添加单词 stretch ,这将使装饰条管理器扩展控件以使用所有可用空间,将所有内容推入它在右侧:

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:

控件的类可以很简单:

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

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

这篇关于如何将处理的工具项放置在右侧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆