我创建了一个基于SWT的向导,它有自定义的帮助按钮。现在我想把一些内容放在后面,所以也许SWT浏览器会开放,并且会显示预定义的HTML Doc。但我没有任何线索在我的向导中访问帮助按钮的操作。有什么想法吗?
答案 0 :(得分:8)
我假设您正在使用标准JFace接口和类来实现向导。因此,在向导页面(extending org.eclipse.jface.wizard.WizardPage
)中,您只需覆盖performHelp
方法。请参阅以下代码段。
@Override
public void performHelp()
{
Shell shell = new Shell(getShell());
shell.setText("My Custom Help !!");
shell.setLayout(new GridLayout());
shell.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
Browser browser = new Browser(shell, SWT.NONE);
browser.setUrl("http://stackoverflow.com/questions/7322489/cant-put-content-behind-swt-wizard-help-button");
browser.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
shell.open();
}
<强> >>Wizard image
强>
<强> >>After pressing the help button
强>