0

I just want to add a new entry in New category as a child when right-clicking on any XML file. My plugin.xml file is as follows,

<plugin>
    <extension point="org.eclipse.ui.popupMenus">
        <objectContribution objectClass="org.eclipse.core.resources.IFile" 
        id="org.example.NewProject"
        nameFilter="*.xml">
            <action
                label="New Fun Project"
                icon="icons/sample.png"
                class="org.example.TestFunAction"
                id="org.example.NewProject">
            </action>
        </objectContribution>
    </extension>
</plugin>

currently New Fun Project entry has appeared in right-click menu and I want to add it under New category now. How can I move this to RightClick>New>New Fun Project?

Saji Liyanage
  • 35
  • 1
  • 3
  • Use the `org.eclipse.ui.newWizards` extension point – greg-449 May 08 '19 at 16:03
  • can you please give an example according to the above extension? – Saji Liyanage May 08 '19 at 16:16
  • See [this question](https://stackoverflow.com/q/30910813/2670892) for adding to the new project part of the New menu. You need to define a 'new wizard' and a `newWizardShortcut` using `org.eclipse.ui.perspectiveExtensions` – greg-449 May 08 '19 at 19:20

1 Answers1

0

Question solved by the following method

 <extension
         point="org.eclipse.ui.newWizards">
         <wizard name="Template" 
            class="org.example.TestFunAction"
            id="org.example.newtemplate"
            icon="icons/template.png">
            <description>template</description>
        </wizard>
   </extension>

    <extension point="org.eclipse.ui.navigator.navigatorContent">    
            <commonWizard type="new"
                wizardId="org.example.newtemplate">
                <enablement>
                  <adapt type="org.eclipse.core.resources.IFile">
                    <test property="org.eclipse.core.resources.extension" value="xml">
                            </test>        
                  </adapt>      
                </enablement>
            </commonWizard>
    </extension>
Saji Liyanage
  • 35
  • 1
  • 3