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

时间:2011-09-06 15:38:48

标签: button swt wizard jface

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

1 个答案:

答案 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

enter image description here

<强> >>After pressing the help button

enter image description here