swt部分禁用崩溃

时间:2014-08-19 08:25:40

标签: java eclipse swt

如何禁用section元素的折叠。应启用客户端元素。我有一个选择,但看起来不太好。

timeSettingsSection.addExpansionListener(new IExpansionListener() {

        @Override
        public void expansionStateChanging(ExpansionEvent e) {
        }

        @Override
        public void expansionStateChanged(ExpansionEvent e) {
            if (!e.getState()) {
                timeSettingsSection.setExpanded(true);
                return;
            }
            if (stopSection.isExpanded())
                stopSection.setExpanded(false);
            if (cabinTypeSection.isExpanded())
                cabinTypeSection.setExpanded(false);
            if (airlinesSection.isExpanded())
                airlinesSection.setExpanded(false);
            sectionExpanded();
            useDepartTime.setFocus();
        }
    });

是的是org.eclipse.ui.forms.widgets.section

    timeSettingsSection = getToolkit().createSection(mainGroup, Section.LEFT_TEXT_CLIENT_ALIGNMENT | Section.TWISTIE);
    timeSettingsSection.setText("Time");
    GridUtils.fillHorz(timeSettingsSection);

    Composite group = getToolkit().createComposite(timeSettingsSection, SWT.NONE);
    GridUtils.gridLayoutObj(group).numColumns(3).noMargins();
    getToolkit().paintBordersFor(group);
    timeSettingsSection.setClient(group);

1 个答案:

答案 0 :(得分:0)

我认为这是org.eclipse.ui.forms.widgets.Section类。

如果您创建的部分未指定TWISTIETREE_NODE样式,则该部分将无法折叠。

相关问题