X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.databoard%2Fscratch%2Forg%2Fsimantics%2Fdataboard%2Ftests%2FTabbedPageTEst.java;fp=bundles%2Forg.simantics.databoard%2Fscratch%2Forg%2Fsimantics%2Fdataboard%2Ftests%2FTabbedPageTEst.java;h=438aa44f92688e63631e9e27eb715f44f1969173;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.databoard/scratch/org/simantics/databoard/tests/TabbedPageTEst.java b/bundles/org.simantics.databoard/scratch/org/simantics/databoard/tests/TabbedPageTEst.java new file mode 100644 index 000000000..438aa44f9 --- /dev/null +++ b/bundles/org.simantics.databoard/scratch/org/simantics/databoard/tests/TabbedPageTEst.java @@ -0,0 +1,58 @@ +package org.simantics.databoard.tests; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CTabFolder; +import org.eclipse.swt.custom.CTabItem; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.TabFolder; +import org.eclipse.swt.widgets.TabItem; +import org.eclipse.swt.widgets.Text; + +public class TabbedPageTEst { + + public static void main(String[] args) { + + Display display = new Display(); + Shell shell = new Shell(display); + shell.setLayout(new FillLayout()); + + Shell shell2 = new Shell(display); + shell2.setLayout(new FillLayout()); + CTabFolder folder = new CTabFolder(shell, SWT.CLOSE | SWT.TOP); + //folder.setUnselectedCloseVisible(false); + folder.setSimple(false); + for (int i = 0; i < 6; i++) { + CTabItem item = new CTabItem(folder, SWT.NONE); + item.setText("Tab Item "+i); + Text text = new Text(folder, SWT.BORDER | SWT.MULTI); + text.setText("Content for Item "+i); + //item.setControl(text); + } + + folder.setSize (400, 200); + + + TabFolder tabFolder = new TabFolder (shell2, SWT.NONE); + for (int i=0; i<6; i++) { + TabItem item = new TabItem (tabFolder, SWT.NULL); + item.setText ("Tab Item " + i); + Text text = new Text(tabFolder, SWT.BORDER | SWT.MULTI); + text.setText("Content for Item "+i); + item.setControl(text); + } + tabFolder.setSize (400, 200); + + shell.pack (); + shell.open (); + shell2.pack(); + shell2.open(); + while (!shell.isDisposed () || !shell2.isDisposed()) { + if (!display.readAndDispatch ()) display.sleep (); + } + display.dispose (); + + } + +}