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:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With