-
Notifications
You must be signed in to change notification settings - Fork 4
/
Group_Mockup.java
77 lines (62 loc) · 2.39 KB
/
Group_Mockup.java
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
71
72
73
74
75
76
77
package org.eclipse.swt.group;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Device;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Text;
import com.xored.q7.quality.mockups.issues.BaseMockupPart;
public class Group_Mockup extends BaseMockupPart {
@Override
public Control construct(Composite parent) {
// TODO Auto-generated method stub
Composite composite = new Composite(parent, SWT.BORDER);
GridLayoutFactory.swtDefaults().numColumns(1).applyTo(composite);
GridDataFactory.swtDefaults().align(SWT.FILL, SWT.FILL)
.grab(true, true).applyTo(composite);
Device d = Display.getCurrent();
Group g1 = new Group(composite, SWT.NONE);
g1.setText("Group1");
g1.setLayout(new FillLayout());
for (int i = 0; i < 5; i++) {
Button button = new Button(g1, SWT.PUSH);
button.setText("Button" + (i + 1));
button.setToolTipText("Button " + (i+1));
}
Group g2 = new Group(composite, SWT.SHADOW_ETCHED_IN);
g2.setLayout(new FillLayout());
g2.setText("Group2");
Text t = new Text(g2, SWT.NONE);
t.setText("SHADOW_ETCHED_IN group");
Group g3 = new Group(composite, SWT.SHADOW_ETCHED_OUT);
g3.setLayout(new FillLayout());
g3.setText("Group3");
for (int i = 0; i < 5; i++) {
Button button = new Button(g3, SWT.PUSH);
button.setText("Button" + (i + 1));
button.setToolTipText("Button " + (i+1));
}
Group g4 = new Group(composite, SWT.SHADOW_IN);
g4.setLayout(new FillLayout());
//g4.setText("Group2");
Text t2 = new Text(g4, SWT.NONE);
t2.setText("SHADOW_IN nonamed group");
Group g5 = new Group(composite, SWT.SHADOW_IN);
g5.setLayout(new FillLayout());
g5.setText("Group5");
Text t3 = new Text(g5, SWT.NONE);
t3.setText("SHADOW_OUT");
FontData fontData = g5.getFont().getFontData()[0];
Font font = new Font(d, new FontData(fontData.getName(), fontData
.getHeight(), SWT.ITALIC));
g5.setFont(font);
return null;
}
}