How does one add to the File->New menu?

View: New views
3 Messages — Rating Filter:   Alert me  

How does one add to the File->New menu?

by Jeff Johnston :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have a project conversion wizard that I wish to put in the File -> New
list.  I looked at the Managedbuilder UI plugin and found some code that
appeared to be used to add the Convert to C/C++ wizard but I can't get
it to work for my wizard.  I have the following:

<extension
       point="org.eclipse.ui.newWizards">
       <wizard
             category="org.eclipse.cdt.ui.newCWizards"
 
class="org.eclipse.linuxtools.internal.cdt.autotools.ui.wizards.ConvertToAutotoolsProjectWizard"
             finalPerspective="org.eclipse.cdt.ui.CPerspective"
             hasPages="true"
             icon="icons/ac16/convert_normal.gif"
 
id="org.eclipse.linuxtools.cdt.autotools.ui.wizards.conversionWizard"
             name="%ConvertWizard.name">
          <description>
             %ConvertWizard.description
          </description>
          <selection class="org.eclipse.core.resources.IProject"/>
       </wizard>
   <extension
         point="org.eclipse.ui.navigator.navigatorContent">
      <commonWizard
            associatedExtensionId="org.eclipse.cdt.ui.navigator.content"
            menuGroupId="org.eclipse.cdt.ui.newProject"
            type="new"
 
wizardId="org.eclipse.linuxtools.cdt.autotools.ui.wizards.conversionWizard">
                 <enablement>
                  <and>
                    <adapt type="org.eclipse.core.resources.IProject" />
                                <not>
                            <adapt type="org.eclipse.core.resources.IProject" >
                               <test
                                     property="org.eclipse.core.resources.projectNature"
                 
value="org.eclipse.linuxtools.cdt.autotools.core.autotoolsNatureV2"/>
                            </adapt>
                                </not>
                  </and>
          </enablement>
       </commonWizard>
   </extension>
   <extension
         point="org.eclipse.ui.navigator.viewer">
      <viewerContentBinding
viewerId="org.eclipse.ui.navigator.ProjectExplorer">
         <includes>
            <contentExtension
pattern="org.eclipse.linuxtools.cdt.autotools.ui.wizards.*"/>
         </includes>
      </viewerContentBinding>
   </extension>

I'm not sure what the contentExtension should be for the
navigator.viewer extension but I have tried a class pattern as well as a
Wizard id pattern and neither worked.  The wizard shows up fine under C/C++.

Is there some other piece I am missing or is what I am trying to do
simply not supported?

-- Jeff J.
_______________________________________________
cdt-dev mailing list
cdt-dev@...
https://dev.eclipse.org/mailman/listinfo/cdt-dev

RE: How does one add to the File->New menu?

by Leherbauer, Anton (Toni) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jeff,

to add an entry in the File > New menu, you need to add a
"newWizardShortcut" to the C/C++ perspective
(via a "perspectiveExtension").

HTH,
Toni


> -----Original Message-----
> From: cdt-dev-bounces@...
> [mailto:cdt-dev-bounces@...] On Behalf Of Jeff Johnston
> Sent: Monday, November 02, 2009 6:29 PM
> To: CDT General developers list.
> Subject: [cdt-dev] How does one add to the File->New menu?
>
> I have a project conversion wizard that I wish to put in the
> File -> New
> list.  I looked at the Managedbuilder UI plugin and found
> some code that
> appeared to be used to add the Convert to C/C++ wizard but I
> can't get
> it to work for my wizard.  I have the following:
>
> <extension
>        point="org.eclipse.ui.newWizards">
>        <wizard
>              category="org.eclipse.cdt.ui.newCWizards"
>  
> class="org.eclipse.linuxtools.internal.cdt.autotools.ui.wizard
> s.ConvertToAutotoolsProjectWizard"
>              finalPerspective="org.eclipse.cdt.ui.CPerspective"
>              hasPages="true"
>              icon="icons/ac16/convert_normal.gif"
>  
> id="org.eclipse.linuxtools.cdt.autotools.ui.wizards.conversionWizard"
>              name="%ConvertWizard.name">
>           <description>
>              %ConvertWizard.description
>           </description>
>           <selection class="org.eclipse.core.resources.IProject"/>
>        </wizard>
>    <extension
>          point="org.eclipse.ui.navigator.navigatorContent">
>       <commonWizard
>            
> associatedExtensionId="org.eclipse.cdt.ui.navigator.content"
>             menuGroupId="org.eclipse.cdt.ui.newProject"
>             type="new"
>  
> wizardId="org.eclipse.linuxtools.cdt.autotools.ui.wizards.conv
> ersionWizard">
> <enablement>
> <and>
>            <adapt type="org.eclipse.core.resources.IProject" />
> <not>
>            <adapt
> type="org.eclipse.core.resources.IProject" >
>               <test
>                    
> property="org.eclipse.core.resources.projectNature"
>
> value="org.eclipse.linuxtools.cdt.autotools.core.autotoolsNatureV2"/>
>            </adapt>
> </not>
> </and>
>           </enablement>
>        </commonWizard>
>    </extension>
>    <extension
>          point="org.eclipse.ui.navigator.viewer">
>       <viewerContentBinding
> viewerId="org.eclipse.ui.navigator.ProjectExplorer">
>          <includes>
>             <contentExtension
> pattern="org.eclipse.linuxtools.cdt.autotools.ui.wizards.*"/>
>          </includes>
>       </viewerContentBinding>
>    </extension>
>
> I'm not sure what the contentExtension should be for the
> navigator.viewer extension but I have tried a class pattern
> as well as a
> Wizard id pattern and neither worked.  The wizard shows up
> fine under C/C++.
>
> Is there some other piece I am missing or is what I am trying to do
> simply not supported?
>
> -- Jeff J.
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@...
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>
_______________________________________________
cdt-dev mailing list
cdt-dev@...
https://dev.eclipse.org/mailman/listinfo/cdt-dev

RE: How does one add to the File->New menu?

by Christian W. Damus-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Also, you will only see that shortcut take effect when the perspective is first instantiated (in a new workspace) or when it is "reset."  In case you're like me and you tend to use the same run-time workspace for testing day after day.

cW


On Thu, 2009-11-05 at 15:00 +0100, Leherbauer, Anton (Toni) wrote:
Jeff,

to add an entry in the File > New menu, you need to add a
"newWizardShortcut" to the C/C++ perspective
(via a "perspectiveExtension").

HTH,
Toni


> -----Original Message-----
> From: cdt-dev-bounces@... 
> [cdt-dev-bounces@...] On Behalf Of Jeff Johnston
> Sent: Monday, November 02, 2009 6:29 PM
> To: CDT General developers list.
> Subject: [cdt-dev] How does one add to the File->New menu?

--------8<--------




Christian W. Damus
Software Developer, IDE Team
QNX Software Systems

_______________________________________________
cdt-dev mailing list
cdt-dev@...
https://dev.eclipse.org/mailman/listinfo/cdt-dev