eclipse - SWT 部分 setTextClient 将组合放在标题栏的末尾

标签 eclipse eclipse-plugin swt rcp

我试图在节标题栏的末尾放置一个组合框,以便我使用 SWT 的 setTextClient(Control) 方法。 我可以在部分标题栏中看到该组件,但那是在最末端,但我不希望部分标题和标题栏之间有太多空间。

用户界面- enter image description here

从上图中可以清楚地看到 AND 和 OR 单选按钮出现在最后,并且 Filter Title 和 Title Bar 之间有一个空格。

以下是我用来实现相同目的的代码片段-

Composite toolbar = toolkit.createComposite(section, SWT.WRAP);
        RowLayout rlayout = new RowLayout(SWT.HORIZONTAL);
        toolbar.setCursor(Display.getDefault().getSystemCursor(SWT.CURSOR_HAND));
        rlayout.marginLeft = 0;
        rlayout.marginRight = 0;
        rlayout.spacing = 0;
        rlayout.marginTop = 0;
        rlayout.marginBottom = 0;
        toolbar.setLayout(rlayout);

        Button A = new Button(toolbar, SWT.RADIO);
        A.setText("AND");

        Button r = new Button(toolbar, SWT.RADIO);
        r.setText("OR");

        section.setTextClient(toolbar);
        section.setText(type.name());
        section.setClient(client);
        section.setExpanded(true);

最佳答案

找到了解决方案, 它实际上是与部分声明一起的。

Section section = toolkit.createSection(compositeRightDownContent,
            Section.LEFT_TEXT_CLIENT_ALIGNMENT | Section.COMPACT);

成功了

关于eclipse - SWT 部分 setTextClient 将组合放在标题栏的末尾,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12157712/

相关文章:

linux - Windows 上的 Cygwin + Linux NDK

java - 如何在第二列或特定列中插入 jface TreeViewer?

java - SWT 图像到 Base64 字符串

eclipse - Eclipse 在 Tycho 项目中未考虑 pom.xml 的依赖项

C++错误:undefined reference to `EnumProcesses@12

php - Eclipse Europa 的 Smarty 插件

java - "org.eclipse.equinox.ds@3:start"背后的魔力?

eclipse - 如何在SWT中使水平扩展的控件紧挨着固定宽度的控件

java - 如果将 google-play-services.jar lib 添加到我在 Eclipse 中的 helloworld android 项目中,Android 编译会卡住

c++ - Eclipse C++ 项目未解析 LD_LIBRARY_PATH 包含变量