IEditorReference[] editors = page.getEditorReferences();
for (IEditorReference ref : editors) {
IEditorPart editor = ref.getEditor(false);
if (editor instanceof MapPart) {
MapPart mapPart = (MapPart) editor;
if(getMap() == mapPart.getMap()) {
return (IActionBars2) editor.getEditorSite().getActionBars();
}
}
}
IViewReference[] views = page.getViewReferences();
for (IViewReference ref : views) {
final IViewPart view = ref.getView(false);
if (view instanceof MapPart) {
MapPart mapPart = (MapPart) view;
if(getMap() == mapPart.getMap()) {
return new IActionBars2Adapter(view);
}
}
}