Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Re: Adding menu items to File --> New
Re: Adding menu items to File --> New [message #92633] Sat, 12 July 2003 15:59 Go to next message
Eclipse UserFriend
Originally posted by: cecconae.ig.com.br

Firasat wrote:

> Simon Arsenault wrote:

> > See org.eclipse.ui.IPageLayout.addNewWizardShortcut method

> > Simon :-)
> > "Firasat" <fhussain@cysive.com> wrote in message
> > news:befd44$k9t$1@eclipse.org...
> > > I have created my own perspective with one view and editor. Currently
> > > when I select the File --> New menu, 'Project' and 'Other' items are
> > > displayed.
> > >
> > > How do I add my own menu items to the 'New' submenu. I have tried using
> > > actionSet extensions in plugin.xml without success. The best I was able
> > > to do was add the action directly to File menu. What is the correct menu
> > > bar path?
> > >
> > > In addition, is there a way to programatically add an action to the File
> > > --> New menu? How would one use org.eclipse.ui.actions.NewWizardMenu?
> > >
> > >
> > > Thanks.
> > >
> > >
> > >

> I have done what you said, however, I still have to go to Window -->
> Customize Perspective to activate it so it can be shown in File --> New.
> What am I doing wrong? Please site an example using the JDT perspective
> with class names.

> Thanks.


Hi Firasat :

Hope that help you.

To add a wizard in the File --> New menu programatically

public class WebPerspectiveFactory implements IPerspectiveFactory
{
public void createInitialLayout(IPageLayout pageLayout)
{
createActions(pageLayout);
}

public void createActions( IPageLayout pageLayout )
{
pageLayout.addNewWizardShortcut( "Your Wizard ID");
}
}

************************************************************ ***************
To add a wizard in the File --> New menu declarative way in plugin.xml

<!-- ============================================================ = -->
<!-- Purpose: Define perspective extension -->
<!-- ============================================================ = -->
<extension
point="org.eclipse.ui.perspectiveExtensions">

<perspectiveExtension
targetID="%your.perspective.id">
<perspectiveShortcut id="%your.perspective.id"/>
</perspectiveExtension>

<perspectiveExtension
targetID="%your.perspective.id">
<newWizardShortcut id="your.wizard.id"/>
</perspectiveExtension>

</extension>


Regards,

Antonio Edson Ceccon
Re: Adding menu items to File --> New [message #93460 is a reply to message #92633] Mon, 14 July 2003 16:16 Go to previous message
Eclipse UserFriend
Originally posted by: fhussain.cysive.com

Antonio Edson Ceccon wrote:

> Firasat wrote:

> > Simon Arsenault wrote:

> > > See org.eclipse.ui.IPageLayout.addNewWizardShortcut method

> > > Simon :-)
> > > "Firasat" <fhussain@cysive.com> wrote in message
> > > news:befd44$k9t$1@eclipse.org...
> > > > I have created my own perspective with one view and editor. Currently
> > > > when I select the File --> New menu, 'Project' and 'Other' items are
> > > > displayed.
> > > >
> > > > How do I add my own menu items to the 'New' submenu. I have tried
using
> > > > actionSet extensions in plugin.xml without success. The best I was
able
> > > > to do was add the action directly to File menu. What is the correct
menu
> > > > bar path?
> > > >
> > > > In addition, is there a way to programatically add an action to the
File
> > > > --> New menu? How would one use org.eclipse.ui.actions.NewWizardMenu?
> > > >
> > > >
> > > > Thanks.
> > > >
> > > >
> > > >

> > I have done what you said, however, I still have to go to Window -->
> > Customize Perspective to activate it so it can be shown in File --> New.
> > What am I doing wrong? Please site an example using the JDT perspective
> > with class names.

> > Thanks.


> Hi Firasat :

> Hope that help you.

> To add a wizard in the File --> New menu programatically

> public class WebPerspectiveFactory implements IPerspectiveFactory
> {
> public void createInitialLayout(IPageLayout pageLayout)
> {
> createActions(pageLayout);
> }

> public void createActions( IPageLayout pageLayout )
> {
> pageLayout.addNewWizardShortcut( "Your Wizard ID");
> }
> }

> ************************************************************ ***************
> To add a wizard in the File --> New menu declarative way in plugin.xml

> <!-- ============================================================ = -->
> <!-- Purpose: Define perspective extension -->
> <!-- ============================================================ = -->
> <extension
> point="org.eclipse.ui.perspectiveExtensions">

> <perspectiveExtension
> targetID="%your.perspective.id">
> <perspectiveShortcut id="%your.perspective.id"/>
> </perspectiveExtension>

> <perspectiveExtension
> targetID="%your.perspective.id">
> <newWizardShortcut id="your.wizard.id"/>
> </perspectiveExtension>

> </extension>


> Regards,

> Antonio Edson Ceccon

Antonio,

Thanks for the help. Adding the extension to the plugin.xml worked.

--Firasat
Previous Topic:Re: JVM crashes during debug
Next Topic:PDE: how to get workspace root for imported project?
Goto Forum:
  


Current Time: Tue May 13 23:47:04 EDT 2025

Powered by FUDForum. Page generated in 0.03185 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top