import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
+/** Manages {@link Section} in a tab-like structure.*/
public class TabbedArea extends Composite {
private static final long serialVersionUID = 8659669229482033444L;
Button title = new Button(sectionHeader, SWT.FLAT);
CmsUiUtils.style(title, selected ? tabSelectedStyle : tabStyle);
title.setLayoutData(CmsUiUtils.fillWidth());
- title.addSelectionListener((Selected) (e) -> section.moveAbove(null));
+ title.addSelectionListener((Selected) (e) -> showTab(tabIndex(section.getNode())));
Node node = section.getNode();
title.setText(Jcr.getTitle(node));
ToolBar toolBar = new ToolBar(sectionHeader, SWT.NONE);
public void showTab(int index) {
Section sectionToShow = sections.get(index);
sectionToShow.moveAbove(null);
+ refreshTabHeaders();
layout(true, true);
}