Eclipse RCP: How to pre-select a new project wizard?

独自空忆成欢 提交于 2019-12-12 01:43:14

问题


I have an Eclipse plugin using RCP and Eclipse 4.5.2. This plugin is for developing a project of type "X". Right now, under File > New > Project... I have "X" within a category of "MyPlugin". I'd have to expand "MyPlugin" then double click on "X" to open the X version of the new project wizard.

Is it possible to pre-select "X" when clicking on File > New > Project...?

This would mean the category "MyPlugin" would have to be automatically expanded to show the pre-selected "X". Here's a snippet of my plugin.xml where the new project wizard for X is defined:

<extension point="org.eclipse.ui.newWizards">
    <wizard 
        category="com.mycompany.myproduct.core.ui.newWizards" 
        class="com.mycompany.myproduct.newXProjectWizard" 
        finalPerspective="com.mycompany.myproduct.ui.XPerspective" 
        hasPages="true" 
        icon="icons/project_new.gif" 
        id="com.mycompany.myproduct.newXProjectWizard" 
        name="%Names.NewProject" 
        preferredPerspectives="com.mycompany.myproduct.XPerspective" 
        project="true">
        <description>
            Create a new X project
        </description>
    </wizard>
</extension>

来源:https://stackoverflow.com/questions/38963427/eclipse-rcp-how-to-pre-select-a-new-project-wizard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!