public void createPartControl(Composite parent) { toolkit = new FormToolkit(parent.getDisplay()); form = toolkit.createScrolledForm(parent); form.setText("Hello, Eclipse Forms");
Composite body = form.getBody(); GridLayout layout = new GridLayout(); body.setLayout(layout); Hyperlink link = toolkit.createHyperlink(body, "Click here.",SWT.WRAP); link.addHyperlinkListener(new HyperlinkAdapter() { public void linkActivated(HyperlinkEvent e) { System.out.println("Link activated!"); } }); } ·首先获得Form的体内容,它是一个Composite对象