You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求助:Eclipse中从HTML/Javascript文档启动自定义动作遇阻,同Active Help页面问题

Troubleshooting: Launching Custom Wizard from Eclipse Active Help Page

Hey there! I’ve worked through similar Active Help wizard launch issues in Eclipse before, so let’s walk through some concrete fixes to get your custom action up and running:

  • Double-check your Active Help extension configuration
    Open your plugin.xml and verify the <activeHelp> extension is correctly linked to your action class. Make sure the class implements either IAction or IActiveHelpAction, and that its package is exported in your OSGi manifest (Export-Package section). Example config:

    <extension point="org.eclipse.ui.activeHelp">
      <topic 
        id="com.your.plugin.help.launch_wizard_topic" 
        label="Launch My Custom Wizard">
        <action 
          class="com.your.plugin.actions.LaunchWizardAction" 
          label="Start Wizard"/>
      </topic>
    </extension>
    
  • Validate the HTML/JS call syntax
    Ensure your Active Help link uses the correct format to trigger the action. Two common valid patterns:

    1. Direct action call via JavaScript:
      <a href="javascript:org.eclipse.ui.cheatsheets.openAction('com.your.plugin.actions.LaunchWizardAction')">Launch Custom Wizard</a>
      
    2. Link to the registered Active Help topic:
      <a href="activehelp://com.your.plugin.help.launch_wizard_topic">Launch Custom Wizard</a>
      

    Pro tip: Match the IDs exactly—case sensitivity matters here!

  • Confirm your custom wizard is properly registered
    If your action launches a wizard via its ID, make sure the wizard is registered in the org.eclipse.ui.newWizards extension. Example:

    <extension point="org.eclipse.ui.newWizards">
      <category id="com.your.plugin.wizard.category" name="My Plugins"/>
      <wizard
        id="com.your.plugin.wizard.custom_wizard"
        name="Custom Wizard"
        class="com.your.plugin.wizards.MyCustomWizard"
        category="com.your.plugin.wizard.category"
        icon="icons/wizban/custom_wiz.png">
      </wizard>
    </extension>
    

    In your action class, ensure you’re fetching the wizard correctly:

    public void run(IAction action) {
      IWizard wizard = PlatformUI.getWorkbench()
                                 .getNewWizardRegistry()
                                 .findWizard("com.your.plugin.wizard.custom_wizard");
      if (wizard != null) {
        WizardDialog dialog = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
        dialog.open();
      }
    }
    
  • Debug with logs and console output
    Launch Eclipse with the -consoleLog flag to catch any runtime errors (like class not found exceptions or ID mismatches). Add debug print statements or use Eclipse’s logging framework in your action’s run() method to confirm if the action is even being triggered.

  • Check Eclipse version compatibility
    Some older Eclipse versions have known bugs with Active Help JS triggers. If you’re running an outdated release, try upgrading to the latest LTS version (e.g., 2023-09) to rule out version-specific issues.

If none of these steps resolve the problem, sharing snippets of your plugin.xml and the relevant HTML/JS code would help narrow down the root cause further.

内容的提问来源于stack exchange,提问作者Gionata

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.14 08:54:02