package org.simantics.g3d.toolbar; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.RowLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; public class ToolComposite extends Composite{ public ToolComposite(Composite parent, int style) { super(parent, style|SWT.BORDER); RowLayout layout = new RowLayout(); layout.center = true; layout.marginBottom = 1; layout.marginTop = 1; setLayout(layout); } public void clear() { Control children[] = getChildren(); for (Control c : children) c.dispose(); relayout(); } public void relayout() { getParent().layout(true); layout(true); } }