Skip to content

Commit 6a7dca3

Browse files
author
jossonsmith
committed
Add more example tabs
1 parent 72a78d0 commit 6a7dca3

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

tests/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CLabelTab.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class CLabelTab extends AlignableTab {
2828
/**
2929
* Creates the Tab within a given instance of ControlExample.
3030
*/
31-
CLabelTab(ControlExample instance) {
31+
public CLabelTab(ControlExample instance) {
3232
super(instance);
3333
}
3434

tests/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CTabFolderTab.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class CTabFolderTab extends Tab {
4444
/**
4545
* Creates the Tab within a given instance of ControlExample.
4646
*/
47-
CTabFolderTab(ControlExample instance) {
47+
public CTabFolderTab(ControlExample instance) {
4848
super(instance);
4949
}
5050

tests/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
package org.eclipse.swt.examples.controlexample;
1212

1313

14+
import net.sf.j2s.ajax.ARunnable;
1415
import net.sf.j2s.ajax.ASWTClass;
1516
import org.eclipse.swt.*;
1617
import org.eclipse.swt.events.SelectionAdapter;
@@ -62,6 +63,9 @@ public ControlExample(Composite parent) {
6263
"Label",
6364
// "Canvas",
6465
"Combo",
66+
"CLabel",
67+
"CTabFolder",
68+
"SashForm",
6569
// "CoolBar",
6670
// "Dialog",
6771
"Group",
@@ -89,10 +93,10 @@ public ControlExample(Composite parent) {
8993
}
9094
if (tabs.length > 0) {
9195
final TabItem item = tabFolder.getItem(0);
92-
ASWTClass.shellLoad(parent.getShell(), (String) item.getData(), new Runnable() {
96+
ASWTClass.shellLoad(parent.getShell(), (String) item.getData(), new ARunnable() {
9397
public void run() {
9498
try {
95-
Constructor constructor = Class.forName((String) item.getData()).getConstructor(new Class[] {ControlExample.class});
99+
Constructor constructor = getClazz().getConstructor(new Class[] {ControlExample.class});
96100
Object inst = constructor.newInstance(new Object[] {ControlExample.this});
97101
Tab tab = (Tab) inst;
98102
item.setControl(tab.createTabFolderPage(tabFolder));
@@ -113,10 +117,10 @@ public void widgetSelected(SelectionEvent e) {
113117
if (item.getControl() == null) {
114118
Object data = item.getData();
115119
if (data != null) {
116-
ASWTClass.shellLoad(tabFolder.getShell(), (String) data, new Runnable() {
120+
ASWTClass.shellLoad(tabFolder.getShell(), (String) data, new ARunnable() {
117121
public void run() {
118122
try {
119-
Constructor constructor = Class.forName((String) item.getData()).getConstructor(new Class[] {ControlExample.class});
123+
Constructor constructor = getClazz().getConstructor(new Class[] {ControlExample.class});
120124
Object inst = constructor.newInstance(new Object[] {ControlExample.this});
121125
Tab tab = (Tab) inst;
122126
if (((String) item.getData()).indexOf("Shell") != -1) {

tests/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SashFormTab.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class SashFormTab extends Tab {
4848
/**
4949
* Creates the Tab within a given instance of ControlExample.
5050
*/
51-
SashFormTab(ControlExample instance) {
51+
public SashFormTab(ControlExample instance) {
5252
super(instance);
5353
}
5454
void createExampleGroup () {

tests/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SashTab.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class SashTab extends Tab {
5353
/**
5454
* Creates the Tab within a given instance of ControlExample.
5555
*/
56-
SashTab(ControlExample instance) {
56+
public SashTab(ControlExample instance) {
5757
super(instance);
5858
}
5959

0 commit comments

Comments
 (0)