private String createContextHelp(IContextProvider provider, Control c) { if (provider == null) return createContextHelp(c); lastContext = provider.getContext(c); if (lastContext != null) { return formatHelpContext(lastContext); } return null; }
private void updateDynamicHelp(boolean explicitContext) { if (explicitContext && lastContext instanceof IContext2) { String title = ((IContext2)lastContext).getTitle(); if (title!=null) { updateDynamicHelp(stripMnemonic(title), lastControl); return; } } if (lastProvider != null || lastControl != null) updateDynamicHelp(lastProvider != null ? lastProvider .getSearchExpression(lastControl) : null, lastControl); }
private void handlePartActivation(IWorkbenchPartReference ref) { if (reusableHelpPart == null) return; if (!visible || !reusableHelpPart.isMonitoringContextHelp()) return; if (isThisPart(ref)) return; IWorkbenchPart part = ref.getPart(false); Display display = part.getSite().getShell().getDisplay(); Control c = display.getFocusControl(); if (c != null && c.isVisible() && !c.isDisposed()) { IContextProvider provider = (IContextProvider) part .getAdapter(IContextProvider.class); if (provider != null) { reusableHelpPart.update(provider, null, part, c); if ((provider.getContextChangeMask() & IContextProvider.SELECTION) != 0) { // context help changes with selections installSelectionListener(part); } } else reusableHelpPart.update(part, c); if (part instanceof IPageChangeProvider) installPageListener(part); } }
if ((provider == null) || ((provider.getContextChangeMask() & IContextProvider.SELECTION) != 0)) {
/** * */ private void addHelpListener() { // Set help on the view itself viewer.getControl().addHelpListener(e -> { IContextProvider provider = Adapters.adapt(ExtendedMarkersView.this, IContextProvider.class); if (provider == null) return; IContext context = provider.getContext(viewer.getControl()); PlatformUI.getWorkbench().getHelpSystem().displayHelp(context); }); }
public void handleActivation(IContextProvider provider, IContext context, Control c, IWorkbenchPart part) { if (text.isDisposed()) return; lastControl = c; lastProvider = provider; lastContext = context; lastPart = part; if (context==null && provider!=null) { lastContext = provider.getContext(c); } String helpText; if (lastContext!=null) helpText = formatHelpContext(lastContext); else helpText = createContextHelp(c); updateTitle(); if (getSection().isExpanded()) updateText(helpText); updateDynamicHelp(context!=null); }
else { IContextProvider provider = part.getAdapter(IContextProvider.class); IContext context = (provider != null) ? provider.getContext(control) : null; if (context != null) { buffer.append(toolkit.createHelpIdentifierSection(context));