开发者

Remove view name from Eclipse menu Window -> Show View

开发者 https://www.devze.com 2022-12-12 04:56 出处:网络
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.

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.


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

Remove view name from Eclipse menu Window -> Show View


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号