1 package org.simantics.databoard.tests;
3 import org.eclipse.swt.SWT;
4 import org.eclipse.swt.custom.CTabFolder;
5 import org.eclipse.swt.custom.CTabItem;
6 import org.eclipse.swt.layout.FillLayout;
7 import org.eclipse.swt.widgets.Display;
8 import org.eclipse.swt.widgets.Shell;
9 import org.eclipse.swt.widgets.TabFolder;
10 import org.eclipse.swt.widgets.TabItem;
11 import org.eclipse.swt.widgets.Text;
13 public class TabbedPageTEst {
15 public static void main(String[] args) {
17 Display display = new Display();
18 Shell shell = new Shell(display);
19 shell.setLayout(new FillLayout());
21 Shell shell2 = new Shell(display);
22 shell2.setLayout(new FillLayout());
23 CTabFolder folder = new CTabFolder(shell, SWT.CLOSE | SWT.TOP);
24 //folder.setUnselectedCloseVisible(false);
25 folder.setSimple(false);
26 for (int i = 0; i < 6; i++) {
27 CTabItem item = new CTabItem(folder, SWT.NONE);
28 item.setText("Tab Item "+i);
29 Text text = new Text(folder, SWT.BORDER | SWT.MULTI);
30 text.setText("Content for Item "+i);
31 //item.setControl(text);
34 folder.setSize (400, 200);
37 TabFolder tabFolder = new TabFolder (shell2, SWT.NONE);
38 for (int i=0; i<6; i++) {
39 TabItem item = new TabItem (tabFolder, SWT.NULL);
40 item.setText ("Tab Item " + i);
41 Text text = new Text(tabFolder, SWT.BORDER | SWT.MULTI);
42 text.setText("Content for Item "+i);
43 item.setControl(text);
45 tabFolder.setSize (400, 200);
51 while (!shell.isDisposed () || !shell2.isDisposed()) {
52 if (!display.readAndDispatch ()) display.sleep ();