]> gerrit.simantics Code Review - simantics/3d.git/blob - org.simantics.g3d/src/org/simantics/g3d/toolbar/ToolComposite.java
Editor internal toolbar for Plant3D editor
[simantics/3d.git] / org.simantics.g3d / src / org / simantics / g3d / toolbar / ToolComposite.java
1 package org.simantics.g3d.toolbar;
2
3 import org.eclipse.swt.SWT;
4 import org.eclipse.swt.layout.RowLayout;
5 import org.eclipse.swt.widgets.Composite;
6 import org.eclipse.swt.widgets.Control;
7
8 public class ToolComposite extends Composite{
9
10     public ToolComposite(Composite parent, int style) {
11         super(parent, style|SWT.BORDER);
12         RowLayout layout = new RowLayout();
13         layout.center = true;
14         layout.marginBottom = 1;
15         layout.marginTop = 1;
16         setLayout(layout);
17     }
18     
19     public void clear() {
20         Control children[] = getChildren();
21         for (Control c : children)
22             c.dispose();
23         relayout();
24     }
25     
26     public void relayout() {
27         getParent().layout(true);
28         layout(true);
29     }
30
31 }