如何禁用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);
答案 0 :(得分:0)
我认为这是org.eclipse.ui.forms.widgets.Section
类。
如果您创建的部分未指定TWISTIE
或TREE_NODE
样式,则该部分将无法折叠。