use of org.eclipse.ui.part.EditorActionBarContributor in project webtools.sourceediting by eclipse.
the class GotoAnnotationAction method getStatusLineManager.
private IStatusLineManager getStatusLineManager() {
// The original JavaEditor M7 implementation made use of an adapter,
// but that approach
// fails with a MultiPageEditorSite
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window == null)
return null;
IWorkbenchPage page = window.getActivePage();
if (page == null)
return null;
IEditorPart editor = page.getActiveEditor();
if (editor == null)
return null;
IEditorActionBarContributor contributor = editor.getEditorSite().getActionBarContributor();
if (contributor instanceof EditorActionBarContributor) {
return ((EditorActionBarContributor) contributor).getActionBars().getStatusLineManager();
}
return null;
}
use of org.eclipse.ui.part.EditorActionBarContributor in project dbeaver by serge-rider.
the class ActionBars method extractActionBars.
public static IActionBars extractActionBars(IWorkbenchSite site) {
if (site == null) {
return null;
}
IWorkbenchPage page = site.getPage();
IWorkbenchPart activePart = page.getActivePart();
if (activePart instanceof IViewPart) {
IViewPart activeViewPart = (IViewPart) activePart;
IViewSite activeViewSite = activeViewPart.getViewSite();
return activeViewSite.getActionBars();
}
if (activePart instanceof IEditorPart) {
IEditorPart activeEditorPart = (IEditorPart) activePart;
IEditorActionBarContributor contributor = activeEditorPart.getEditorSite().getActionBarContributor();
if (contributor instanceof EditorActionBarContributor) {
return ((EditorActionBarContributor) contributor).getActionBars();
}
}
if (site instanceof IViewSite) {
IViewSite viewSite = (IViewSite) site;
return viewSite.getActionBars();
}
if (site instanceof IEditorSite) {
IEditorSite editorSite = (IEditorSite) site;
return editorSite.getActionBars();
}
if (site instanceof IIntroSite) {
IIntroSite introSite = (IIntroSite) site;
return introSite.getActionBars();
}
// OMG, what is it?
return null;
}
use of org.eclipse.ui.part.EditorActionBarContributor in project webtools.sourceediting by eclipse.
the class AbstractSection method getStatusLineManager.
protected static IStatusLineManager getStatusLineManager(IEditorPart editorPart) {
IStatusLineManager result = null;
try {
EditorActionBarContributor contributor = (EditorActionBarContributor) editorPart.getEditorSite().getActionBarContributor();
result = contributor.getActionBars().getStatusLineManager();
} catch (Exception e) {
}
return result;
}
use of org.eclipse.ui.part.EditorActionBarContributor in project core by jcryptool.
the class HexEditor method getStatusLineManager.
/**
* Returns the status line manager of this editor.
* @return the status line manager of this editor
*/
private IStatusLineManager getStatusLineManager() {
IEditorActionBarContributor contributor = getEditorSite().getActionBarContributor();
if (!(contributor instanceof EditorActionBarContributor))
return null;
IActionBars actionBars = ((EditorActionBarContributor) contributor).getActionBars();
if (actionBars == null)
return null;
return actionBars.getStatusLineManager();
}
use of org.eclipse.ui.part.EditorActionBarContributor in project dbeaver by dbeaver.
the class ActionBars method extractActionBars.
public static IActionBars extractActionBars(IWorkbenchSite site) {
if (site == null) {
return null;
}
IWorkbenchPage page = site.getPage();
IWorkbenchPart activePart = page.getActivePart();
if (activePart instanceof IViewPart) {
IViewPart activeViewPart = (IViewPart) activePart;
IViewSite activeViewSite = activeViewPart.getViewSite();
return activeViewSite.getActionBars();
}
if (activePart instanceof IEditorPart) {
IEditorPart activeEditorPart = (IEditorPart) activePart;
IEditorActionBarContributor contributor = activeEditorPart.getEditorSite().getActionBarContributor();
if (contributor instanceof EditorActionBarContributor) {
return ((EditorActionBarContributor) contributor).getActionBars();
}
}
if (site instanceof IViewSite) {
IViewSite viewSite = (IViewSite) site;
return viewSite.getActionBars();
}
if (site instanceof IEditorSite) {
IEditorSite editorSite = (IEditorSite) site;
return editorSite.getActionBars();
}
if (site instanceof IIntroSite) {
IIntroSite introSite = (IIntroSite) site;
return introSite.getActionBars();
}
// OMG, what is it?
return null;
}
Aggregations