【问题标题】:Can't put content behind SWT Wizard Help Button无法将内容放在 SWT 向导帮助按钮后面
【发布时间】:2011-11-11 10:58:22
【问题描述】:

我创建了一个基于 SWT 的向导,它有一个自定义的帮助按钮。现在我想把一些内容放在后面,所以可能会打开一个 SWT 浏览器并显示一个预定义的 HTML Doc。但我不知道在哪里可以访问我的向导中的帮助按钮的操作。有什么想法吗?

【问题讨论】:

  • 贴出你的向导的代码,没有任何额外的信息很难帮助你..

标签: button swt wizard jface


【解决方案1】:

假设您正在使用标准的 JFace 接口和类来实现向导。因此,在您的向导页面 (extending org.eclipse.jface.wizard.WizardPage) 中,您只需覆盖 performHelp 方法。请参阅下面的 sn-p。

@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

【讨论】:

    猜你喜欢
    • 2015-12-02
    • 1970-01-01
    • 1970-01-01
    • 2015-11-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-23
    • 1970-01-01
    相关资源
    最近更新 更多