views:

272

answers:

2

I need to remove the name/shortcut of the view which I have created from the Window->Show View menu. Because I display this view in a separate menu.

Is there any way to hide/remove its entry from Window->Show View menu.

Thanks in advance

A: 

Hi,

I would suggest you to go to window->Preferences or customize perspective. I think this is place from where we can controls the menu's to be displayed. BTW how did u create ur own menu ???

Thanks

Samra
Hi Samra,Thanks for your quick reply.Actually I need to do it programmatically.I have created my own menu by creating new extension point 'org.eclipse.ui.menus' and placed commands in it by creating extension points of 'org.eclipse.ui.commands'. The handler classes for each of these commands is given by creating extension points in 'org.eclipse.ui.handlers'.
Abhinav Mishra
+1  A: 

You can add/remove any view from the "Show View" menu from the Customize Perspective / Menu Visibility tab:

alt text


To do the same thing programmatically would imply to follow the same course of action than the class org.eclipse.ui.internal.dialogs.CustomizePerspectiveDialog, and look into the method okPressed() for instance:

perspective.setShowViewActionIds(menu.getCheckedItemIds());
VonC
Hi VonC,Thanks for your quick reply.Can we do it programmatically?
Abhinav Mishra