无法将内容置于SWT向导帮助按钮后面

eth*_*nix 5 swt jface button wizard

我创建了一个基于SWT的向导,它有自定义的帮助按钮.现在我想把一些内容放在后面,所以也许SWT浏览器会开放,并且会显示预定义的HTML Doc.但我没有任何线索在我的向导中访问帮助按钮的操作.任何的想法?

Fav*_*ius 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();
}
Run Code Online (Sandbox Code Playgroud)

>>Wizard image

在此输入图像描述

>>After pressing the help button

在此输入图像描述