-
Notifications
You must be signed in to change notification settings - Fork 4
/
LinkTest.java
43 lines (32 loc) · 1.37 KB
/
LinkTest.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
package org.eclipse.swt.link;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text;
import com.xored.q7.quality.mockups.issues.BaseMockupPart;
public class LinkTest extends BaseMockupPart {
@Override
public Control construct(Composite parent) {
// TODO Auto-generated method stub
Composite composite = new Composite(parent, SWT.NONE);
GridDataFactory.swtDefaults().align(SWT.FILL, SWT.FILL)
.grab(true, true).applyTo(parent);
GridLayoutFactory.swtDefaults().numColumns(1).applyTo(composite);
Link l1 = new Link(composite, SWT.NONE);
final Text t1 = new Text (composite, SWT.None);
t1.setText("Listening...");
l1.setText("The SWT component is designed to provide <a>efficient</a>, <a>portable</a> <a href=\"native\">access to the UI facilities of the OSs</a> on which it is implemented.");
l1.addListener (SWT.Selection, new Listener () {
public void handleEvent(Event event) {
//System.out.println("Selection: " + event.text);
t1.setText(event.text);
}
});
return null;
}
}