Skip to content

Commit da50bf5

Browse files
committed
Adds CTabFolder for SWT examples to repo
1 parent 95c887d commit da50bf5

6 files changed

Lines changed: 95 additions & 0 deletions

File tree

com.vogella.swt.widgets/.classpath

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
4+
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
5+
<classpathentry kind="src" path="src"/>
6+
<classpathentry kind="output" path="bin"/>
7+
</classpath>

com.vogella.swt.widgets/.project

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>com.vogella.swt.widgets</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.pde.ManifestBuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.pde.SchemaBuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
</buildSpec>
24+
<natures>
25+
<nature>org.eclipse.pde.PluginNature</nature>
26+
<nature>org.eclipse.jdt.core.javanature</nature>
27+
</natures>
28+
</projectDescription>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
4+
org.eclipse.jdt.core.compiler.compliance=1.8
5+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
7+
org.eclipse.jdt.core.compiler.source=1.8
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Manifest-Version: 1.0
2+
Bundle-ManifestVersion: 2
3+
Bundle-Name: Widgets
4+
Bundle-SymbolicName: com.vogella.swt.widgets
5+
Bundle-Version: 1.0.0.qualifier
6+
Bundle-Vendor: VOGELLA
7+
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
8+
Require-Bundle: org.eclipse.swt;bundle-version="3.106.0"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
source.. = src/
2+
output.. = bin/
3+
bin.includes = META-INF/,\
4+
.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package com.vogella.swt.widgets.ctabfolder;
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.GridData;
7+
import org.eclipse.swt.layout.GridLayout;
8+
import org.eclipse.swt.widgets.Display;
9+
import org.eclipse.swt.widgets.Shell;
10+
import org.eclipse.swt.widgets.Text;
11+
12+
public class CTabFolderExample {
13+
public static void main(String[] args) {
14+
Display display = new Display();
15+
Shell shell = new Shell(display);
16+
17+
shell.setLayout(new GridLayout());
18+
// SWT.BOTTOM to show at the bottom
19+
CTabFolder folder = new CTabFolder(shell, SWT.TOP);
20+
GridData data = new GridData(SWT.FILL,
21+
SWT.FILL, true, true,
22+
2, 1);
23+
folder.setLayoutData(data);
24+
CTabItem cTabItem1 = new CTabItem(folder, SWT.NONE);
25+
cTabItem1.setText("Tab1");
26+
CTabItem cTabItem2 = new CTabItem(folder, SWT.NONE);
27+
cTabItem2.setText("Tab2");
28+
CTabItem cTabItem3 = new CTabItem(folder, SWT.NONE);
29+
cTabItem3.setText("Tab3");
30+
CTabItem cTabItem4 = new CTabItem(folder, SWT.NONE);
31+
cTabItem4.setText("Tab4");
32+
33+
shell.pack();
34+
shell.open();
35+
while (!shell.isDisposed()) {
36+
if (!display.readAndDispatch()) {
37+
display.sleep();
38+
}
39+
}
40+
}
41+
}

0 commit comments

Comments
 (0)