1 | /*
|
---|
2 | * SWT009_04.java
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (c) 2002, 2005 EclipseOS2 Team.
|
---|
7 | * This file is made available under the terms of the Common Public License v1.0
|
---|
8 | * which accompanies this distribution, and is available at
|
---|
9 | * http://www.eclipse.org/legal/cpl-v10.html
|
---|
10 | */
|
---|
11 |
|
---|
12 | import org.eclipse.swt.widgets.Display;
|
---|
13 | import org.eclipse.swt.widgets.Shell;
|
---|
14 | import org.eclipse.swt.SWT;
|
---|
15 | import org.eclipse.swt.widgets.*;
|
---|
16 | import org.eclipse.swt.layout.FillLayout;
|
---|
17 | import org.eclipse.swt.graphics.*;
|
---|
18 |
|
---|
19 | public class SWT009_06 extends SWTTestCase {
|
---|
20 |
|
---|
21 | static {
|
---|
22 | STEP = "009";
|
---|
23 | TEST = "06";
|
---|
24 | DESC = "TabFolder";
|
---|
25 | }
|
---|
26 |
|
---|
27 | Shell createTopShell(Display display) {
|
---|
28 | return new Shell(display, SWT.SHELL_TRIM | SWT.NO_REDRAW_RESIZE);
|
---|
29 | }
|
---|
30 |
|
---|
31 |
|
---|
32 | void initComponents() {
|
---|
33 | shell.setText("Tab Folder Example");
|
---|
34 | shell.setSize(450, 250);
|
---|
35 | final TabFolder tabFolder = new TabFolder(shell, SWT.BORDER);
|
---|
36 | for (int loopIndex = 0; loopIndex < 10; loopIndex++) {
|
---|
37 | TabItem tabItem = new TabItem(tabFolder, SWT.NULL);
|
---|
38 | tabItem.setText("Tab " + loopIndex);
|
---|
39 | Text text = new Text(tabFolder, SWT.BORDER);
|
---|
40 | text.setText("This is page " + loopIndex);
|
---|
41 | tabItem.setControl(text);
|
---|
42 | }
|
---|
43 | tabFolder.setSize(400, 200);
|
---|
44 | shell.open();
|
---|
45 |
|
---|
46 | }
|
---|
47 |
|
---|
48 |
|
---|
49 | void setTitle(String title) {
|
---|
50 | super.setTitle(title);
|
---|
51 | }
|
---|
52 |
|
---|
53 | public static void main(String[] args) {
|
---|
54 | go(new SWT009_06());
|
---|
55 | }
|
---|
56 |
|
---|
57 | }
|
---|