Display view in Eclipse menu Window-> Show View

javdev picture javdev · Nov 6, 2009 · Viewed 7.6k times · Source

"I have created an Eclipse plugin which creates a view in Eclipse. Currently it is displayed in the Eclipse menu as : 'Window->Show View->Others'.

I want to show it in 'Window -> Show View' and not under the submenu 'Others'.

I have tried it giving the 'Category' of the view in the plugin.xml file as 'org.eclipse.ui' but it is still showing the view in 'Others' submenu.

Is there any other way to do so? Any suggestions are helpful in this regard.

Thanks in advance, Abhinav"

Answer

derBiggi picture derBiggi · Nov 6, 2009

I think you can do that with a customized perspective.

In your plugin.xml, add an extension point for "org.eclipse.ui.perspectives", and create a new class implementing IPerspectiveFactory.

This class has a method "createInitialLayout( IPageLayout layout )", and on that layout you can call "layout.addShowViewShortcut( < ID of your view > )"

You can also add shortcuts for wizards etc. there.

Hope that helps, Andreas