Eclipse SWT节setTextClient将组合放在标题栏的末尾

Eclipse SWT节setTextClient将组合放在标题栏的末尾,eclipse,eclipse-plugin,swt,rcp,Eclipse,Eclipse Plugin,Swt,Rcp,我试图在章节标题栏的末尾放一个组合框,因此我使用了SWT的setTextClient(Control)方法。 我可以看到部分标题栏中的组件,但这是在最末端,但我不希望在部分标题和标题栏之间有太多空间 用户界面- 从上图中可以明显看出,AND或单选按钮位于末尾,并且过滤器标题和标题栏之间有一个空格 下面是我用来实现相同功能的代码片段- Composite toolbar = toolkit.createComposite(section, SWT.WRAP); RowLayout

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

用户界面-

从上图中可以明显看出,AND或单选按钮位于末尾,并且过滤器标题和标题栏之间有一个空格

下面是我用来实现相同功能的代码片段-

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);
它成功了