Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove view name from Eclipse menu Window -> Show View

I need to remove the name/shortcut of the view which I have created from the Window->Show View menu and add them as a separate menu.

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

like image 916
javdev Avatar asked Mar 01 '23 00:03

javdev


1 Answers

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

http://img8.i_mageshack.us/img8/3854/menuvisibility.png


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());

Vlad Ilie mentions in the comments:

as I only needed for the View to be completely inaccessible via usual GUI, activities were enough for me as per this blog post "eEclipse Activities – Hide / Display certain UI elements":

This would mean that programmatically the WorkbenchActivitySupport.setEnabledActivityIds(String[]) method can be used to enable or disable views after they've been introduced into an activity.

like image 91
VonC Avatar answered Mar 15 '23 04:03

VonC