use of org.eclipse.ui.part.IShowInSource in project egit by eclipse.
the class CommitEditor method getShowInContext.
@Override
public ShowInContext getShowInContext() {
IFormPage currentPage = getActivePageInstance();
IShowInSource showInSource = AdapterUtils.adapt(currentPage, IShowInSource.class);
if (showInSource != null) {
return showInSource.getShowInContext();
}
return null;
}
use of org.eclipse.ui.part.IShowInSource in project eclipse.platform.text by eclipse.
the class SearchView method fillContextMenu.
@Override
public void fillContextMenu(IMenuManager menuManager) {
ISearchResult result = getCurrentSearchResult();
if (result != null) {
// first check if we have a selection for the show in mechanism, bugzilla 127718
IShowInSource showInSource = getAdapter(IShowInSource.class);
if (showInSource != null) {
ShowInContext context = showInSource.getShowInContext();
if (context != null) {
ISelection sel = context.getSelection();
if (sel != null && !sel.isEmpty()) {
MenuManager showInSubMenu = new MenuManager(getShowInMenuLabel());
showInSubMenu.add(ContributionItemFactory.VIEWS_SHOW_IN.create(getViewSite().getWorkbenchWindow()));
menuManager.appendToGroup(IContextMenuConstants.GROUP_OPEN, showInSubMenu);
}
}
}
}
}
Aggregations