[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[platform-ui-dev] Customize StandardEditorSystemMenu
|
Hi!
How can the StandardEditorSystemMenu
(org.eclipse.ui.internal.presentations.util) be customized without
replacing code from eclipse packages?
i.e. Disable or hide SystemMenuNewEditor, SystemMenuClose, etc.
1) Get a reference on the Menu.
(this = individual editor derived from EditorPart)
EditorSite site = (EditorSite) this.getEditorSite();
WorkbenchPage page = (WorkbenchPage) site.getPage();
EditorAreaHelper helper = (EditorAreaHelper) page.getEditorPresentation();
EditorStack st = helper.getActiveWorkbook();
The reference to the menu is (from EditorStack) -> presentationSite ->
presentation -> systemMenu, but EditorStack.getPresentationSite() has
protected access.
2) Change construction of the menu.
Derive from EditorSite, WorkbenchPage, etc. , but the instance of
EditorAreaHelper is created in WorkbenchPage.init (private), so I cannot
exchange the object.
3) Get the reference on the MenuItems from Display.getMenuItem(int id), but
its package-wide.
Does anyone has an idea?
Thanks for your help!
Regards
--
Michael