use of org.eclipse.ui.SubActionBars in project egit by eclipse.
the class MultiPageEditorContentOutlinePage method createOutlinePage.
private IPage createOutlinePage(IEditorPart editor) {
IContentOutlinePage outlinePage = AdapterUtils.adapt(editor, IContentOutlinePage.class);
if (outlinePage == null) {
pages.put(editor, emptyPage);
return emptyPage;
}
pages.put(editor, outlinePage);
if (outlinePage instanceof NestedContentOutlinePage) {
((Page) outlinePage).init(getSite());
}
SubActionBars pageBars = new SubActionBars(getSite().getActionBars());
bars.put(outlinePage, pageBars);
return outlinePage;
}
use of org.eclipse.ui.SubActionBars in project eclipse-integration-commons by spring-projects.
the class StsTaskEditorActionContributor method init.
@Override
public void init(IActionBars bars) {
super.init(bars);
sourceActionBars = new SubActionBars(bars);
}
use of org.eclipse.ui.SubActionBars in project egit by eclipse.
the class MultiPageEditorContentOutlinePage method dispose.
@Override
public void dispose() {
if (pageListener != null) {
editorPart.removePageChangedListener(pageListener);
pageListener = null;
}
pages.clear();
selectionListeners.clear();
for (SubActionBars bar : bars.values()) {
bar.dispose();
}
bars.clear();
if (currentPage instanceof ISelectionProvider) {
((ISelectionProvider) currentPage).removeSelectionChangedListener(globalSelectionListener);
}
currentPage = null;
if (book != null) {
book.dispose();
book = null;
}
if (emptyPage != null) {
emptyPage.dispose();
emptyPage = null;
}
}
use of org.eclipse.ui.SubActionBars in project egit by eclipse.
the class MultiPageEditorContentOutlinePage method showPage.
private void showPage(IPage page) {
if (page == null) {
page = emptyPage;
}
if (currentPage == page) {
return;
}
if (currentPage instanceof ISelectionProvider) {
((ISelectionProvider) currentPage).removeSelectionChangedListener(globalSelectionListener);
}
SubActionBars localBars = bars.get(currentPage);
if (localBars != null) {
localBars.deactivate();
}
currentPage = page;
if (currentPage instanceof ISelectionProvider) {
((ISelectionProvider) currentPage).addSelectionChangedListener(globalSelectionListener);
}
localBars = bars.get(currentPage);
Control control = page.getControl();
if (control == null || control.isDisposed()) {
page.createControl(book);
page.setActionBars(localBars);
control = page.getControl();
}
if (localBars != null) {
localBars.activate();
}
getSite().getActionBars().updateActionBars();
book.showPage(control);
if (currentPage instanceof ISelectionProvider) {
ISelection selection = ((ISelectionProvider) currentPage).getSelection();
fireSelectionChangedEvent(new SelectionChangedEvent((ISelectionProvider) currentPage, selection));
} else {
fireSelectionChangedEvent(new SelectionChangedEvent(this, StructuredSelection.EMPTY));
}
}
use of org.eclipse.ui.SubActionBars in project egit by eclipse.
the class CommitEditorActionBarContributor method init.
@Override
public void init(IActionBars bars) {
super.init(bars);
textEditorBars = new SubActionBars(bars);
textActionContributor.init(textEditorBars);
}
Aggregations