Re: Adding menu items to File --> New [message #92633] |
Sat, 12 July 2003 15:59  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.02942 seconds