Menu

[r3057]: / trunk / ch.sahits.codegen.test / fragments / headless_test / Taz2.java  Maximize  Restore  History

Download this file

70 lines (56 with data), 1.5 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package ch.sahits;
import java.util.Iterator;
import java.util.Vector;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.*;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
public class Taz {
private Display display = new Display();
private Shell shell = new Shell(display);
/**
* Default constructor initializes this GUI element
*/
public Taz(){
createControl(getShell());
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
// If no more entries in event queue
display.sleep();
}
}
display.dispose();
}
/**
* Create all the field instances
* @param parent container
*/
private void init(Composite parent){
}
/**
* Retrive the shell of this GUI element
* @return shell
*/
private Shell getShell(){
return shell;
}
/**
* Set the control up with the layout and the input fields
*/
private void createControl(Composite composite) {
Composite container = shell;//new Composite(composite, SWT.NULL);
init(container);
container.setFont(composite.getFont());
GridLayout layout = new GridLayout();
container.setLayout(layout);
int nColumns = 2;
layout.numColumns = nColumns;
layout.verticalSpacing = 9;
// Create the different elements
}
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.