public Composite createDocking(Composite parent)
{
TabFolder tabbedPane = new TabFolder(parent, DOUBLE_BUFFER);
tabbedPane.setLayoutData("grow");
TabItem p1 = createTabPanel(tabbedPane, "Docking 1", new MigLayout("fill"));
createPanel(p1, "1. North", "north");
createPanel(p1, "2. West", "west");
createPanel(p1, "3. East", "east");
createPanel(p1, "4. South", "south");
Table table = new Table(getComposite(p1), DOUBLE_BUFFER);
for (int i = 0; i < 5; i++) {
TableColumn tc = new TableColumn(table, SWT.LEFT | SWT.V_SCROLL | SWT.SCROLL_LINE);
tc.setText("Column " + (i + 1));
tc.setWidth(100);
}
for (int r = 0; r < 15; r++) {
TableItem item1 = new TableItem(table,0);
String[] data = new String[6];
for (int c = 0; c < data.length; c++)
data[c] = "Cell " + (r + 1) + ", " + (c + 1);
item1.setText(data);
}
table.setHeaderVisible(true);
table.setLinesVisible(true);
table.setLayoutData("grow");
TabItem p2 = createTabPanel(tabbedPane, "Docking 2 (fill)", new MigLayout("fill", "[c]", ""));
createPanel(p2, "1. North", "north");
createPanel(p2, "2. North", "north");
createPanel(p2, "3. West", "west");
createPanel(p2, "4. West", "west");
createPanel(p2, "5. South", "south");
createPanel(p2, "6. East", "east");
createButton(p2, "7. Normal", "");
createButton(p2, "8. Normal", "");
createButton(p2, "9. Normal", "");
TabItem p3 = createTabPanel(tabbedPane, "Docking 3", new MigLayout());
createPanel(p3, "1. North", "north");
createPanel(p3, "2. South", "south");
createPanel(p3, "3. West", "west");
createPanel(p3, "4. East", "east");
createButton(p3, "5. Normal", "");
TabItem p4 = createTabPanel(tabbedPane, "Docking 4", new MigLayout());
createPanel(p4, "1. North", "north");
createPanel(p4, "2. North", "north");
createPanel(p4, "3. West", "west");
createPanel(p4, "4. West", "west");
createPanel(p4, "5. South", "south");
createPanel(p4, "6. East", "east");
createButton(p4, "7. Normal", "");
createButton(p4, "8. Normal", "");
createButton(p4, "9. Normal", "");
TabItem p5 = createTabPanel(tabbedPane, "Docking 5 (fillx)", new MigLayout("fillx", "[c]", ""));
createPanel(p5, "1. North", "north");
createPanel(p5, "2. North", "north");
createPanel(p5, "3. West", "west");
createPanel(p5, "4. West", "west");
createPanel(p5, "5. South", "south");
createPanel(p5, "6. East", "east");
createButton(p5, "7. Normal", "");
createButton(p5, "8. Normal", "");
createButton(p5, "9. Normal", "");
TabItem p6 = createTabPanel(tabbedPane, "Random Docking", new MigLayout("fill"));
String[] sides = {"north", "east", "south", "west"};
Random rand = new Random();
for (int i = 0; i < 20; i++) {
int side = rand.nextInt(4);