}
public void menuAboutToShow(IMenuManager menu) {
// slows down the menu and interferes with it for other editors;
// optimize on visibility
IEditorSite site = null;
boolean activeEditorIsVisible = false;
if (activeExtendedEditor != null && activeExtendedEditor.getEditorPart() != null)
site = activeExtendedEditor.getEditorPart().getEditorSite();
if (site == null)
return;
// Eclipse bug 48784 - [MPE] ClassCast exception Workbench page
// isPartVisiable for MultiPageSite
if (site instanceof MultiPageEditorSite) {
Object multiPageEditor = ((MultiPageEditorSite) site).getMultiPageEditor();
activeEditorIsVisible = multiPageEditor.equals(site.getPage().getActiveEditor()) || multiPageEditor.equals(site.getPage().getActivePart());
}
else {
activeEditorIsVisible = site.getWorkbenchWindow().getPartService().getActivePart().equals(activeExtendedEditor.getEditorPart());
}
// due to a delay class loading, don't return now
// if (!activeEditorIsVisible)
// return;