]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.databoard/scratch/org/simantics/databoard/tests/TabbedPageTEst.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.databoard / scratch / org / simantics / databoard / tests / TabbedPageTEst.java
1 package org.simantics.databoard.tests;
2
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;
12
13 public class TabbedPageTEst {
14
15         public static void main(String[] args) {
16                         
17                         Display display = new Display();
18                         Shell shell = new Shell(display);
19                         shell.setLayout(new FillLayout());
20                 
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);
32                         }
33                         
34                         folder.setSize (400, 200);
35                         
36                         
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);
44                         }
45                         tabFolder.setSize (400, 200);
46                         
47                         shell.pack ();
48                         shell.open ();
49                         shell2.pack();
50                         shell2.open();
51                         while (!shell.isDisposed () || !shell2.isDisposed()) {
52                                 if (!display.readAndDispatch ()) display.sleep ();
53                         }
54                         display.dispose ();
55                         
56         }
57         
58 }